function hidecontent(){this.init()}hidecontent.prototype.init=function(){oEditorHandle_message.oSmfExec.hide="hideOptions",this.oModalWrapper=document.getElementById("hidecontent_modal_wrapper");var a=document.getElementById("hidecontent_submit_button");a.instanceRef=this,a.onclick=function(){return this.instanceRef.handleModalSubmitClick(),!1};var b=document.getElementById("hidecontent_close_button");for(b.instanceRef=this,b.onclick=function(){return this.instanceRef.handleModalCloseClick(),!1},this.oPlugins=document.getElementsByClassName("hidecontent_option_wrapper"),i=0;i<this.oPlugins.length;++i){var c=this.oPlugins[i],d=c.getElementsByTagName("input")[1];"input_check"==d.className&&(d.instanceRef=this,d.onclick=function(){this.instanceRef.handleOptionClick(this)})}this.oModalErrors=document.getElementById("modal_errors"),this.sErrorsMessagesTemplate1=document.getElementById("modal_error_required").innerHTML,this.sErrorsMessagesTemplate2=document.getElementById("modal_error_numeric").innerHTML,this.sErrorsMessagesTemplate3=document.getElementById("modal_error_plugin_required").innerHTML,this.resetHiddenPluginOptions(),smc_Editor.prototype.hideOptions=function(){var a=document.getElementById("hidecontent_modal_wrapper"),b=document.getElementById("hidecontent_modal_window");return a.className="overlay",b.style.marginTop=-b.offsetHeight/2+"px",b.style.marginLeft=-b.offsetWidth/2+"px",!0}},hidecontent.prototype.handleOptionClick=function(a){var b=a.parentNode.parentNode.getElementsByClassName("hidecontent_option_parameters")[0];null!=b&&(a.checked===!1?this.addClassModalField("hide",b):this.removeClassModalField("hide",b))},hidecontent.prototype.handleModalCloseClick=function(){this.oModalWrapper.className=""},hidecontent.prototype.handleModalSubmitClick=function(){this.resetErrors();var a={},b=!1,c=[];for(i=0;i<this.oPlugins.length;++i){var d=this.oPlugins[i],e=d.getElementsByTagName("input")[1];if("input_check"==e.className&&e.checked===!0){var f=d.getElementsByTagName("input")[0].value,g=d.getElementsByClassName("hidecontent_option_parameters")[0],h="";if(null!=g){var k=g.getElementsByTagName("legend")[0],l=g.getElementsByTagName("input"),m=g.getElementsByTagName("select");if(l.length>0||m.length>0){var n=null;if(m.length>0)n=m[0],h=n.value;else if(n=l[0],"checkbox"==n.type){for(j=0;j<l.length;j++)l[j].checked===!0&&(h=h+l[j].value+",");n=n.parentNode.parentNode.parentNode}else("text"==n.type||"hidden"==n.type)&&(h=n.value);h=h.replace(/,+$/,""),""==h?(c.push(this.sErrorsMessagesTemplate1.replace("%field",k.innerHTML)),this.addClassModalField("modal_error",n)):this.validateModalField(h,n)===!1&&(c.push(this.sErrorsMessagesTemplate2.replace("%field",k.innerHTML)),this.addClassModalField("modal_error",n))}l=g.getElementsByTagName("select"),l.length>0&&(h=l[0].value)}b=!0,a[f]=h}}if(b===!1&&c.push(this.sErrorsMessagesTemplate3),c.length>0){var o="";for(var p in c)o=o+c[p]+"<br />";document.getElementById("modal_error_list").innerHTML=o,this.removeClassModalField("hide",this.oModalErrors)}else{var q="";for(var r in a)q=""==a[r]?q+r+" ":q+r+"="+a[r]+" ";q=q.replace(/\s+$/,""),surroundText("[hide "+q+"]".replace(/\\n/g,"\n"),"[/hide]".replace(/\\n/g,"\n"),oEditorHandle_message.oTextHandle),this.handleModalCloseClick(),document.getElementById("modal_error_list").innerHtml="",this.resetErrors()}},hidecontent.prototype.validateModalField=function(a,b){return b.className.indexOf("numeric")>-1&&!(a-parseFloat(a)+1>=0)?!1:!0},hidecontent.prototype.addClassModalField=function(a,b){a=" "+a+" ",b.className.indexOf(a)>-1||(b.className=b.className+a)},hidecontent.prototype.removeClassModalField=function(a,b){a=" "+a+" ",b.className.indexOf(a)>-1&&(b.className=b.className.replace(a,""))},hidecontent.prototype.resetErrors=function(){var a=document.getElementsByClassName("modal_error");for(k=a.length-1;k>-1;k--)this.removeClassModalField("modal_error",a[k]);this.addClassModalField("hide",this.oModalErrors)},hidecontent.prototype.resetHiddenPluginOptions=function(){for(i=0;i<this.oPlugins.length;++i){var a=this.oPlugins[i],b=a.getElementsByTagName("input")[1],c=a.getElementsByClassName("hidecontent_option_parameters")[0];"input_check"==b.className&&(b.checked===!0?this.removeClassModalField("hide",c):this.addClassModalField("hide",c))}};