-
Notifications
You must be signed in to change notification settings - Fork 5
/
xed-compressed.js
1 lines (1 loc) · 60.7 KB
/
xed-compressed.js
1
var xed_initial_value=new Array();var xed_path="";var xed_web_path="";var xed_prefix="";var xed_default_link="http://";var xed_site_url=location.protocol+"://"+location.host;var xed_site_domain=location.host;var xed_boxes=false;var xed_box_link="/index/boxchooser-app?";var xed_box_image="/pix/box.gif";var xed_forms=false;var xed_form_link="/index/formchooser-app?";var xed_form_image="/pix/form.gif";var xed_images_link="/index/xed-images-action?";var xed_images=true;var xed_spellchecker=false;var xed_scroller=false;var xed_scroller_data=false;var xed_preview_css="/inc/html/default/site.css";var xed_preview_insert_close=true;var xed_edit_mode="edit";var xed_edit_state="edit";var xed_source_positioned=false;var xed_agent=navigator.userAgent.toLowerCase();var xed_msie=((xed_agent.indexOf("msie")!=-1)&&(xed_agent.indexOf("opera")==-1));var xed_msie7=false;var xed_ff36=false;var xed_events=[];var xed_error_window=false;var xed_history=[];var xed_future=[];var xed_undo_max_length=12;var xed_prev_char=0;var xed_context_menu=false;var xed_mouse_x=0;var xed_mouse_y=0;var xed_max_height=false;var xed_max_width=false;var xed_img_popup=false;var xed_login_timer=0;var xed_rx_tag_name=/(<\/|<)\s*([^ \t\n>]+)/ig;var xed_selected=false;var xed_fullsize=false;var xed_debug_view=false;var xed_selected_node=null;var xed_rpc=new rpc();var xed_loading_ifname=null;function xed_do_nothing(g){}function xed_init(l){try{xed_initial_value[l]=decodeURIComponent(xed_initial_value[l])}catch(m){xed_initial_value[l]=unescape(xed_initial_value[l])}try{xed_scroller_data=decodeURIComponent(xed_scroller_data)}catch(m){xed_scroller_data=unescape(xed_scroller_data)}for(var j=0;j<xed_templates.length;j++){try{xed_templates[j]=decodeURIComponent(xed_templates[j])}catch(m){xed_templates[j]=unescape(xed_templates[j])}}m=document.getElementById(l);m.contentWindow.document.designMode="on";if(xed_safari){m.contentWindow.document.execCommand("styleWithCSS",false,false)}else{if(!xed_msie){try{m.contentWindow.document.execCommand("styleWithCSS",false,false)}catch(g){m.contentWindow.document.execCommand("useCSS",false,"")}}}if(xed_msie7&&xed_initial_value[l].length==0){xed_initial_value[l]="<p>Enter your content here.</p>"}if(xed_initial_value[l].length>0){try{m.contentWindow.document.body.innerHTML=xed_initial_value[l]}catch(g){if(xed_initial_value[l].match(/^<xt:/i)||xed_initial_value[l].match(/^<p><xt:/i)||xed_initial_value[l].match(/^<p><\/p><xt:/i)){xed_initial_value[l]=" <br />"+xed_initial_value[l]}m.contentWindow.document.write(xed_initial_value[l]);links=m.contentWindow.document.getElementsByTagName("a");winhref=window.location.href;if(winhref.indexOf("#")!=-1){arr=winhref.split("#");winhref=arr.shift()}for(j=0;j<links.length;j++){if(links[j].href.indexOf(winhref+"#")!=-1){arr=links[j].href.split("#");links[j].href="#"+arr.pop()}}xed_loading_ifname=l;window.setTimeout(function(){html=xed_get_source(xed_loading_ifname);html=html.replace(/><\/xt:(box|form)>/ig,">").replace(/<\/xt:(box|form) \/>/ig,"</xt:$1>");xed_set_source(xed_loading_ifname,html)},10)}}if(xed_fullsize){width=screen.availWidth-100;if(width>1000){width=1000}height=screen.availHeight-250;m.style.width=width;m.style.height=height}m=document.getElementById(l);m.contentWindow.document.designMode="off";m.contentWindow.document.designMode="on";if(xed_safari){m.contentWindow.document.execCommand("styleWithCSS",false,false)}else{if(!xed_msie){try{m.contentWindow.document.execCommand("styleWithCSS",false,false)}catch(g){m.contentWindow.document.execCommand("useCSS",false,"")}}}xed_add_events(m.contentWindow.document,["keydown","keypress","mousedown","mouseup","drag","focus","mousemove"],xed_event);if(xed_adobeair){m.contentWindow.document.addEventListener("click",function(q){if(q.srcElement.nodeName.toLowerCase()=="a"){q.preventDefault()}},true)}m.contentWindow.document.ifname=l;xed_login_timer=setInterval("rpc_call (xed_web_path + '/index/xed-notimeout-action');",900000);if(xed_scroller){scroller_init("xed-"+l+"-reference",l);r=document.getElementById("xed-"+l+"-reference");try{r.contentWindow.document.body.innerHTML=xed_scroller_data}catch(g){r.contentWindow.document.write(s.value)}}}function xed_copy_value(j,g){html=xed_get_source(g);j.elements[g].value=html}function xed_preview(g){p=window.open("about:blank","xedPreviewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,fullscreen=no,width=500,height=400,top=100,left=150");if(xed_preview_css.length>0){p.document.write('<link rel="stylesheet" type="text/css" href="'+xed_preview_css+'" />')}p.document.write(xed_get_source(g));if(xed_preview_insert_close){p.document.write('<p align="center"><a href="javascript: window.close ()"><strong>Close Window</strong></a></p>')}return false}function xed_write_to_element(j,g){document.getElementById(g).innerHTML=xed_html_entities(xed_get_source(j));return false}function xed_safari_fix(g){if(!xed_safari){return false}html=xed_get_source(g);html=html.replace(/<span class="Apple-style-span" style="font-weight: bold; ?">([^<]+)<\/span>/g,"<strong>$1</strong>");html=html.replace(/<span class="Apple-style-span" style="font-style: italic; ?">([^<]+)<\/span>/g,"<em>$1</em>");html=html.replace(/<span class="Apple-style-span" style="text-decoration: underline; ?">([^<]+)<\/span>/g,"<u>$1</u>");html=html.replace(/<span class="Apple-style-span" style="vertical-align: sub; ?">([^<]+)<\/span>/g,"<sub>$1</sub>");html=html.replace(/<span class="Apple-style-span" style="vertical-align: super; ?">([^<]+)<\/span>/g,"<sup>$1</sup>");xed_set_source(g,html)}function xed_bold(j){xed_historian(j);if(!xed_msie){try{document.getElementById(j).contentWindow.document.execCommand("styleWithCSS",false,false)}catch(g){document.getElementById(j).contentWindow.document.execCommand("useCSS",false,"")}}document.getElementById(j).contentWindow.document.execCommand("Bold",false,null);xed_safari_fix(j);document.getElementById(j).contentWindow.focus();return false}function xed_italic(j){xed_historian(j);if(!xed_msie){try{document.getElementById(j).contentWindow.document.execCommand("styleWithCSS",false,false)}catch(g){document.getElementById(j).contentWindow.document.execCommand("useCSS",false,"")}}document.getElementById(j).contentWindow.document.execCommand("Italic",false,null);xed_safari_fix(j);document.getElementById(j).contentWindow.focus();return false}function xed_horizontal_rule(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("InsertHorizontalRule",false,null);document.getElementById(g).contentWindow.focus();return false}function xed_underline(j){xed_historian(j);if(!xed_msie){try{document.getElementById(j).contentWindow.document.execCommand("styleWithCSS",false,false)}catch(g){document.getElementById(j).contentWindow.document.execCommand("useCSS",false,"")}}document.getElementById(j).contentWindow.document.execCommand("Underline",false,null);xed_safari_fix(j);document.getElementById(j).contentWindow.focus();return false}function xed_align_left(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("JustifyLeft",false,null);document.getElementById(g).contentWindow.focus();return false}function xed_align_right(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("JustifyRight",false,null);document.getElementById(g).contentWindow.focus();return false}function xed_align_center(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("JustifyCenter",false,null);document.getElementById(g).contentWindow.focus();return false}function xed_unordered_list(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("InsertUnorderedList",false,null);document.getElementById(g).contentWindow.focus();return false}function xed_ordered_list(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("InsertOrderedList",false,null);document.getElementById(g).contentWindow.focus();return false}function xed_indent(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("Indent",false,null);document.getElementById(g).contentWindow.focus();return false}function xed_outdent(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("Outdent",false,null);document.getElementById(g).contentWindow.focus();return false}function xed_link(g){n=xed_get_parent(g);if(n.tagName.toLowerCase()=="a"){xed_select_node(g,n);return xed_unlink(g)}if(xed_msie){h=350}else{h=300}w=window.open(xed_web_path+"/index/xed-link-form?ifname="+g,"xedLinkWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,fullscreen=no,width=580,height="+h+",top=100,left=150");return false}function xed_add_link(j,g){xed_historian(j);if(xed_get_selection(j)==""){n=xed_get_parent(j);xed_select_node(j,n)}xed_insert_element(j,"a",g);document.getElementById(j).contentWindow.focus()}function xed_unlink(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("Unlink",false,null);document.getElementById(g).contentWindow.focus();return false}function xed_image(ifname){eval("imagechooser_"+ifname+"_attrs = true");eval("imagechooser_"+ifname+"_get_image (ifname)");return false}function xed_set_image(l,q,m,u,j,g){xed_historian(l);e=document.getElementById(l);if(xed_max_height<j||xed_max_width<g){hw_resized=true;if(j>g){g=g*(xed_max_height/j);j=xed_max_height}else{j=j*(xed_max_width/g);g=xed_max_width}}else{hw_resized=false}if(document.all){img="";if(hw_resized&&xed_img_popup){img+='<a href="'+q+'" target="_blank">'}img+='<img src="'+q+'" alt="'+m+'"';if(j!=false&&g!=false){img=img+' height="'+j+'" width="'+g+'"'}if(u!=false){img=img+' align="'+u+'"'}img=img+' border="0" />';if(hw_resized&&xed_img_popup){img+="</a>"}document.getElementById(l).contentWindow.focus()}else{img=e.contentWindow.document.createElement("img");img.setAttribute("src",q);if(j!=false&&g!=false){img.setAttribute("height",j);img.setAttribute("width",g)}if(u!=false){img.setAttribute("align",u)}img.setAttribute("alt",m);img.setAttribute("border",0);if(hw_resized&&xed_img_popup){img_inner=img;img=e.contentWindow.document.createElement("a");img.setAttribute("href",q);img.setAttribute("target","_blank");img.appendChild(img_inner)}}xed_insert_node_at_selection(e.contentWindow,img);document.getElementById(l).contentWindow.focus()}function xed_clean(g){w=window.open("about:blank","xedCleanersWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,fullscreen=no,width=300,height=100,top=100,left=150");f=document.forms[0];xed_copy_value(f,g);t=f.target;a=f.action;f.target="xedCleanersWindow";f.action=xed_prefix+"/index/xed-cleaners-action?ifname="+g;f.submit();f.target=t;f.action=a;return false}function xed_cleaner(g,j){xed_historian(g);document.getElementById(g).contentWindow.document.body.innerHTML=unescape(j);return false}function xed_filechooser(g){filechooser_attrs=true;filechooser_get_file(g);return false}function xed_set_file(j,l,g){xed_historian(j);e=document.getElementById(j);if(document.all){arr=l.split("?file=");g=arr.pop();txt="";if(window.getSelection){txt=e.contentWindow.getSelection();e.contentWindow.selection.clear()}else{if(document.getSelection){txt=e.contentWindow.document.getSelection();e.contentWindow.document.selection.clear()}else{if(document.selection){txt=e.contentWindow.document.selection.createRange().text;e.contentWindow.document.selection.clear()}}}if(txt.length==0){txt=g}file='<a href="'+l+'">'+txt+"</a>"}else{file=e.contentWindow.document.createElement("a");file.setAttribute("href",l);txt="";if(window.getSelection){txt=e.contentWindow.getSelection()}else{if(document.getSelection){txt=e.contentWindow.document.getSelection()}else{if(document.selection){txt=e.contentWindow.document.selection.createRange().text}}}if(txt.length==0){txt=g}txt=e.contentWindow.document.createTextNode(txt);file.appendChild(txt)}document.getElementById(j).contentWindow.focus();xed_insert_node_at_selection(e.contentWindow,file);document.getElementById(j).contentWindow.focus()}function xed_select(j,l){xed_historian(j);c1=document.getElementById(l).selectedIndex;var g=document.getElementById(l).options[c1].value;if(g.length==0){g="<p>"}if(g=="<pre>"){xed_insert_pre(j)}else{document.getElementById(j).contentWindow.document.execCommand("formatblock",false,g);document.getElementById(l).selectedIndex=0}document.getElementById(j).contentWindow.focus();return false}function xed_table(g){w=window.open(xed_web_path+"/index/xed-tablesizer-action?ifname="+g,"xedTableWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,fullscreen=no,width=300,height=300,top=100,left=150");return false}function xed_insert_table(u,q){xed_historian(u);var g=q.split("x");var G=g.shift();var C=g.shift();var B=document.getElementById(u);if(document.all){var E='<table border="2" cellpadding="5" cellspacing="2" width="98%">';for(var A=0;A<G;A++){E=E+"\n\t<tr>";for(var m=0;m<C;m++){E=E+'\n\t\t<td border="2" valign="top"><br /></td>'}E=E+"\n\t</tr>"}E=E+"\n</table>\n"}else{var E=B.contentWindow.document.createElement("table");E.setAttribute("width","98%");for(var A=0;A<G;A++){var F=B.contentWindow.document.createElement("tr");for(var m=0;m<C;m++){var l=B.contentWindow.document.createElement("td");l.setAttribute("valign","top");var D=B.contentWindow.document.createElement("br");l.appendChild(D);F.appendChild(l)}E.appendChild(F)}}document.getElementById(u).contentWindow.focus();xed_insert_node_at_selection(B.contentWindow,E);document.getElementById(u).contentWindow.focus();return false}function xed_table_cellspan(m){try{var g=m.colSpan==""?1:parseInt(m.colSpan);var l=m.rowSpan==""?1:parseInt(m.rowSpan);return{colspan:g,rowspan:l}}catch(j){return{colspan:1,rowspan:1}}}function xed_table_grid(j){var g=new Array();if(xed_msie){for(i=0;i<j.rows.length;i++){cur=j.rows[i];for(x=0;x<cur.cells.length;x++){td=cur.cells[x];sd=xed_table_cellspan(td);for(y=x;g[i]&&g[i][y];y++){}for(i2=i;i2<i+sd.rowspan;i2++){if(!g[i2]){g[i2]=new Array()}for(y2=y;y2<y+sd.colspan;y2++){g[i2][y2]=td}}}}return g}for(i=0;i<j.childNodes.length;i++){cur=j.childNodes[i];if(cur.tagName&&cur.tagName.toLowerCase()=="tbody"){for(x=0;x<cur.childNodes.length;x++){if(cur.childNodes[x].tagName&&cur.childNodes[x].tagName.toLowerCase()=="tr"){tr=cur.childNodes[x];for(y=0;y<tr.childNodes.length;y++){if(tr.childNodes[y].tagName&&tr.childNodes[y].tagName.toLowerCase()=="td"){td=tr.childNodes[y];sd=xed_table_cellspan(td);for(z=x;g[i]&&g[i][z];z++){}for(i2=i;i2<i+sd.rowspan;i2++){if(!g[i2]){g[i2]=new Array()}for(z2=z;z2<z+sd.colspan;z2++){g[i2][z2]=td}}}}}}}else{if(cur.tagName&&cur.tagName.toLowerCase()=="tr"){for(x=0;x<cur.childNodes.length;x++){if(cur.childNodes[x].tagName&&cur.childNodes[x].tagName.toLowerCase()=="td"){td=cur.childNodes[x];sd=xed_table_cellspan(td);for(y=x;g[i]&&g[i][y];y++){}for(i2=i;i2<i+sd.rowspan;i2++){if(!g[i2]){g[i2]=new Array()}for(y2=y;y2<y+sd.colspan;y2++){g[i2][y2]=td}}}}}}}return g}function xed_table_cellpos(j,m){var l,g;for(l=0;l<j.length;l++){for(g=0;g<j[l].length;g++){if(j[l][g]==m){return{cellindex:g,rowindex:l}}}}return null}function xed_table_get_cell(j,l,g){if(j[l]&&j[l][g]){return j[l][g]}return null}function xed_table_add_rows(u,m,q){xed_historian(ifname);ifname=xed_get_ifname(u);e=document.getElementById(ifname);u.rowSpan=1;var g=xed_get_next_element(m);for(var l=1;l<q&&g;l++){var j=e.contentWindow.document.createElement("td");j.innerHTML="<br />";if(xed_msie){g.insertBefore(j,g.cells(u.cellIndex))}else{g.insertBefore(j,g.cells[u.cellIndex])}g=xed_get_next_element(g)}}function xed_table_row_before(l){xed_historian(l);var g=xed_get_ancestors(l);var m=null;var j=null;for(i=0;i<g.length;i++){el=g[i];if(!el){continue}if(el.tagName.toLowerCase()=="tr"){m=el}else{if(el.tagName.toLowerCase()=="table"||el.tagName.toLowerCase()=="tbody"){j=el;break}}}if(xed_msie){new_tr=j.insertRow(m.rowIndex);for(i=0;i<m.cells.length;i++){new_td=new_tr.insertCell(-1);new_td.innerHTML="<br />";new_td.colSpan=m.cells[i].colSpan}return}e=document.getElementById(l);new_tr=e.contentWindow.document.createElement("tr");for(i=0;i<m.cells.length;i++){td=e.contentWindow.document.createElement("td");td.innerHTML="<br />";td.colSpan=m.cells[i].colSpan;new_tr.appendChild(td)}m.parentNode.insertBefore(new_tr,m)}function xed_table_row_after(l){xed_historian(l);var g=xed_get_ancestors(l);var m=null;var j=null;for(i=0;i<g.length;i++){el=g[i];if(!el){continue}if(el.tagName.toLowerCase()=="tr"){m=el}else{if(el.tagName.toLowerCase()=="table"||el.tagName.toLowerCase()=="tbody"){j=el;break}}}if(xed_msie){next=xed_get_next_element(m);new_tr=j.insertRow(next.rowIndex);for(i=0;i<m.cells.length;i++){new_td=new_tr.insertCell(-1);new_td.innerHTML="<br />";new_td.colSpan=m.cells[i].colSpan}return}e=document.getElementById(l);new_tr=e.contentWindow.document.createElement("tr");for(i=0;i<m.cells.length;i++){td=e.contentWindow.document.createElement("td");td.innerHTML="<br />";td.colSpan=m.cells[i].colSpan;new_tr.appendChild(td)}next=xed_get_next_element(m);if(next){next.parentNode.insertBefore(new_tr,next)}else{m.parentNode.appendChild(new_tr)}}function xed_table_row_delete(m){xed_historian(m);var j=xed_get_ancestors(m);var q=null;var l=null;for(var g=j.length;--g>=0;){el=j[g];if(!el){continue}if(el.tagName.toLowerCase()=="tr"){q=el}else{if(el.tagName.toLowerCase()=="table"){l=el}}}q.parentNode.removeChild(q)}function xed_table_col_before(l){xed_historian(l);var C=xed_get_ancestors(l);var j=null;var B=null;for(var m=C.length;--m>=0;){el=C[m];if(!el){continue}if(el.tagName.toLowerCase()=="td"){j=el}else{if(el.tagName.toLowerCase()=="table"){B=el}}}var g=xed_table_grid(B);var u=xed_table_cellpos(g,j);var A=null;if(xed_msie){for(var q=0;q<g.length;q++){j=xed_table_get_cell(g,q,u.cellindex);if(j!=A){sd=xed_table_cellspan(j);if(sd.colspan==1){new_td=j.parentNode.insertCell(u.cellindex);new_td.innerHTML="<br />";new_td.rowSpan=j.rowSpan}else{j.colSpan++}A=j}}return}for(var q=0;j=xed_table_get_cell(g,q,u.cellindex);q++){if(j!=A){sd=xed_table_cellspan(j);if(sd.colspan==1){new_td=document.getElementById(l).contentWindow.document.createElement(j.nodeName);new_td.innerHTML="<br />";new_td.rowSpan=j.rowSpan;j.parentNode.insertBefore(new_td,j)}else{j.colSpan++}A=j}}}function xed_table_col_after(l){xed_historian(l);var C=xed_get_ancestors(l);var j=null;var B=null;for(var m=C.length;--m>=0;){el=C[m];if(!el){continue}if(el.tagName.toLowerCase()=="td"){j=el}else{if(el.tagName.toLowerCase()=="table"){B=el}}}var g=xed_table_grid(B);var u=xed_table_cellpos(g,j);var A=null;if(xed_msie){for(var q=0;q<g.length;q++){j=xed_table_get_cell(g,q,u.cellindex);if(j!=A){sd=xed_table_cellspan(j);if(sd.colspan==1){next=xed_get_next_element(j);npos=xed_table_cellpos(g,next);new_td=j.parentNode.insertCell(npos.cellindex);new_td.innerHTML="<br />";new_td.rowSpan=j.rowSpan}else{j.colSpan++}A=j}}return}for(var q=0;j=xed_table_get_cell(g,q,u.cellindex);q++){if(j!=A){sd=xed_table_cellspan(j);if(sd.colspan==1){new_td=document.getElementById(l).contentWindow.document.createElement(j.nodeName);new_td.innerHTML="<br />";new_td.rowSpan=j.rowSpan;next=xed_get_next_element(j);if(next){next.parentNode.insertBefore(new_td,next)}else{j.parentNode.appendChild(new_td)}}else{j.colSpan++}A=j}}}function xed_table_col_delete(q){xed_historian(q);var l=xed_get_ancestors(q);var B=null;var m=null;for(var j=l.length;--j>=0;){el=l[j];if(!el){continue}if(el.tagName.toLowerCase()=="td"){B=el}else{if(el.tagName.toLowerCase()=="table"){m=el}}}var g=xed_table_grid(m);var A=xed_table_cellpos(g,B);for(var u=0;B=xed_table_get_cell(g,u,A.cellindex);u++){B.parentNode.removeChild(B)}}function xed_table_merge(U){xed_historian(U);var N=new Array();var S=xed_get_selection(U);var m=xed_get_ancestors(U);var J=null;var q=null;var X=null;for(var T=m.length;--T>=0;){el=m[T];if(!el){continue}if(el.tagName.toLowerCase()=="td"){J=el}else{if(el.tagName.toLowerCase()=="tr"){q=el}else{if(el.tagName.toLowerCase()=="table"){X=el}}}}var j=xed_table_grid(X);if(xed_msie||S.rangeCount==1){if(!J){if(!q){return}J=q.cells[0]}var Q=xed_get_next_element(J);J.colSpan=J.colSpan+Q.colSpan;Q.parentNode.deleteCell(Q.cellIndex);return}else{var D=new Array();var S=xed_get_selection(U);var E=null;var Y=null;var W=-1,B=-1,V,A;if(S.rangeCount<2){return true}for(var T=0;T<S.rangeCount;T++){var H=S.getRangeAt(T);var J=H.startContainer.childNodes[H.startOffset];if(!J){break}if(J.nodeName.toLowerCase()=="td"){D[D.length]=J}}var F=j;for(var L=0;L<F.length;L++){var G=new Array();for(var M=0;M<F[L].length;M++){var J=F[L][M];for(var T=0;T<D.length;T++){if(J==D[T]){G[G.length]=J}}}if(G.length>0){N[N.length]=G}}var Y=new Array();var E=null;for(var L=0;L<j.length;L++){for(var M=0;M<j[L].length;M++){j[L][M]._selected=false;for(var T=0;T<D.length;T++){if(j[L][M]==D[T]){if(W==-1){W=M;B=L}V=M;A=L;j[L][M]._selected=true}}}}for(var L=B;L<=A;L++){for(var M=W;M<=V;M++){if(!j[L][M]._selected){alert("You can only merge cells horizontally.");return true}}}}var C=1,I=1;var aa=-1;for(var L=0;L<N.length;L++){var K=0;for(var M=0;M<N[L].length;M++){var g=xed_table_cellspan(N[L][M]);K+=g.colspan;if(aa!=-1&&g.rowspan!=aa){alert("You can only merge cells horizontally.");return true}aa=g.rowspan}if(K>I){I=K}aa=-1}var u=-1;for(var M=0;M<N[0].length;M++){var P=0;for(var L=0;L<N.length;L++){var g=xed_table_cellspan(N[L][M]);P+=g.rowspan;if(u!=-1&&g.colspan!=u){alert("You can only merge cells horizontally.");return true}u=g.colspan}if(P>C){C=P}u=-1}J=N[0][0];J.rowSpan=C;J.colSpan=I;for(var L=0;L<N.length;L++){for(var M=0;M<N[L].length;M++){var O=N[L][M].innerHTML;var Z=O.replace(new RegExp("[ \t\r\n]","g"),"");if(Z!="<br/>"&&Z!="<br>"&&Z!=" "&&(M+L>0)){J.innerHTML+=O}if(N[L][M]!=J&&!N[L][M]._deleted){var l=xed_table_cellpos(j,N[L][M]);var q=N[L][M].parentNode;q.removeChild(N[L][M]);N[L][M]._deleted=true;if(!q.hasChildNodes()){q.parentNode.removeChild(q);var R=null;for(var M=0;cell=xed_table_get_cell(j,l.rowindex,M);M++){if(cell!=last_cell&&cell.rowSpan>1){cell.rowSpan--}last_cell=cell}if(J.rowSpan>1){J.rowSpan--}}}}}}function xed_table_split_merged(m){xed_historian(m);var l=xed_get_ancestors(m);var B=null;for(j=0;j<l.length;j++){el=l[j];if(!el){continue}if(el.tagName.toLowerCase()=="td"){B=el;break}}var u=xed_table_cellspan(B);var A=u.colspan;var q=u.rowspan;if(A>1||q>1){B.colSpan=1;for(var j=1;j<A;j++){var g=doc.createElement("td");g.innerHTML="<br />";B.parentNode.insertBefore(g,xed_get_next_element(B));if(q>1){xed_table_add_rows(g,B.parentNode,q)}}xed_table_add_rows(B,B.parentNode,q)}}function xed_insert_element(l,j,g){xed_historian(l);e=document.getElementById(l);d=e.contentWindow.document;for(i=0;i<g.length;i++){g[i].value=g[i].value.replace(/&/g,"&")}if(document.all){tag="<"+j;for(i=0;i<g.length;i++){tag+=" "+g[i].name+' ="'+g[i].value+'"'}tag+=">";len=tag.length;sel=document.getElementById(l).contentWindow.document.selection;range=sel.createRange();inn=range.htmlText;while(inn.match(/^<([a-zA-Z0-9\:_-]+)[^>]*>/)){inn=inn.replace(/^<([a-zA-Z0-9\:_-]+)[^>]*>/,"")}while(inn.match(/<\/[^>]+>$/)){inn=inn.replace(/<\/[^>]+>$/,"")}tag+=inn;if(tag.length==len){empty=true;len2=0}else{empty=false;len2=inn.length*-1}tag+="</"+j+">";range.pasteHTML(tag);range.moveStart("character",len2);range.select()}else{if(xed_safari){tag="##STARTNEWELEMENT##";tag2="<"+j;for(i=0;i<g.length;i++){tag2+=" "+g[i].name+'="'+g[i].value+'"'}tag2+=">";tag_end="##ENDNEWELEMENT##";tag2_end="</"+j+">";sel=document.getElementById(l).contentWindow.getSelection();range=document.getElementById(l).contentWindow.document.createRange();range.setStart(sel.anchorNode,sel.anchorOffset);range.setEnd(sel.focusNode,sel.focusOffset);pre=sel.focusNode.data.substring(0,sel.focusOffset);post=sel.focusNode.data.substring(sel.focusOffset);sel.focusNode.data=pre+tag_end+post;pre=sel.anchorNode.data.substring(0,sel.anchorOffset);post=sel.anchorNode.data.substring(sel.anchorOffset);sel.anchorNode.data=pre+tag+post;html=xed_get_source(l);html=html.replace(/##STARTNEWELEMENT##/g,tag2);html=html.replace(/##ENDNEWELEMENT##/g,tag2_end);xed_set_source(l,html,true)}else{len=j.length+2;tag=d.createElement(j);for(i=0;i<g.length;i++){tag.setAttribute(g[i].name,g[i].value);len+=5+g[i].name.length+g[i].value.length}sel=xed_get_selection(l);range=sel.getRangeAt(0);inn=range.extractContents();tag.appendChild(inn);if(tag.innerHTML.length==0){empty=true}else{empty=false}xed_insert_node_at_selection(e.contentWindow,tag)}}e.contentWindow.focus();return false}function xed_insert_pre(g){xed_historian(g);name="pre";attrs=[];e=document.getElementById(g);d=e.contentWindow.document;if(document.all){tag="<"+name;for(i=0;i<attrs.length;i++){tag+=" "+attrs[i].name+' ="'+attrs[i].value+'"'}tag+=">";len=tag.length;sel=document.getElementById(g).contentWindow.document.selection;range=sel.createRange();inn=range.htmlText;while(inn.match(/<([a-zA-Z0-9\:_-]+)[^>]*>/)){inn=inn.replace(/<([a-zA-Z0-9\:_-]+)[^>]*>/,"")}while(inn.match(/<\/[^>]+>/)){inn=inn.replace(/<\/[^>]+>/,"")}tag+=inn;if(tag.length==len){empty=true;len2=0}else{empty=false;len2=inn.length*-1}tag+="</"+name+">";range.pasteHTML(tag);range.moveStart("character",len2);range.select()}else{len=name.length+2;tag=d.createElement(name);for(i=0;i<attrs.length;i++){tag.setAttribute(attrs[i].name,attrs[i].value);len+=5+attrs[i].name.length+attrs[i].value.length}sel=xed_get_selection(g);range=sel.getRangeAt(0);inn=range.extractContents();html=xed_get_html(inn,false,false);while(html.match(/<([a-zA-Z0-9\:_-]+)[^>]*>/)){html=html.replace(/<([a-zA-Z0-9\:_-]+)[^>]*>/,"")}while(html.match(/<\/[^>]+>/)){html=html.replace(/<\/[^>]+>/,"")}tag.appendChild(e.contentWindow.document.createTextNode(html));if(tag.innerHTML.length==0){empty=true}else{empty=false}xed_insert_node_at_selection(e.contentWindow,tag)}e.contentWindow.focus();return false}function xed_charmap(g){w=window.open(xed_web_path+"/index/xed-charmap-action?ifname="+g,"xedCharmapWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,fullscreen=no,width=480,height=250,top=100,left=150");return false}function xed_insert_character(g,j){xed_historian(g);if(document.all){sel=document.getElementById(g).contentWindow.document.selection;range=sel.createRange();range.cutHTML;range.pasteHTML("&#"+j+";")}else{xed_insert_html_at_selection(g,"&#"+j+";")}document.getElementById(g).contentWindow.focus();return false}function xed_edit_properties(j,g){if(!g){g=xed_get_parent(j)}if(g.tagName.toLowerCase()=="tbody"){g=g.parentNode}if(xed_msie&&g.tagName.toLowerCase()=="box"){tag_name="xt:box"}else{tag_name=g.tagName.toLowerCase()}p="?ifname="+j+"&tag="+tag_name;for(i=0;i<g.attributes.length;i++){p+="&"+g.attributes[i].name+"="+xed_url_encode(g.attributes[i].value)}w=window.open(xed_web_path+"/index/xed-properties-action"+p,"xedEditProperties","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,fullscreen=no,width=580,height=400,top=100,left=150");return false}function xed_word_importer(g){w=window.open(xed_web_path+"/index/xed-importer-form?ifname="+g,"XedWordImporter","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,fullscreen=no,width=480,height=250,top=100,left=150");return false}function xed_word_importer_return(j,g){xed_historian(j);xed_insert_html_at_selection(j,g);document.getElementById(j).contentWindow.focus()}function xed_set_properties(g,j){xed_historian(g);element=xed_get_parent(g);if(element.tagName.toLowerCase()=="tbody"){element=element.parentNode}for(i=0;i<element.attributes.length;i++){if(xed_msie){if(element.tagName.toLowerCase()=="box"&&element.attributes[i].name=="style"){continue}element.removeAttribute(element.attributes[i].name)}else{element.setAttribute(element.attributes[i].name,null)}}if(element.tagName.toLowerCase()=="xt:box"||(xed_msie&&element.tagName.toLowerCase()=="box")){inner="";sep=" (";for(i=0;i<j.length;i++){j[i].value=j[i].value.replace(/&/g,"&");element.setAttribute(j[i].name,j[i].value);if(j[i].name=="name"){inner+=j[i].value}else{if(j[i].name!="style"&&j[i].name!="title"){inner+=sep+j[i].name+"="+j[i].value;sep=", "}}}if(j.length>1){inner+=")"}element.innerHTML=inner}else{for(i=0;i<j.length;i++){j[i].value=j[i].value.replace(/&/g,"&");element.setAttribute(j[i].name,j[i].value)}}document.getElementById(g).contentWindow.focus();return false}function xed_superscript(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("superscript",false,null);xed_safari_fix(g);document.getElementById(g).contentWindow.focus();return false}function xed_subscript(g){xed_historian(g);document.getElementById(g).contentWindow.document.execCommand("subscript",false,null);xed_safari_fix(g);document.getElementById(g).contentWindow.focus();return false}function xed_historian(g){s=xed_get_source(g);if(xed_history.length==0||s!=xed_history[xed_history.length-1]){xed_history.push(s)}while(xed_history.length>xed_undo_max_length){xed_history.shift()}while(xed_future.length>xed_undo_max_length){xed_future.shift()}xed_debug(xed_history.length+"|"+xed_future.length)}function xed_show_history(g){o="";for(i=0;i<xed_history.length;i++){o+=i+". "+xed_history[i]+"\n"}o+="----------\n";for(i=0;i<xed_future.length;i++){o+=i+". "+xed_future[i]+"\n"}alert(o);document.getElementById(g).contentWindow.focus();return false}function xed_undo(g){if(xed_history.length>0){c=xed_get_source(g);s=xed_history.pop();while(c==s){t=s;s=xed_history.pop();if(s==null){s=t;break}}xed_future.push(c);document.getElementById(g).contentWindow.document.body.innerHTML=s}document.getElementById(g).contentWindow.focus();return false}function xed_redo(g){if(xed_future.length>0){c=xed_get_source(g);s=xed_future.pop();while(c==s){t=s;s=xed_future.pop();if(s==null){s=t;break}}xed_history.push(c);document.getElementById(g).contentWindow.document.body.innerHTML=s}document.getElementById(g).contentWindow.focus();return false}function xed_cut(g){try{document.getElementById(g).contentWindow.document.execCommand("cut",false,null)}catch(j){if(confirm("Due to limitations in the Mozilla browser, ordinary scripts cannot access the clipboard. Click OK to see a technical note at mozilla.org which shows you how to allow a script to access the clipboard.")){window.open("http://mozilla.org/editor/midasdemo/securityprefs.html")}}document.getElementById(g).contentWindow.focus();return false}function xed_copy(g){try{document.getElementById(g).contentWindow.document.execCommand("copy",false,null)}catch(j){if(confirm("Due to limitations in the Mozilla browser, ordinary scripts cannot access the clipboard. Click OK to see a technical note at mozilla.org which shows you how to allow a script to access the clipboard.")){window.open("http://mozilla.org/editor/midasdemo/securityprefs.html")}}document.getElementById(g).contentWindow.focus();return false}function xed_paste(g){try{document.getElementById(g).contentWindow.document.execCommand("paste",false,null)}catch(j){if(confirm("Due to limitations in the Mozilla browser, ordinary scripts cannot access the clipboard. Click OK to see a technical note at mozilla.org which shows you how to allow a script to access the clipboard.")){window.open("http://mozilla.org/editor/midasdemo/securityprefs.html")}}document.getElementById(g).contentWindow.focus();return false}function xed_help(g){window.open(xed_web_path+"/index/help-app?appname=xed","xedHelpWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,fullscreen=no,width=640,height=480,top=100,left=150");return false}function xed_full_screen(g){width=750;height=550;width=screen.availWidth-50;height=screen.availHeight-75;if(width>1050){width=1050}w=window.open("","xedFullscreenWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,fullscreen=no,width="+width+",height="+height+",top=25,left=25");f=document.getElementById("xed-"+g+"-fsform");f.elements.xeditor.value=xed_get_source(g);f.submit();return false}function xed_template(l,j){xed_historian(l);c1=document.getElementById(j).selectedIndex;if(c1!=0){var g=document.getElementById(j).options[c1].value;document.getElementById(j).selectedIndex=0;if(g==""){}else{if(g=="ADD TEMPLATE"){var q=l;var m=j;prompt("Please enter a name for your template","",function(u){if(u==false||u==null||u.length==0){return}value=xed_get_source(q);rpc_call(xed_web_path+"/index/xed-template-add-action?name="+u+"&body="+xed_url_encode(value));tlist=document.getElementById(m);for(i=0;i<tlist.options.length;i++){if(tlist.options[i].text==u){xed_templates[tlist.options[i].value]=value;num=tlist.options[i].value;break}if(tlist.options[i].value=="ADD TEMPLATE"){xed_templates.push(value);num=xed_templates.length-1;if(document.all){tmp=tlist.options[i];tlist.options.remove(i);tlist.options[i]=new Option(u,num,false,true);tlist.options[i+1]=tmp;tlist.selectedIndex=0}else{tmp=tlist.options[i];tlist.options[i]=null;o=document.createElement("option");o.text=u;o.value=num;tlist.add(o,null);tlist.add(tmp,null)}break}}})}else{xed_insert_html_at_selection(l,xed_html_entities_decode(xed_templates[g]))}}}return false}function xed_attribute(g,j){obj=new Object();obj.name=g;obj.value=j;return obj}function xed_create_box(ifname){if(xed_msie){document.getElementById(ifname).contentWindow.focus()}eval("boxchooser_"+ifname+"_get_file (ifname)");return false}function xed_insert_box(l,j,m,g){xed_historian(l);e=document.getElementById(l);if(document.all){box='<xt:box name="'+j+'" title="'+j+'" style="word-wrap: break-word; display: list-item; list-style-type: none; background-color: #b7c3cf; -moz-border-radius: 10px; min-height: 20px; width: 575px; font-weight: normal; padding: 15px 15px 15px 15px; margin: 5px;"';if(g.length>0){for(i=0;i<g.length;i++){g[i].value=unescape(g[i].value);box=box+" "+g[i].name+'="'+g[i].value+'"'}}box=box+">";txt=j;if(g.length>0){txt+=" (";sep="";for(i=0;i<g.length;i++){txt+=sep+g[i].name+"="+g[i].value;sep=", "}txt+=")"}box=box+txt+"</xt:box>"}else{box=e.contentWindow.document.createElement("xt:box");box.setAttribute("name",j);box.setAttribute("title",j);box.setAttribute("style","word-wrap: break-word; display: list-item; list-style-type: none; background-color: #b7c3cf; -moz-border-radius: 10px; min-height: 20px; width: 575px; font-weight: normal; padding: 15px 15px 15px 15px; margin: 5px;");if(g.length>0){for(i=0;i<g.length;i++){g[i].value=unescape(g[i].value);box.setAttribute(g[i].name,g[i].value)}}txt=j;if(g.length>0){txt+=" (";sep="";for(i=0;i<g.length;i++){txt+=sep+g[i].name+"="+g[i].value;sep=", "}txt+=")"}box.appendChild(e.contentWindow.document.createTextNode(txt))}xed_insert_node_at_selection(e.contentWindow,box);document.getElementById(l).contentWindow.focus()}function xed_create_form(g){formchooser_get_file(g);return false}function xed_insert_form(l,j,m,g){xed_historian(l);e=document.getElementById(l);j=j.replace("/forms/","/");if(document.all){box='<xt:form name="'+j+'" title="'+j+'" style="word-wrap: break-word; display: list-item; list-style-type: none; background-color: #b7c3cf; -moz-border-radius: 10px; min-height: 20px; width: 575px; font-weight: normal; padding: 15px 15px 15px 15px; margin: 5px;"';if(g.length>0){for(i=0;i<g.length;i++){box=box+" "+g[i].name+'="'+g[i].value+'"'}}box=box+">";txt=j;if(g.length>0){txt+=" (";sep="";for(i=0;i<g.length;i++){txt+=sep+g[i].name+"="+g[i].value;sep=", "}txt+=")"}box=box+txt+"</xt:form>"}else{box=e.contentWindow.document.createElement("xt:form");box.setAttribute("name",j);box.setAttribute("title",j);box.setAttribute("style","display: list-item; list-style-type: none; background-color: #b7c3cf; -moz-border-radius: 10px; min-height: 20px; width: 575px; font-weight: normal; padding: 15px 15px 15px 15px; margin: 5px;");if(g.length>0){for(i=0;i<g.length;i++){box.setAttribute(g[i].name,g[i].value)}}txt=j;if(g.length>0){txt+=" (";sep="";for(i=0;i<g.length;i++){txt+=sep+g[i].name+"="+g[i].value;sep=", "}txt+=")"}box.appendChild(e.contentWindow.document.createTextNode(txt))}xed_insert_node_at_selection(e.contentWindow,box);document.getElementById(l).contentWindow.focus()}function xed_rtl(g){xed_historian(g);document.getElementById(g).contentWindow.document.body.style.direction="rtl";document.getElementById(g).contentWindow.focus();return false}function xed_ltr(g){xed_historian(g);document.getElementById(g).contentWindow.document.body.style.direction="ltr";document.getElementById(g).contentWindow.focus();return false}function xed_spell_checker(g){w=window.open(xed_web_path+"/index/xed-spell-pleasewait-action?ifname="+g+"&text="+xed_url_encode(xed_get_source(g)),"xedSpellWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,fullscreen=no,width=600,height=425,top=50,left=50");return false}function xed_set_source(l,j){if(arguments.length==3&&xed_safari){}else{xed_historian(l)}document.getElementById(l).contentWindow.document.body.innerHTML=xed_html_entities_decode(j);if(xed_msie){links=document.getElementById(l).contentWindow.document.getElementsByTagName("a");winhref=window.location.href;if(winhref.indexOf("#")!=-1){arr=winhref.split("#");winhref=arr.shift()}for(i=0;i<links.length;i++){if(links[i].href.indexOf(winhref+"#")!=-1){arr=links[i].href.split("#");links[i].href="#"+arr.pop()}}}document.getElementById(l).contentWindow.document.designMode="on";try{try{document.getElementById(l).contentWindow.document.execCommand("styleWithCSS",false,false)}catch(g){document.getElementById(l).contentWindow.document.execCommand("useCSS",false,"")}}catch(g){}document.getElementById(l).contentWindow.focus();return false}function xed_mode(j,l){if(xed_edit_mode==l){}html=xed_get_source(j);if(l=="source"){if(xed_msie){h=550}else{h=500}w=window.open(xed_web_path+"/index/xed-source-form?ifname="+j+"&html=","xedSourceWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,fullscreen=no,width=700,height="+h+",top=25,left=25");return false;p=new Prompter(function(q){if(q==null||q==undefined||q==false){document.getElementById(j).contentWindow.focus();return false}document.getElementById(j).contentWindow.document.body.innerHTML=q;if(xed_msie){links=document.getElementById(j).contentWindow.document.getElementsByTagName("a");winhref=window.location.href;if(winhref.indexOf("#")!=-1){arr=winhref.split("#");winhref=arr.shift()}for(i=0;i<links.length;i++){if(links[i].href.indexOf(winhref+"#")!=-1){arr=links[i].href.split("#");links[i].href="#"+arr.pop()}}}document.getElementById(j).contentWindow.document.designMode="on";if(!xed_msie){try{document.getElementById(j).contentWindow.document.execCommand("styleWithCSS",false,false)}catch(m){document.getElementById(j).contentWindow.document.execCommand("useCSS",false,"")}}document.getElementById(j).contentWindow.focus()});p.type="textarea";p.cols=80;p.rows=30;p.width=700;p.height=550;p.open("Editing Source",html)}return false;if(l=="source"){document.getElementById("xed-"+j+"-edit-bar").style.visibility="hidden";document.getElementById("xed-"+j+"-path").style.visibility="hidden";document.getElementById("xed-"+j+"-source").style.display="inline";document.getElementById("xed-"+j+"-source").style.visibility="visible";document.getElementById("xed-"+j+"-source-bar").style.visibility="visible";if(!xed_source_positioned){s=document.getElementById("xed-"+j+"-source");b=document.getElementById("xed-"+j+"-source-bar");if(xed_scroller){s.style.left=s.offsetLeft-451}else{s.style.left=s.offsetLeft-662}s.style.marginTop=0;b.style.top=b.offsetTop-15;xed_source_positioned=true}document.getElementById("xed-"+j+"-source").value=html;document.getElementById("xed-"+j+"-mode-source-button").style.backgroundColor="#eee";document.getElementById("xed-"+j+"-mode-source-button").childNodes[0].style.color="09f";document.getElementById("xed-"+j+"-mode-source-button").childNodes[0].style.fontWeight="bold";document.getElementById("xed-"+j+"-mode-edit-button").style.backgroundColor="#eee";document.getElementById("xed-"+j+"-mode-edit-button").childNodes[0].style.color="d60";document.getElementById("xed-"+j+"-source").focus();xed_edit_state=l}else{if(l=="edit"){document.getElementById("xed-"+j+"-source").style.display="none";document.getElementById("xed-"+j+"-source").style.visibility="hidden";document.getElementById("xed-"+j+"-source-bar").style.visibility="hidden";document.getElementById("xed-"+j+"-mode-source-button").style.backgroundColor="#eee";document.getElementById("xed-"+j+"-mode-source-button").childNodes[0].style.color="d60";document.getElementById("xed-"+j+"-mode-edit-button").style.backgroundColor="#eee";document.getElementById("xed-"+j+"-mode-edit-button").childNodes[0].style.color="09f";document.getElementById("xed-"+j+"-mode-edit-button").childNodes[0].style.fontWeight="bold";document.getElementById("xed-"+j+"-edit-bar").style.visibility="visible";document.getElementById("xed-"+j+"-path").style.visibility="visible";document.getElementById(j).contentWindow.document.body.innerHTML=html;if(xed_msie){links=document.getElementById(j).contentWindow.document.getElementsByTagName("a");winhref=window.location.href;if(winhref.indexOf("#")!=-1){arr=winhref.split("#");winhref=arr.shift()}for(i=0;i<links.length;i++){if(links[i].href.indexOf(winhref+"#")!=-1){arr=links[i].href.split("#");links[i].href="#"+arr.pop()}}}document.getElementById(j).contentWindow.document.designMode="on";if(!xed_msie){try{document.getElementById(j).contentWindow.document.execCommand("styleWithCSS",false,false)}catch(g){document.getElementById(j).contentWindow.document.execCommand("useCSS",false,"")}}document.getElementById(j).contentWindow.focus();xed_edit_state=l}else{if(l=="off"){document.getElementById("xed-"+j+"-edit-bar").style.visibility="hidden";document.getElementById("xed-"+j+"-formatblock").style.visibility="hidden";document.getElementById("xed-"+j+"-templatelist").style.visibility="hidden";document.getElementById("xed-"+j+"-path").style.visibility="hidden";document.getElementById("xed-"+j+"-source").style.display="none";document.getElementById("xed-"+j+"-source").style.visibility="hidden";document.getElementById("xed-"+j+"-source-bar").style.visibility="hidden"}else{if(l=="on"){document.getElementById(j).contentWindow.document.designMode="on";if(!xed_msie){try{document.getElementById(j).contentWindow.document.execCommand("styleWithCSS",false,false)}catch(g){document.getElementById(j).contentWindow.document.execCommand("useCSS",false,"")}}document.getElementById("xed-"+j+"-edit-bar").style.visibility="visible";document.getElementById("xed-"+j+"-formatblock").style.visibility="visible";document.getElementById("xed-"+j+"-templatelist").style.visibility="visible";document.getElementById("xed-"+j+"-path").style.visibility="visible";document.getElementById("xed-"+j+"-source").style.display="none";document.getElementById("xed-"+j+"-source").style.visibility="hidden";document.getElementById("xed-"+j+"-source-bar").style.visibility="hidden";document.getElementById("xed-"+j+"-mode-source-button").style.backgroundColor="#eee";document.getElementById("xed-"+j+"-mode-source-button").childNodes[0].style.color="d60";document.getElementById("xed-"+j+"-mode-edit-button").style.backgroundColor="#eee";document.getElementById("xed-"+j+"-mode-edit-button").childNodes[0].style.color="09f";document.getElementById("xed-"+j+"-mode-edit-button").childNodes[0].style.fontWeight="bold"}}}}xed_edit_mode=l;return false}function xed_toggle_context_menu(j,g){if(xed_context_menu){document.getElementById("xed-context-menu").style.display="none";document.getElementById("xed-context-menu-shade").style.display="none";xed_context_menu=false;return false}else{e=document.getElementById(j);menu=document.getElementById("xed-context-menu");shade=document.getElementById("xed-context-menu-shade");h=0;i=28;p=xed_get_parent(j);o="<ul>";o+="<li><a href=\"javascript: void xed_toggle_context_menu ('"+j+"', xed_select_node_contents ('"+j+"', xed_get_parent ('"+j+'\')))"><img src="'+xed_web_path+'/inc/app/xed/pix/spacer.gif" alt="" border="0" /> <strong>Element: <span style="text-transform: lowercase">'+p.tagName+"</span></strong></a></li>";h+=i;if(p.tagName.toLowerCase()!="body"){o+="<li><a href=\"javascript: void xed_toggle_context_menu ('"+j+"', xed_edit_properties ('"+j+"', xed_get_parent ('"+j+'\')))"><img src="'+xed_web_path+'/inc/app/xed/pix/icons/edit-properties-24x24.gif" alt="Edit Properties" title="Edit Properties" border="0" /> Edit Properties</a></li>';h+=i;o+="<li><a href=\"javascript: void xed_toggle_context_menu ('"+j+"', xed_remove_element ('"+j+"', xed_get_parent ('"+j+'\')))"><img src="'+xed_web_path+'/inc/app/xed/pix/icons/remove-element-24x24.gif" alt="Remove Element" title="Remove Element" border="0" /> Remove Element</a></li>';h+=i;if(p.tagName.toLowerCase()!="a"){o+='<li class="xcm-sep"><a href="javascript: void xed_toggle_context_menu (\''+j+"', xed_link ('"+j+'\'))"><img src="'+xed_web_path+'/inc/app/xed/pix/icons/link.gif" alt="Make Link" title="Make Link" border="0" /> Make Link</a></li>';h+=i;o+="<li><a href=\"javascript: void xed_toggle_context_menu ('"+j+"', xed_align_left ('"+j+'\'))"><img src="'+xed_web_path+'/inc/app/xed/pix/icons/align-left.gif" alt="Align Left" title="Align Left" border="0" /> Align Left</a></li>';h+=i}else{o+='<li class="xcm-sep"><a href="javascript: void xed_toggle_context_menu (\''+j+"', xed_align_left ('"+j+'\'))"><img src="'+xed_web_path+'/inc/app/xed/pix/icons/align-left.gif" alt="Align Left" title="Align Left" border="0" /> Align Left</a></li>';h+=i}o+="<li><a href=\"javascript: void xed_toggle_context_menu ('"+j+"', xed_align_center ('"+j+'\'))"><img src="'+xed_web_path+'/inc/app/xed/pix/icons/align-center.gif" alt="Align Center" title="Align Center" border="0" /> Align Center</a></li>';h+=i;o+="<li><a href=\"javascript: void xed_toggle_context_menu ('"+j+"', xed_align_right ('"+j+'\'))"><img src="'+xed_web_path+'/inc/app/xed/pix/icons/align-right.gif" alt="Align Right" title="Align Right" border="0" /> Align Right</a></li>';h+=i}p=xed_get_element_pos(e);if(xed_msie){if(document.compatMode=="CSS1Compat"){menu.style.left=g.clientX+p.x;menu.style.top=g.clientY+p.y}else{menu.style.left=g.clientX+p.x;menu.style.top=g.clientY+p.y}}else{menu.style.left=g.pageX+p.x-e.contentWindow.scrollX;menu.style.top=g.pageY+p.y-e.contentWindow.scrollY}o+="</ul>";menu.style.height=h;menu.style.display="block";shade.style.left=parseInt(menu.style.left)+3;shade.style.top=parseInt(menu.style.top)+3;shade.style.height=menu.style.height;shade.style.display="block";xed_context_menu=true;menu.innerHTML=o;return false}}function xed_needs_closing_tag(g){var j=" head script style p div span tr td tbody table em strong font a title xt:box xt:form box form ";return(j.indexOf(" "+g.tagName.toLowerCase()+" ")!=-1)}function xed_is_block_tag(j){var g=" p h1 h2 h3 h4 h5 h6 table tr script style head body div td tbody xt:box xt:form box form hr blockquote pre ul ol li ";return(g.indexOf(" "+j+" ")!=-1)}function xed_get_element_pos(l){var j={x:l.offsetLeft,y:l.offsetTop};if(l.offsetParent){if(l.offsetParent==document.getElementById("cms-edit")){return j}var g=xed_get_element_pos(l.offsetParent);j.x+=g.x;j.y+=g.y}return j}function xed_get_next_element(g){name=g.nodeName.toLowerCase();while((g=g.nextSibling)!=null){if(g.nodeName.toLowerCase()==name){return g}}return null}function xed_in_array(g,j){for(i=0;i<g.length;i++){if(g[i].length>0&&xed_in_array(g[i],j)){return true}if(g[i]==j){return true}}return false}function xed_get_selection(j){try{return document.getElementById(j).contentWindow.getSelection()}catch(g){return document.getElementById(j).contentWindow.document.selection}}function xed_select_node_contents(l,j){var g;if(!xed_msie){var m=xed_get_selection(l);g=document.getElementById(l).contentWindow.document.createRange();g.selectNodeContents(j);m.removeAllRanges();m.addRange(g);if(xed_safari){xed_selected_node=j}}else{g=document.getElementById(l).contentWindow.document.body.createTextRange();g.moveToElementText(j);g.select()}tag=j.tagName.toLowerCase();document.getElementById(l).contentWindow.focus();xed_update_path(l,tag)}function xed_select_node(m,l){var g;try{var q=xed_get_selection(m);g=document.getElementById(m).contentWindow.document.createRange();g.selectNode(l);q.removeAllRanges();q.addRange(g);if(xed_safari){xed_selected_node=l}}catch(j){g=document.getElementById(m).contentWindow.document.body.createTextRange();g.moveToElementText(l);g.select()}}function xed_create_range(l,m){try{document.getElementById(l).contentWindow.focus();if(typeof m!="undefined"){return m.getRangeAt(0)}else{return document.getElementById(l).contentWindow.document.createRange()}}catch(g){if(typeof m!="undefined"){try{return m.createRange()}catch(j){return false}}else{return document.getElementById(l).contentWindow.document.body.createTextRange()}}}function xed_error(g){if(!xed_error_window||xed_error_window.closed){xed_error_window=window.open("","test","top=10,left=10,height=700,width=200")}xed_error_window.document.write(g+"<br />")}function xed_get_parent(l){if(arguments.length>1){xed_selected=arguments[1]}var m=xed_get_selection(l);var j=xed_create_range(l,m);if(!j){return}if(!xed_msie){if(xed_selected!="a"&&j.endContainer&&j.startContainer==j.endContainer&&j.startContainer.nodeType==1){var g=null;if(j.startContainer.tagName.toLowerCase()=="img"){g=j.startContainer}else{if(j.endOffset-j.startOffset==1&&j.startContainer.childNodes[j.startOffset].tagName.toLowerCase()=="img"){g=j.startContainer.childNodes[j.startOffset]}}if(g!=null){return g}}if(xed_safari){if(xed_selected=="tr"&&j.startContainer){if(j.startContainer.tagName.toLowerCase()=="td"){var q=j.startContainer.parentNode}else{var q=j.startContainer}if(q.tagName.toLowerCase()=="tr"){return q}}if(xed_selected=="tbody"&&j.startContainer){var q=j.startContainer;while(q.tagName.toLowerCase()!=xed_selected){if(!q.parentNode){q=false;break}q=q.parentNode}if(q){return q}}if(xed_selected=="table"&&j.startContainer&&j.endContainer){if(xed_selected_node.tagName.toLowerCase()=="table"){return xed_selected_node}}if(xed_selected_node&&xed_selected_node.tagName.toLowerCase()=="img"){return xed_selected_node}}var q=j.commonAncestorContainer;while(q.nodeType==3){q=q.parentNode}return q}else{if(xed_selected=="a"){if(j.parentElement&&j.parentElement().tagName.toLowerCase()=="img"){g=j.parentElement();return g.parentNode}return j.parentElement?j.parentElement():document.getElementById(l).contentWindow.document.body}if(!j){return document.getElementById(l).contentWindow.document.body}if(j.item){return j.item(0)}return j.parentElement?j.parentElement():document.getElementById(l).contentWindow.document.body}}function xed_get_ancestors(j){if(arguments.length>1){xed_selected=arguments[1]}if(xed_selected){var l=xed_get_parent(j,xed_selected)}else{var l=xed_get_parent(j)}var g=new Array();while(l&&(l.tagName.toLowerCase()!="body")){if(l.nodeType!=1){continue}g.push(l);l=l.parentNode}g.push(document.getElementById(j).contentWindow.document.body);return g}function xed_get_ifname(g){if(xed_safari){xed_selected_node=g}g=(g.ownerDocument)?g.ownerDocument:g;return g.ifname}function xed_event(g){g=(g)?g:((event)?event:null);if(g){var j=(g.target)?g.target:((g.srcElement)?g.srcElement:null);if(j){j=(j.nodeType==1||j.nodeType==9)?j:j.parentNode;ifname=xed_get_ifname(j);if(g.type=="mousemove"){if(xed_msie){xed_mouse_x=g.clientX-document.body.scrollLeft;xed_mouse_y=g.clientY-document.body.scrollTop}else{xed_mouse_x=g.pageX;xed_mouse_y=g.pageY}}else{if(g.type=="mousedown"&&(g.button==0||g.button==1)){xed_update_path(ifname);if(xed_context_menu){xed_toggle_context_menu(ifname,g)}}else{if(g.type=="mousedown"&&(g.button==2||g.button==3)){xed_update_path(ifname);if(xed_msie){g.cancelBubble=true;g.returnValue=false}else{g.cancelBubble=true;g.returnValue=false;g.preventDefault();g.stopPropagation()}return false}else{if(g.type=="contextmenu"){xed_update_path(ifname);xed_toggle_context_menu(ifname,g);if(xed_msie){g.cancelBubble=true;g.returnValue=false}else{g.cancelBubble=true;g.returnValue=false;g.preventDefault();g.stopPropagation()}return false}else{xed_update_path(ifname);k=g.keyCode;if(!xed_msie&&k==0){k=g.charCode}if(g.type=="keypress"){xed_debug("key: "+k);if(k==10||k==13||k==33||k==44||k==46||k==59||k==63){xed_historian(ifname)}else{if(xed_prev_char>31&&(xed_prev_char!=8&&xed_prev_char!=46)&&(k==8||k==46)){xed_historian(ifname)}else{if((xed_prev_char==8||xed_prev_char==46)&&(k!=8&&k!=46)){xed_historian(ifname)}}}xed_prev_char=k}if(g.type=="keydown"&&(k==122||k==90)&&g.ctrlKey){if(g.shiftKey){xed_redo(ifname)}else{xed_undo(ifname)}if(xed_msie){g.cancelBubble=true;g.returnValue=false}else{g.cancelBubble=true;g.returnValue=false;g.preventDefault();g.stopPropagation()}return false}}}}}}}}function xed_add_event(j,g,l){if(xed_msie){j.attachEvent("on"+g,l)}else{j.addEventListener(g,l,true)}}function xed_add_events(j,g,l){for(i=0;i<g.length;i++){xed_add_event(j,g[i],l)}}function xed_update_formatblock(j,g){s=document.getElementById("xed-"+j+"-formatblock");switch(g){case"p":v="<p>";break;case"h1":v="<h1>";break;case"h2":v="<h2>";break;case"h3":v="<h3>";break;case"h4":v="<h4>";break;case"h5":v="<h5>";break;case"h6":v="<h6>";break;case"address":v="<address>";break;case"pre":v="<pre>";break;default:return false}for(i=0;i<s.options.length;i++){if(s.options[i].value==v){s.selectedIndex=i;xed_updated_formatblock=true;break}}}function xed_update_path(l){if(arguments.length>1){xed_selected=arguments[1]}else{xed_selected=false}doc=document.getElementById(l).contentWindow.document;path_div=document.getElementById("xed-"+l+"-path");path_div.innerHTML="";path_div.style.paddingBottom="0px";path_div.style.marginBottom="0px";path=document.createElement("span");try{path.style.cssFloat="left"}catch(u){path.style.styleFloat="right"}path.style.paddingRight="7px";path.style.paddingBottom="0px";path.style.marginBottom="0px";path.innerHTML="Path: ";if(xed_selected){var C=xed_get_ancestors(l,xed_selected)}else{var C=xed_get_ancestors(l)}var g=null;var q=false;var B=false;for(var m=C.length;--m>=0;){g=C[m];if(!g){continue}if(g.tagName.toLowerCase()=="table"){document.getElementById("xed-"+l+"-table-bar").style.display="block";B=true}if(!q){xed_update_formatblock(l,g.tagName.toLowerCase())}var A=document.createElement("a");A.href="#";A.el=g;A.editor=l;A.onclick=function(){this.blur();xed_select_node_contents(this.editor,this.el);return false};var j=g.tagName.toLowerCase();A.title=g.style.cssText;if(g.id){j+="#"+g.id}if(g.className){j+="."+g.className}A.appendChild(document.createTextNode(j));path.appendChild(A);if(m!=0){path.appendChild(document.createTextNode(" "+String.fromCharCode(187)+" "))}}if(!B){document.getElementById("xed-"+l+"-table-bar").style.display="none"}if(j!="body"){edit=document.createElement("a");edit.href="#";edit.el=g;edit.editor=l;edit.onclick=function(){xed_edit_properties(this.editor,this.el);return false};img=document.createElement("img");img.src=xed_path+"/pix/icons/edit-properties.gif";img.alt="Edit Properties";img.title="Edit Properties";img.border="0";edit.appendChild(img);dele=document.createElement("a");dele.href="#";dele.el=g;dele.editor=l;dele.onclick=function(){this.blur();xed_remove_element(this.editor,this.el);document.getElementById(this.editor).contentWindow.focus();return false};img=document.createElement("img");img.src=xed_path+"/pix/icons/remove-element.gif";img.alt="Remove Element";img.title="Remove Element";img.border="0";dele.appendChild(img);path_div.appendChild(path);path_div.appendChild(document.createTextNode(" "));path_div.appendChild(edit);path_div.appendChild(document.createTextNode(" "));path_div.appendChild(dele)}else{path_div.appendChild(path)}}function xed_outer_html(j){outer=j.outerHTML;if(typeof(outer)!="undefined"){return outer}outer="<"+j.tagName;if(j.attributes){for(var g in j.attributes){a=j.attributes[g];if(a.value){outer+=" "+a.name+'="'+a.value+'"'}}}outer+=">";outer+=j.innerHTML;outer+="</"+j.tagName+">";return outer}function xed_remove_element(l,j){xed_historian(l);new_html="";pn=j.parentNode;if(!pn){return false}len=pn.childNodes.length;if(xed_msie){for(var g in j.parentNode.childNodes){if(g>=len){break}n=j.parentNode.childNodes[g];if(n==j){if(j.tagName.toLowerCase()!="xt:box"&&j.tagName.toLowerCase()!="xt:form"){new_html+=j.innerHTML}}else{if(typeof(n)=="function"){}else{if(typeof(n)=="number"){}else{if(typeof(n)=="object"){if(n.outerHTML!==undefined){new_html+=n.outerHTML}else{new_html+=n.data}}}}}}}else{if(xed_safari){for(var g=0;g<j.parentNode.childNodes.length;g++){if(g>=len){break}n=j.parentNode.childNodes[g];if(n==j){if(j.tagName.toLowerCase()!="xt:box"&&j.tagName.toLowerCase()!="xt:form"){new_html+=j.innerHTML}}else{if(typeof(n)=="function"){}else{if(typeof(n)=="number"){}else{if(typeof(n)=="object"){if(n instanceof HTMLElement){new_html+=xed_outer_html(n)}else{new_html+=n.data}}}}}}}else{for(var g in j.parentNode.childNodes){if(g>=len){break}n=j.parentNode.childNodes[g];if(n==j){if(j.tagName.toLowerCase()!="xt:box"&&j.tagName.toLowerCase()!="xt:form"){new_html+=j.innerHTML}}else{if(typeof(n)=="function"){}else{if(typeof(n)=="number"){}else{if(typeof(n)=="object"){if(n instanceof HTMLElement){new_html+=xed_outer_html(n)}else{new_html+=n.data}}}}}}}}j.parentNode.innerHTML=new_html}function xed_strip_base_url(g){if(g.indexOf(xed_site_domain+xed_prefix+"/index/")!=-1){arr=g.split(xed_site_domain+xed_prefix+"/index/");return xed_prefix+"/index/"+arr.pop()}if(g.indexOf(xed_site_domain+xed_prefix+"/pix/")!=-1){arr=g.split(xed_site_domain+xed_prefix+"/pix/");return xed_prefix+"/pix/"+arr.pop()}if(xed_msie){if(g.indexOf(xed_site_domain)!=-1){arr=g.split(xed_site_domain);g=arr.pop()}if(g.indexOf("#")===0){return g}if(g.indexOf("http://")===0){return g}else{if(g.indexOf("www.")===0){return"http://"+g}}return g}var l=xed_site_url;l=l.replace(/[^\/]+$/,"");var j=new RegExp(l);g=g.replace(j,"");l=l.replace(/^(https?:\/\/[^\/]+)(.*)$/,"$1");j=new RegExp(l);return g.replace(j,"")}function xed_get_html(B,j,u){var q="";switch(B.nodeType){case 1:case 11:var A;var m;var E=(B.nodeType==1)?B.tagName.toLowerCase():"";if(E=="box"||E=="form"){E="xt:"+E}if(xed_msie&&E=="head"){if(j){q+="<head>"}var G=RegExp.multiline;RegExp.multiline=true;var l=B.innerHTML.replace(xed_rx_tag_name,function(J,I,H){return I+H.toLowerCase()});RegExp.multiline=G;q+=l;if(j){q+="</head>"}break}else{if(j){A=(!(B.hasChildNodes()||xed_needs_closing_tag(B)));q="<"+E;var F=B.attributes;for(m=0;m<F.length;++m){var C=F.item(m);if(!C.specified){continue}var g=C.nodeName.toLowerCase();if(/_moz|contenteditable|_msh/.test(g)){continue}var D;if(g!="style"){if(typeof B[C.nodeName]!="undefined"&&g!="href"&&g!="src"){D=B.getAttributeNode(C.nodeName).value}else{D=C.nodeValue;if(g=="href"||g=="src"){D=xed_strip_base_url(D)}}}else{D=B.style.cssText}if(/(_moz|^$)/.test(D)){continue}q+=" "+g+'="'+D+'"'}q+=A?" />":">";if(E=="br"){q+="\n"}}}for(m=B.firstChild;m;m=m.nextSibling){q+=xed_get_html(m,true,u)}if(j&&!A){q+="</"+E+">";if(xed_is_block_tag(E)){q+="\n"}}break;case 3:if(!B.previousSibling&&!B.nextSibling&&B.data.match(/^\s*$/i)){q=" "}else{q=xed_html_entities(B.data)}break;case 8:q="<!--"+B.data+"-->";break}q=q.replace(/\n\n+/g,"\n\n");return q}function xed_get_source(g){if(xed_edit_state=="edit"){return xed_get_html(document.getElementById(g).contentWindow.document.body,false,false)}return document.getElementById("xed-"+g+"-source").value}function xed_get_anchors(g){html=xed_get_source(g);anchor_list=[];re=/<(h[1-6]).*?>(.+)<\/h[1-6]>/gim;i=0;while(matches=re.exec(html)){href=MD5(matches[1]+matches[2]);anchor_list.push({name:href,value:matches[2]});i++}return anchor_list}function xed_html_entities(g){re=/&/g;g=g.replace(re,"&");re=/</g;g=g.replace(re,"<");re=/>/g;g=g.replace(re,">");return g}function xed_html_entities_decode(g){orig=g;re=/"/g;g=g.replace(re,'"');re=/</g;g=g.replace(re,"<");re=/>/g;g=g.replace(re,">");re=/&/g;g=g.replace(re,"&");return g}function xed_url_encode(g){return escape(g)}function xed_parse_uri(g){el=new Object;tmp=g.split("?");el.box=tmp[0];el.args=new Array();if(tmp.length>1){tmp=tmp[1].split("&");for(i=0;i<tmp.length;i++){arg=tmp[i].split("=");el.args.push(xed_attribute(arg[0],arg[1]))}}return el}function xed_insert_html_at_selection(g,j){document.getElementById(g).contentWindow.focus();xed_insert_element(g,"span",[xed_attribute("id","xed-template")]);d=document.getElementById(g).contentWindow.document;l=d.getElementById("xed-template");try{l.innerHTML=j;document.getElementById(g).contentWindow.focus();if(!xed_safari){xed_remove_element(g,l)}}catch(l){}document.getElementById(g).contentWindow.focus()}function xed_insert_node_at_selection(A,q){try{var j=A.getSelection();var u=j.getRangeAt(0);j.removeAllRanges();u.deleteContents();var g=u.startContainer;var F=u.startOffset;u=A.document.createRange();if(g.nodeType==3&&q.nodeType==3){g.insertData(F,q.nodeValue);u.setEnd(g,F+q.length);u.setStart(g,F+q.length)}else{var l;if(g.nodeType==3){var m=g;g=m.parentNode;var G=m.nodeValue;var C=G.substr(0,F);var B=G.substr(F);var E=A.document.createTextNode(C);var l=A.document.createTextNode(B);g.insertBefore(l,m);g.insertBefore(q,l);g.insertBefore(E,q);g.removeChild(m)}else{l=g.childNodes[F];if(typeof(q)=="string"){q=A.document.createTextNode(q)}g.insertBefore(q,l)}u.setEnd(l,0);u.setStart(l,0)}j.addRange(u)}catch(D){try{var u=A.document.selection.createRange();u.collapse(true);u.pasteHTML(q)}catch(D){}}}function xed_debug(g){if(!xed_debug_view){return false}if(xed_msie){document.getElementById("xed-debug-tr").style.display="block"}else{document.getElementById("xed-debug-tr").style.display="table-row"}html=document.getElementById("xed-debug-msg").innerHTML;html=html+"<br />"+g;document.getElementById("xed-debug-msg").innerHTML=html;document.getElementById("xed-debug-msg").scrollTop=document.getElementById("xed-debug-msg").scrollHeight};