var pb_contentManager=Class.create({});var pb_design_Rulers=Class.create({initialize:function(){},setPosition:function(b,a){},showRules:function(){},hideRules:function(){}});var pb_design_DesignWindow=Class.create({getWhiteBackground:function(){var a=$("designerWindow_whiteBackground");if(!a){this.createWhiteBackground();return $("designerWindow_whiteBackground")}return a},createWhiteBackground:function(){var a=document.createElement("div");a.id="designerWindow_whiteBackground";a.style.backgroundImage="url("+pb.core.system.getLibraryPath()+"plasticbriqFramework/interfaceFiles/design/white_transparent_bkg.png)";a.style.position="fixed";a.style.top="0px";a.style.left="0px";a.style.right="0px";a.style.bottom="0px";a.style.zIndex="99";document.body.appendChild(a)},showWhiteBackground:function(){var a=$("designerWindow_whiteBackground");if(!a){this.createWhiteBackground()}else{a.show()}},hideWhiteBackground:function(){var a=$("designerWindow_whiteBackground");if(a){a.hide()}}});var pb_design=Class.create({rulers:new pb_design_Rulers(),designWindow:new pb_design_DesignWindow()});var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var a;var b;var c;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=b.GetVariable("$version")}catch(c){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";b.AllowScriptAccess="always";a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");a="WIN 2,0,0,11"}catch(c){a=-1}}return a}function GetSwfVer(){var g=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var f=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+f].description;var e=a.split(" ");var c=e[2].split(".");var h=c[0];var b=c[1];var d=e[3];if(d==""){d=e[4]}if(d[0]=="d"){d=d.substring(1)}else{if(d[0]=="r"){d=d.substring(1);if(d.indexOf("d")>0){d=d.substring(0,d.indexOf("d"))}}}var g=h+"."+b+"."+d}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){g=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){g=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){g=2}else{if(isIE&&isWin&&!isOpera){g=ControlVersion()}}}}}return g}function DetectFlashVer(f,d,c){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var e=versionArray[0];var a=versionArray[1];var b=versionArray[2];if(e>parseFloat(f)){return true}else{if(e==parseFloat(f)){if(a>parseFloat(d)){return true}else{if(a==parseFloat(d)){if(b>=parseFloat(c)){return true}}}}}return false}}}function AC_AddExtension(b,a){if(b.indexOf("?")!=-1){return b.replace(/\?/,a+"?")}else{return b+a}}function AC_Generateobj(e,d,a){var c="";if(isIE&&isWin&&!isOpera){c+="<object ";for(var b in e){c+=b+'="'+e[b]+'" '}for(var b in d){c+='><param name="'+b+'" value="'+d[b]+'" /> '}c+="></object>"}else{c+="<embed ";for(var b in a){c+=b+'="'+a[b]+'" '}c+="> </embed>"}document.write(c)}function AC_FL_RunContent(){var a=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_GetArgs(b,e,g,d,h){var a=new Object();a.embedAttrs=new Object();a.params=new Object();a.objAttrs=new Object();for(var c=0;c<b.length;c=c+2){var f=b[c].toLowerCase();switch(f){case"classid":break;case"pluginspage":a.embedAttrs[b[c]]=b[c+1];break;case"src":case"movie":b[c+1]=AC_AddExtension(b[c+1],e);a.embedAttrs.src=b[c+1];a.params[g]=b[c+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":a.objAttrs[b[c]]=b[c+1];break;case"id":case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":a.embedAttrs[b[c]]=a.objAttrs[b[c]]=b[c+1];break;default:a.embedAttrs[b[c]]=a.params[b[c]]=b[c+1]}}a.objAttrs.classid=d;if(h){a.embedAttrs.type=h}return a}var pb_flash=Class.create({requiredMajorVersion:6,requiredMinorVersion:0,requiredRevision:0,isInstalled:function(){return DetectFlashVer(this.requiredMajorVersion,this.requiredMinorVersion,this.requiredRevision)}});var Installer=Class.create({actionFile:"",installCore:function(){var c=this.getActionFile();var b={command:"installCore"};var a=this.getActionFile();system.getMessageManager().showMessage("Instalando núcleo del sistema...",{color:"blue"});system.getActionManager().executeAndReloadContent(c,b,a)},updateSystem:function(){var a=$("updateContainer");var b=system.getLibraryPath()+"plasticbriqFramework/install/_update_database.php";a.innerHTML="";$("startUpdateButtonContainer").innerHTML="";new Ajax.Request(b,{method:"post",parameters:{command:"startSystemUpdate",style:system.getCurrentStyle()},onSuccess:function(c){a.innerHTML=c.responseText;system.evalAllScripts("updateContainer")}})},updateModule:function(c,b){var a=system.getLibraryPath()+"plasticbriqFramework/install/_update_database.php";new Ajax.Request(a,{method:"post",parameters:{command:"updateModule",style:system.getCurrentStyle(),moduleName:c},onSuccess:function(d){if(d.responseText=="OK"){$(b).innerHTML="Módulo actualizado con éxito";$(b).setStyle({color:"green"})}else{$(b).innerHTML=d.responseText;$(b).setStyle({color:"red"})}}})},fixOpacity:function(){var a=system.getLibraryPath()+"plasticbriqFramework/install/_db_fixes.php";new Ajax.Request(a,{method:"post",parameters:{command:"fixOpacity",style:system.getCurrentStyle()},onSuccess:function(b){if(b.responseText=="OK"){$("updateContainer").innerHTML="Reparación aplicada con éxito";$("updateContainer").setStyle({color:"green"})}else{$("updateContainer").innerHTML=b.responseText;$("updateContainer").setStyle({color:"red"})}}})},switchToDifferences:function(){var a=system.getLibraryPath()+"plasticbriqFramework/install/_db_fixes.php";new Ajax.Request(a,{method:"post",parameters:{command:"switchToDifferences",style:system.getCurrentStyle()},onSuccess:function(b){if(b.responseText=="OK"){$("updateContainer").innerHTML="Reparación aplicada con éxito";$("updateContainer").setStyle({color:"green"})}else{$("updateContainer").innerHTML=b.responseText;$("updateContainer").setStyle({color:"red"})}}})},switchBack:function(){var a=system.getLibraryPath()+"plasticbriqFramework/install/_db_fixes.php";new Ajax.Request(a,{method:"post",parameters:{command:"switchBack",style:system.getCurrentStyle()},onSuccess:function(b){if(b.responseText=="OK"){$("updateContainer").innerHTML="Reparación aplicada con éxito";$("updateContainer").setStyle({color:"green"})}else{$("updateContainer").innerHTML=b.responseText;$("updateContainer").setStyle({color:"red"})}}})},testDatabaseConfig:function(){var a=$("installDatabase").serialize(true);a.command="testDatabase";a.style=system.getCurrentStyle();new Ajax.Request(system.getLibraryPath()+"plasticbriqFramework/install/_database.php",{method:"post",parameters:a,onSuccess:function(b){if(b.responseText=="OK"){system.getMessageManager().showMessage("La configuración de la base de datos parece funcionar bien.",{color:"green"})}else{system.getMessageManager().showMessage(b.responseText,{color:"red"})}}})},installModule:function(b,a,c){$(a).innerHTML="Instalando módulo "+b+"...";$(a).setStyle({color:"blue"});$(b+"_action").innerHTML="-";$(b+"_action").setAttribute("onclick","");$(b+"_action").setStyle({cursor:"default"});new Ajax.Request(this.getActionFile(),{method:"post",parameters:{command:"installModule",style:system.getCurrentStyle(),moduleName:b},onSuccess:function(d){$(c).innerHTML=d.responseText;installer.reloadExtensionList()}})},uninstallModule:function(b,a,c){$(a).innerHTML="ATENCIÓN: Se perderán todos los datos del módulo ¿está seguro?";$(a).setStyle({color:"orange"});$(b+"_action").innerHTML="Confirmar";$(b+"_action").setAttribute("onclick","installer.uninstallModuleConfirmation('"+b+"','"+a+"','"+c+"')")},uninstallModuleConfirmation:function(b,a,c){$(a).innerHTML="Desinstalando módulo "+b+"...";$(a).setStyle({color:"blue"});$(b+"_action").innerHTML="-";$(b+"_action").setAttribute("onclick","");$(b+"_action").setStyle({cursor:"default"});new Ajax.Request(this.getActionFile(),{method:"post",parameters:{command:"uninstallModule",style:system.getCurrentStyle(),moduleName:b},onSuccess:function(d){$(c).innerHTML=d.responseText;installer.reloadExtensionList()}})},installExtension:function(b,d,a,c){$(a).innerHTML="Instalando extensión "+d+"...";$(a).setStyle({color:"blue"});$(b+"_"+d+"_action").innerHTML="-";$(b+"_"+d+"_action").setAttribute("onclick","");$(b+"_"+d+"_action").setStyle({cursor:"default"});new Ajax.Request(this.getActionFile(),{method:"post",parameters:{command:"installExtension",style:system.getCurrentStyle(),moduleName:b,extensionName:d},onSuccess:function(e){$(c).innerHTML=e.responseText}})},uninstallExtension:function(b,d,a,c){$(a).innerHTML="Desinstalando extensión "+d+"...";$(a).setStyle({color:"blue"});$(b+"_"+d+"_action").innerHTML="-";$(b+"_"+d+"_action").setAttribute("onclick","");$(b+"_"+d+"_action").setStyle({cursor:"default"});new Ajax.Request(this.getActionFile(),{method:"post",parameters:{command:"uninstallExtension",style:system.getCurrentStyle(),moduleName:b,extensionName:d},onSuccess:function(e){$(c).innerHTML=e.responseText}})},reloadExtensionList:function(){var a=$("installerExtensionContainer");new Ajax.Request(this.getActionFile(),{method:"post",parameters:{command:"reloadExtensionList",style:system.getCurrentStyle()},onSuccess:function(b){a.innerHTML=b.responseText}})},getActionFile:function(){if(this.actionFile==""){this.actionFile=system.getLibraryPath()+"plasticbriqFramework/install/_module_install.php"}return this.actionFile}});var installer=new Installer();pb_systemForms_SystemSettings=Class.create({idPrefix:"systemSettingsForm_",updateUserAccountForm:function(){var a=$("userAccountCreationContainer");var b=$(this.idPrefix+"accountCreation");if(a&&b){if(b.value=="true"){a.show()}else{a.hide()}}}});var pb_systemForms=Class.create({systemSettings:new pb_systemForms_SystemSettings()});pb_webGenerator=Class.create({});
