function getAttribute(a,b){var c,d,e;try{c=a.getAttribute(b)}catch(f){}try{if(!c)for(e=0;e<a.attributes.length;e++){d=a.attributes[e].name.toLowerCase();if(d==b)return c=a.attributes[e].value}}catch(g){}return c}function setAttribute(a,b,c){if(b=="class"){a.setAttribute("className",c);a.setAttribute("class",c)}else a.setAttribute(b,c)}
function getChildren(a,b,c,d,e,f){e||(e="single");f||(f=-1);if(a){a=a.childNodes;for(var g=null,h=[],j=0;j<a.length;j++){strTagName=new String(a[j].tagName);children_class="?";if(strTagName!="undefined"){child_attribute=getAttribute(a[j],c);if((strTagName.toLowerCase()==b.toLowerCase()||b=="")&&(c==""||child_attribute==d))if(e=="all")h.push(a[j]);else return a[j];if(f!=0){g=getChildren(a[j],b,c,d,e,f-1);if(e=="all"){if(g.length>0)h=h.concat(g)}else if(g!=null)return g}}}if(e=="all")return h}return null}
function isChildOf(a,b){if(a){if(a==b)return true;for(;a.parentNode!="undefined";)return isChildOf(a.parentNode,b)}return false}function getMouseX(a){return a!=null&&typeof a.pageX!="undefined"?a.pageX:(a!=null?a.x:event.x)+document.documentElement.scrollLeft}function getMouseY(a){return a!=null&&typeof a.pageY!="undefined"?a.pageY:(a!=null?a.y:event.y)+document.documentElement.scrollTop}function calculeOffsetLeft(a){return calculeOffset(a,"offsetLeft")}
function calculeOffsetTop(a){return calculeOffset(a,"offsetTop")}function calculeOffset(a,b){for(var c=0;a;){c+=a[b];a=a.offsetParent}return c}function get_css_property(a,b){if(document.defaultView)return document.defaultView.getComputedStyle(a,null).getPropertyValue(b);else if(a.currentStyle){b=b.replace(/-\D/gi,function(c){return c.charAt(c.length-1).toUpperCase()});return a.currentStyle[b]}else return null}var _mCE;
function start_move_element(a,b,c){var d=(a.target||a.srcElement).id;if(b)d=b;c||(c=window);if(c.event)a=c.event;_mCE=c.document.getElementById(d);_mCE.frame=c;c.document.onmousemove=move_element;c.document.onmouseup=end_move_element;mouse_x=getMouseX(a);mouse_y=getMouseY(a);_mCE.start_pos_x=mouse_x-(_mCE.style.left.replace("px","")||calculeOffsetLeft(_mCE));_mCE.start_pos_y=mouse_y-(_mCE.style.top.replace("px","")||calculeOffsetTop(_mCE));return false}
function end_move_element(a){_mCE.frame.document.onmousemove="";_mCE.frame.document.onmouseup="";_mCE=null}function move_element(a){var b,c;if(_mCE.frame&&_mCE.frame.event)a=_mCE.frame.event;b=getMouseY(a)-_mCE.start_pos_y;a=getMouseX(a)-_mCE.start_pos_x;c=_mCE.frame.document.body.offsetWidth-_mCE.offsetWidth;max_top=_mCE.frame.document.body.offsetHeight-_mCE.offsetHeight;b=Math.min(Math.max(0,b),max_top);a=Math.min(Math.max(0,a),c);_mCE.style.top=b+"px";_mCE.style.left=a+"px";return false}
var nav=editAreaLoader.nav;function getSelectionRange(a){return{start:a.selectionStart,end:a.selectionEnd}}function setSelectionRange(a,b,c){a.focus();b=Math.max(0,Math.min(a.value.length,b));c=Math.max(b,Math.min(a.value.length,c));if(nav.isOpera&&nav.isOpera<9.6){a.selectionEnd=1;a.selectionStart=0;a.selectionEnd=1;a.selectionStart=0}a.selectionStart=b;a.selectionEnd=c;nav.isIE&&set_IE_selection(a)}
function get_IE_selection(a){var b=document,c,d,e,f,g,h,j,k,m,l;if(a&&a.focused){if(!a.ea_line_height){c=b.createElement("div");c.style.fontFamily=get_css_property(a,"font-family");c.style.fontSize=get_css_property(a,"font-size");c.style.visibility="hidden";c.innerHTML="0";b.body.appendChild(c);a.ea_line_height=c.offsetHeight;b.body.removeChild(c)}b=b.selection.createRange();try{d=b.duplicate();d.moveToElementText(a);d.setEndPoint("EndToEnd",b);if(d.parentElement()==a){e=a;for(f=0;e.parentNode;){f+=
e.scrollTop;e=e.parentNode}g=b.offsetTop-calculeOffsetTop(a)+f;h=Math.round(g/a.ea_line_height+1);j=Math.round(b.boundingHeight/a.ea_line_height);k=d.text.length-b.text.length;l=a.value.substr(0,k).split("\n");k+=(h-l.length)*2;a.selectionStart=k;m=a.selectionStart+b.text.length;l=a.value.substr(0,k+b.text.length).split("\n");m+=(h+j-1-l.length)*2;a.selectionEnd=m}}catch(n){}}a&&a.id&&setTimeout("get_IE_selection(document.getElementById('"+a.id+"'));",50)}
function IE_textarea_focus(){event.srcElement.focused=true}function IE_textarea_blur(){event.srcElement.focused=false}
function set_IE_selection(a){var b,c,d;if(!window.closed){b=a.value.substr(0,a.selectionStart).split("\n").length-1;c=a.value.substr(0,a.selectionEnd).split("\n").length-1;try{d=document.selection.createRange();d.moveToElementText(a);d.setEndPoint("EndToStart",d);d.moveStart("character",a.selectionStart-b);d.moveEnd("character",a.selectionEnd-c-(a.selectionStart-b));d.select()}catch(e){}}}editAreaLoader.waiting_loading["elements_functions.js"]="loaded";
EditAreaLoader.prototype.start_resize_area=function(){var a=document,b,c,d;a.onmouseup=editAreaLoader.end_resize_area;a.onmousemove=editAreaLoader.resize_area;editAreaLoader.toggle(editAreaLoader.resize.id);b=editAreas[editAreaLoader.resize.id].textarea;c=a.getElementById("edit_area_resize");if(!c){c=a.createElement("div");c.id="edit_area_resize";c.style.border="dashed #888888 1px"}a=b.offsetWidth-2;d=b.offsetHeight-2;c.style.display="block";c.style.width=a+"px";c.style.height=d+"px";b.parentNode.insertBefore(c,
b);b.style.display="none";editAreaLoader.resize.start_top=calculeOffsetTop(c);editAreaLoader.resize.start_left=calculeOffsetLeft(c)};
EditAreaLoader.prototype.end_resize_area=function(){var a=document,b,c,d;a.onmouseup="";a.onmousemove="";a=a.getElementById("edit_area_resize");b=editAreas[editAreaLoader.resize.id].textarea;c=Math.max(editAreas[editAreaLoader.resize.id].settings.min_width,a.offsetWidth-4);d=Math.max(editAreas[editAreaLoader.resize.id].settings.min_height,a.offsetHeight-4);if(editAreaLoader.isIE==6){c-=2;d-=2}b.style.width=c+"px";b.style.height=d+"px";a.style.display="none";b.style.display="inline";b.selectionStart=
editAreaLoader.resize.selectionStart;b.selectionEnd=editAreaLoader.resize.selectionEnd;editAreaLoader.toggle(editAreaLoader.resize.id);return false};
EditAreaLoader.prototype.resize_area=function(a){var b,c;b=editAreas[editAreaLoader.resize.id].settings.allow_resize;if(b=="both"||b=="y"){c=Math.max(20,getMouseY(a)-editAreaLoader.resize.start_top);document.getElementById("edit_area_resize").style.height=c+"px"}if(b=="both"||b=="x"){a=Math.max(20,getMouseX(a)-editAreaLoader.resize.start_left);document.getElementById("edit_area_resize").style.width=a+"px"}return false};editAreaLoader.waiting_loading["resize_area.js"]="loaded";
EditAreaLoader.prototype.get_regexp=function(a){res="(\\b)(";for(i=0;i<a.length;i++){if(i>0)res+="|";res+=this.get_escaped_regexp(a[i])}res+=")(\\b)";reg=new RegExp(res);return res};EditAreaLoader.prototype.get_escaped_regexp=function(a){return a.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g,"\\$1")};
EditAreaLoader.prototype.init_syntax_regexp=function(){var a={};for(var b in this.load_syntax)if(!this.syntax[b]){this.syntax[b]={};this.syntax[b].keywords_reg_exp={};this.keywords_reg_exp_nb=0;if(this.load_syntax[b].KEYWORDS){param="g";if(this.load_syntax[b].KEYWORD_CASE_SENSITIVE===false)param+="i";for(var c in this.load_syntax[b].KEYWORDS)if(typeof this.load_syntax[b].KEYWORDS[c]!="function"){this.syntax[b].keywords_reg_exp[c]=new RegExp(this.get_regexp(this.load_syntax[b].KEYWORDS[c]),param);
this.keywords_reg_exp_nb++}}if(this.load_syntax[b].OPERATORS){var d="",e=0;for(c in this.load_syntax[b].OPERATORS)if(typeof this.load_syntax[b].OPERATORS[c]!="function"){if(e>0)d+="|";d+=this.get_escaped_regexp(this.load_syntax[b].OPERATORS[c]);e++}if(d.length>0)this.syntax[b].operators_reg_exp=new RegExp("("+d+")","g")}if(this.load_syntax[b].DELIMITERS){d="";e=0;for(c in this.load_syntax[b].DELIMITERS)if(typeof this.load_syntax[b].DELIMITERS[c]!="function"){if(e>0)d+="|";d+=this.get_escaped_regexp(this.load_syntax[b].DELIMITERS[c]);
e++}if(d.length>0)this.syntax[b].delimiters_reg_exp=new RegExp("("+d+")","g")}d=[];this.syntax[b].quotes={};e=[];if(this.load_syntax[b].QUOTEMARKS)for(c in this.load_syntax[b].QUOTEMARKS)if(typeof this.load_syntax[b].QUOTEMARKS[c]!="function"){var f=this.get_escaped_regexp(this.load_syntax[b].QUOTEMARKS[c]);this.syntax[b].quotes[f]=f;e[e.length]="("+f+"(\\\\.|[^"+f+"])*(?:"+f+"|$))";d.push(f)}this.syntax[b].comments={};if(this.load_syntax[b].COMMENT_SINGLE)for(c in this.load_syntax[b].COMMENT_SINGLE)if(typeof this.load_syntax[b].COMMENT_SINGLE[c]!=
"function"){f=this.get_escaped_regexp(this.load_syntax[b].COMMENT_SINGLE[c]);e[e.length]="("+f+"(.|\\r|\\t)*(\\n|$))";d.push(f);this.syntax[b].comments[f]="\n"}if(this.load_syntax[b].COMMENT_MULTI)for(c in this.load_syntax[b].COMMENT_MULTI)if(typeof this.load_syntax[b].COMMENT_MULTI[c]!="function"){f=this.get_escaped_regexp(c);var g=this.get_escaped_regexp(this.load_syntax[b].COMMENT_MULTI[c]);e[e.length]="("+f+"(.|\\n|\\r)*?("+g+"|$))";d.push(f);d.push(g);this.syntax[b].comments[c]=this.load_syntax[b].COMMENT_MULTI[c]}if(e.length>
0)this.syntax[b].comment_or_quote_reg_exp=new RegExp("("+e.join("|")+")","gi");if(d.length>0)this.syntax[b].syntax_trace_regexp=new RegExp("((.|\n)*?)(\\\\*("+d.join("|")+"|$))","gmi");if(this.load_syntax[b].SCRIPT_DELIMITERS){this.syntax[b].script_delimiters={};for(c in this.load_syntax[b].SCRIPT_DELIMITERS)if(typeof this.load_syntax[b].SCRIPT_DELIMITERS[c]!="function")this.syntax[b].script_delimiters[c]=this.load_syntax[b].SCRIPT_DELIMITERS}this.syntax[b].custom_regexp={};if(this.load_syntax[b].REGEXPS)for(c in this.load_syntax[b].REGEXPS)if(typeof this.load_syntax[b].REGEXPS[c]!=
"function"){d=this.load_syntax[b].REGEXPS[c];this.syntax[b].custom_regexp[d.execute]||(this.syntax[b].custom_regexp[d.execute]={});this.syntax[b].custom_regexp[d.execute][c]={regexp:new RegExp(d.search,d.modifiers),"class":d["class"]}}if(this.load_syntax[b].STYLES){a[b]={};for(c in this.load_syntax[b].STYLES)if(typeof this.load_syntax[b].STYLES[c]!="function")if(typeof this.load_syntax[b].STYLES[c]!="string")for(var h in this.load_syntax[b].STYLES[c])a[b][h]=this.load_syntax[b].STYLES[c][h];else a[b][c]=
this.load_syntax[b].STYLES[c]}d="";for(c in a[b])if(a[b][c].length>0){d+="."+b+" ."+c.toLowerCase()+" span{"+a[b][c]+"}\n";d+="."+b+" ."+c.toLowerCase()+"{"+a[b][c]+"}\n"}this.syntax[b].styles=d}};editAreaLoader.waiting_loading["reg_syntax.js"]="loaded";
