
function WBEDialogPopup()
{this.TabbableTags=new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");this.TabIndexes=new Array();this.url="";this.width=400;this.height=400;this.returnFunc=null;this.IsDialogShowed=false;this.gi=0;this.title="Component";this.zIndex=1000;this.HasToHideSelects=(parseInt(window.navigator.appVersion.charAt(0),10)<=6&&window.navigator.userAgent.indexOf("MSIE")>-1);this.oldHeight=0;this.maskLayer;this.titleLayer;this.containerLayer;this.iFrameLayer;this.shadowLayer;this.popupIsShown=false;this.hideSelects=false;this.isWizard=false;this.wbe_JsHelper=new WBEJsHelper();this.wbe_createDialogLayers=function()
{if(!document.getElementById('wbe_DialogMask')){document.write("<div id='wbe_edit_box_shadow'></div>");document.write("<div id='wbe_DialogMask' style=\"background-image: url('include/admin/img/maskBG.png')\">&nbsp;</div>");document.write("<div id='wbe_edit_box' style='display:none'>");document.write("<div id='wbe_edit_box_header'>");document.write("<div id='wbe_edit_box_title'></div>");document.write("<div id='buttons'>");document.write("<img src='include/admin/img/btn_min_edt_box.gif' id='wbe_bar_btn_min' hspace=3 border=0 onclick='javascript:___wbe_DialogMinimize()'>");document.write("<img src='include/admin/img/btn_rest_edt_box.gif' id='wbe_bar_btn_max' hspace=3 border=0 onclick='javascript:___wbe_DialogMaximize()' style='display:none' >");document.write("<img src='include/admin/img/btn_clo_edt_box.gif' hspace=3 border=0 onclick='javascript:___wbe_HideDialogHandler()'>");document.write("</div>");document.write("</div>");document.write("<div id='wbe_edit_box_showhelp'><a href='javascript:___showHelp(200);' onClick=''>ayuda &gt;&gt;</a></div>");document.write("<div id='wbe_edit_box_margin_top'> </div>");document.write("<div id='wbe_edit_box_help'>");document.write("<div id='wbe_edit_box_hidehelp'><a href='javascript:___hideHelp();'>&lt;&lt; ocultar ayuda</a></div>");document.write("<div id='wbe_edit_box_help_tit'></div>");document.write("<div id='wbe_edit_box_help_text'>");document.write("</div>");document.write("</div>");document.write("<iframe id=wbe_DialogIFrame name=wbe_editIFrame scrolling=auto frameborder=0 MARGINWIDTH=0 MARGINHEIGHT=0></iframe>");document.write("</div>");}};this.init=function(){this.wbe_createDialogLayers();this.maskLayer=document.getElementById("wbe_DialogMask");this.containerLayer=document.getElementById("wbe_edit_box");this.iFrameLayer=document.getElementById("wbe_DialogIFrame");this.titleLayer=document.getElementById("wbe_edit_box_title");this.shadowLayer=document.getElementById("wbe_edit_box_shadow");this.width=800;this.height=600;this.returnFunc=null;this.IsDialogShowed=false;if(!document.all){document.onkeypress=wbe_keyDownHandler;}
window.onresize=___wbe_CenterDialogHandler;window.onscroll=___wbe_CenterDialogHandler;};this.show=function(bHideButtons)
{if(bHideButtons)
document.getElementById('buttons').style.display="none";else
document.getElementById('buttons').style.display="";___restartHelpWindow();document.getElementById("wbe_edit_box").style.filter='alpha(opacity=100)';document.getElementById("wbe_edit_box").style.opacity='1';this.isWizard=false;this.IsDialogShowed=true;this.disableTabIndexes();this.titleLayer.innerHTML="Editor: "+this.title;this.maskLayer.style.display="block";this.containerLayer.style.display="block";this.shadowLayer.style.display="block";this.zIndex=this.wbe_JsHelper.getMaxZindex();this.maskLayer.style.zIndex=this.zIndex++;this.shadowLayer.style.zIndex=this.zIndex++
this.containerLayer.style.zIndex=this.zIndex++;this.center(this.width,this.height);var titleBarHeight=parseInt(document.getElementById("wbe_edit_box_header").offsetHeight,10);this.containerLayer.style.width=this.width+"px";this.containerLayer.style.height=(this.height+titleBarHeight)+"px";___resizeShadow();this.iFrameLayer.style.width=this.width+"px";;this.iFrameLayer.style.height=(this.height)+"px";this.iFrameLayer.src=this.url;if(this.IsDialogShowed==true)this.hideSelectBoxes();};this.showWizard=function(bHideButtons)
{if(bHideButtons)
document.getElementById('buttons').style.display="none";else
document.getElementById('buttons').style.display="";___restartHelpWindow();document.getElementById("wbe_edit_box").style.filter='alpha(opacity=100)';document.getElementById("wbe_edit_box").style.opacity='1';this.isWizard=true;this.IsDialogShowed=true;this.titleLayer.innerHTML="Asistente";this.maskLayer.style.display="none";this.containerLayer.style.display="block";this.shadowLayer.style.display="block";this.zIndex=this.wbe_JsHelper.getMaxZindex();this.maskLayer.style.zIndex=this.zIndex++;this.containerLayer.style.zIndex=this.zIndex++;this.center(this.width,this.height);var titleBarHeight=parseInt(document.getElementById("wbe_edit_box_header").offsetHeight,10);this.containerLayer.style.width=this.width+"px";this.containerLayer.style.height=(this.height+titleBarHeight)+"px";this.iFrameLayer.style.width=this.width+"px";;this.iFrameLayer.style.height=(this.height)+"px";this.iFrameLayer.src=this.url;if(this.IsDialogShowed==true)this.hideSelectBoxes();___resizeShadow();};this.showWizardWithFading=function(bHideButtons)
{if(bHideButtons)
document.getElementById('buttons').style.display="none";else
document.getElementById('buttons').style.display="";this.containerLayer.style.display='';this.containerLayer.style.filter='alpha(opacity=0)';this.containerLayer.style.opacity='0.0';this.showWizard();setTimeout('___FadeWizard(0);',10);};this.center=function(){if(this.IsDialogShowed){if(!this.isWizard){if(this.width==null||isNaN(this.width)){this.width=this.containerLayer.offsetWidth;}
if(this.height==null){this.height=this.containerLayer.offsetHeight;}
var fullHeight=this.wbe_JsHelper.getViewHeight();var fullWidth=this.wbe_JsHelper.getViewWidth();var scTop=(document.documentElement.scrollTop)?parseInt(document.documentElement.scrollTop,10):parseInt(document.body.scrollTop,10);var scLeft=(document.documentElement.scrollLeft)?parseInt(document.documentElement.scrollLeft,10):parseInt(document.body.scrollLeft,10);this.maskLayer.style.height=fullHeight+"px";this.maskLayer.style.width=fullWidth+"px";this.maskLayer.style.top=scTop+"px";this.maskLayer.style.left=scLeft+"px";window.status=this.maskLayer.style.top+" "+this.maskLayer.style.left+" "+this.gi++;var titleBarHeight=parseInt(document.getElementById("wbe_edit_box_header").offsetHeight,10);this.containerLayer.style.top=150+"px";this.containerLayer.style.left=(scLeft+((fullWidth-this.width)/2))+"px";this.shadowLayer.style.top=160+"px";this.shadowLayer.style.left=((scLeft+((fullWidth-this.width)/2))-10)+"px";}else{if(this.width==null||isNaN(this.width)){this.width=this.containerLayer.offsetWidth;}
if(this.height==null){this.height=this.containerLayer.offsetHeight;}
var fullWidth=this.wbe_JsHelper.getViewWidth();var titleBarHeight=parseInt(document.getElementById("wbe_edit_box_header").offsetHeight,10);var scTop=(document.documentElement.scrollTop)?parseInt(document.documentElement.scrollTop,10):parseInt(document.body.scrollTop,10);var scLeft=(document.documentElement.scrollLeft)?parseInt(document.documentElement.scrollLeft,10):parseInt(document.body.scrollLeft,10);this.containerLayer.style.top=150+"px";this.containerLayer.style.left=(scLeft+(fullWidth-(this.width+30)))+"px";this.shadowLayer.style.top=160+"px";this.shadowLayer.style.left=((scLeft+(fullWidth-(this.width+30)))-10)+"px";}}};this.hide=function(){this.IsDialogShowed=false;this.restoreTabIndexes();if(!this.maskLayer)return;this.maskLayer.style.display="none";this.containerLayer.style.display="none";this.shadowLayer.style.display="none";if(this.returnFunc)
this.returnFunc(this.iFrameLayer.returnVal);this.iFrameLayer.src='';if(this.HasToHideSelects)this.displaySelectBoxes();}
this.hideSelectBoxes=function(){for(var i=0;i<document.forms.length;i++){for(var e=0;e<document.forms[i].length;e++){if(document.forms[i].elements[e].tagName=="SELECT")
document.forms[i].elements[e].style.visibility="hidden";}}};this.displaySelectBoxes=function(){for(var i=0;i<document.forms.length;i++){for(var e=0;e<document.forms[i].length;e++){if(document.forms[i].elements[e].tagName=="SELECT")
document.forms[i].elements[e].style.visibility="visible";}}};this.disableTabIndexes=function(){if(document.all){var i=0;for(var j=0;j<this.TabbableTags.length;j++){var tagElements=document.getElementsByTagName(this.TabbableTags[j]);for(var k=0;k<tagElements.length;k++){this.TabIndexes[i]=tagElements[k].tabIndex;tagElements[k].tabIndex="-1";i++;}}}};this.restoreTabIndexes=function(){if(document.all){var i=0;for(var j=0;j<this.TabbableTags.length;j++){var tagElements=document.getElementsByTagName(this.TabbableTags[j]);for(var k=0;k<tagElements.length;k++){tagElements[k].tabIndex=this.TabIndexes[i];tagElements[k].tabEnabled=true;i++;}}}};this.minimize=function(){this.iFrameLayer.style.display='none';this.containerLayer.style.height=16;this.shadowLayer.style.height=0;document.getElementById("wbe_bar_btn_min").style.display='none';document.getElementById("wbe_bar_btn_max").style.display='';};this.maximize=function(){this.iFrameLayer.style.display='';this.containerLayer.style.height=this.height;var titleBarHeight=parseInt(document.getElementById("wbe_edit_box_header").offsetHeight,10);___resizeShadow();document.getElementById("wbe_bar_btn_min").style.display='';document.getElementById("wbe_bar_btn_max").style.display='none';};this.resize=function(iWidth,iHeight){this.width=iWidth;this.height=iHeight;this.center();this.containerLayer.style.width=this.width+"px";var titleBarHeight=parseInt(document.getElementById("wbe_edit_box_header").offsetHeight,10);this.containerLayer.style.height=(this.height+titleBarHeight)+"px";___resizeShadow();this.iFrameLayer.style.width=this.width+"px";;this.iFrameLayer.style.height=(this.height)+"px";};};function wbe_keyDownHandler(event){if(___wbeADMIN.dialogPopUp.IsDialogShowed&&event.keyCode==9)return false;}
function ___wbe_CenterDialogHandler(){___wbeADMIN.dialogPopUp.center();}
function ___wbe_DialogMaximize(){___wbeADMIN.dialogPopUp.maximize();}
function ___wbe_DialogMinimize(){___wbeADMIN.dialogPopUp.minimize();}
function ___wbe_HideDialogHandler(){document.getElementById("wbe_DialogIFrame").style.display='';___wbeADMIN.dialogPopUp.hide();}
function ___FadeWizard(in_op){in_op+=10;if(in_op<100){document.getElementById("wbe_edit_box").style.filter='alpha(opacity='+in_op+')';document.getElementById("wbe_edit_box").style.opacity='0.'+in_op;setTimeout('___FadeWizard('+in_op+');',10);}else{document.getElementById("wbe_edit_box").style.filter='alpha(opacity=100)';document.getElementById("wbe_edit_box").style.opacity='1';}}
function ___showHelp(width_help){var edit_box=new WBEDivManager("wbe_edit_box");var new_width_edit_box;new_width_edit_box=edit_box.w+width_help+5-2;document.getElementById('wbe_edit_box').style.width=''+new_width_edit_box+'px';document.getElementById('wbe_edit_box_help').style.display='block';document.getElementById('wbe_edit_box_help').style.height=edit_box.h+'px';document.getElementById('wbe_edit_box_margin_top').style.display='block';document.getElementById('wbe_edit_box_showhelp').style.display='none';___wbeADMIN.dialogPopUp.width=new_width_edit_box;___wbeADMIN.dialogPopUp.center();___resizeShadow();}
function ___hideHelp(){var edit_box=new WBEDivManager("wbe_edit_box");var help_box=new WBEDivManager("wbe_edit_box_help");var new_width_edit_box;if(help_box.w==0){new_width_edit_box=___wbeADMIN.dialogPopUp.width}else{new_width_edit_box=edit_box.w-help_box.w-5-2;}
document.getElementById('wbe_edit_box').style.width=''+new_width_edit_box+'px';___hideHelpWindow();___wbeADMIN.dialogPopUp.width=new_width_edit_box;___wbeADMIN.dialogPopUp.center();___resizeShadow();}
function ___hideHelpWindow(){document.getElementById('wbe_edit_box_help').style.display='none';document.getElementById('wbe_edit_box_margin_top').style.display='none';document.getElementById('wbe_edit_box_showhelp').style.display='block';}
function ___restartHelpWindow(){document.getElementById('wbe_edit_box_help').style.display='none';document.getElementById('wbe_edit_box_margin_top').style.display='block';document.getElementById('wbe_edit_box_showhelp').style.display='none';document.getElementById('wbe_edit_box_help_tit').innerHTML='';document.getElementById('wbe_edit_box_help_text').innerHTML='';}
function ___setHelp(helpTile,helpText){if(''+helpText==''){document.getElementById('wbe_edit_box_margin_top').style.display='none';document.getElementById('wbe_edit_box_showhelp').style.display='none';}else{document.getElementById('wbe_edit_box_help_tit').innerHTML=unescape(helpTile);document.getElementById('wbe_edit_box_help_text').innerHTML='<p>'+unescape(helpText)+'</p>';document.getElementById('wbe_edit_box_showhelp').style.display='block';document.getElementById('wbe_edit_box_margin_top').style.display='none';}
___resizeShadow();}
function ___resizeShadow(){var oDivPopUp=new WBEDivManager('wbe_edit_box');document.getElementById('wbe_edit_box_shadow').style.height=oDivPopUp.h+'px';document.getElementById('wbe_edit_box_shadow').style.width=oDivPopUp.w+'px';}