 var indicemodal=0;var first=0;var NLayer=new Array();function Clayer(_1,_2,_3,_4){var _5;var _6;this.errorTimeout=5;this.hideTimeout=2;this.nav=navigator.appName;this.top="<div class=\"CLayerRowTitClayer\" id=\"ClayerBottom_$idLayer$\" style=\"text-align:left; $mode$\">"+"<a href=\"javascript:;\" title=\"Cerrar\" class=\"buttonRed18\" style=\"float:right; visibility:$visibility_aspa$\" onclick=\"$action_aspa$\">X</a>"+"<span class=\"CLayerNaranja CLayerNormal CLayerBold\">&raquo;</span>"+"<span class=\"font16 bold\"> $titulo_layer$</span></div>";this.modal="<div class=\"$BgColor$\" style=\"$mode2$\" id=\"$idLayer$\">"+"$ClayerTop$"+"<div class=\"$ClayerRow$\" style=\"$altura_layer$$mode$\" id=\"ClayerContent_$idLayer$\">$ClayerMensaje$</div>"+"$ClayerBottom$";"</div>";this.button="<a href=\"$ancla_boton$\" $id$ onclick=\"$action$\" title=\"$text_button$\" class=\"$styleButton$\" style=\" float:right; margin-left:5px;\">$text_button$</a>";this.button_close="<a href=\"#\" onclick=\"$action_button_close$;return false;\" title=\"$text_button_close$\" class=\"buttonRed18\" style=\" float:right; margin-left:5px;\">$text_button_close$</a>";this.init=function(){this.texto=_1;this.buttons=new Array();this.Stylesbuttons=new Array();this.actions=new Array();this.anclas=new Array();this.ids=new Array();this.numbuttons=0;this.needbuttonsdefault=1;this.ancla=0;this.width=_2;if(_3){this.height=_3;}else{this.height=100;} this.lanzador="layer";this.topandbottom=1;this.titulo="Aviso";this.ActionAspa="";this.visibility_aspa="visible";this.botones_duplicados=0;this.id_layer=Math.random();this.BClose=0;this.ActionBClose="";this.BgColor="CLayerBox";if(_4){this.colorTrans=_4;}else{this.colorTrans="CLayerDefaultColor";} if(first==0){var _7=$_("head").item(0);var st=document.createElement("link");st.setAttribute("rel","stylesheet");st.setAttribute("href","http://www.facilisimo.com/css/layerV2-src.css");_7.appendChild(st);first++;}};this.init();this.open=function(_9){var _a="";var m1=this.top;var m2=this.modal;var m3="";m1=m1.replace(/\$titulo_layer\$/,this.titulo);if(this.ActionAspa==""){m1=m1.replace(/\$action_aspa\$/,"$ocultarAviso("+this.id_layer+");");}else{m1=m1.replace(/\$action_aspa\$/,this.ActionAspa);} m1=m1.replace(/\$visibility_aspa\$/,this.visibility_aspa);if(this.topandbottom==1){m2=m2.replace("$ClayerTop$",m1);if(this.numbuttons>0){m2=m2.replace("$ClayerRow$","CLayerRow");}else{if(this.BClose<2){m2=m2.replace("$ClayerRow$","CLayerRow");}else{m2=m2.replace("$ClayerRow$","CLayerRowWithoutBottom");}}}else{if(this.BClose<2){m2=m2.replace(/\$ClayerTop\$/,"");m2=m2.replace(/\$ClayerRow\$/,"CLayerRowWithoutTopBottom");}else{m2=m2.replace(/\$ClayerTop\$/,"");m2=m2.replace(/\$ClayerRow\$/,"CLayerRowWithoutTop");}} for(i=0;i<this.numbuttons;i++){var _e=this.button;_e=_e.replace(/\$text_button\$/g,this.buttons[i]);_e=_e.replace(/\$styleButton\$/g,this.Stylesbuttons[i]);_e=_e.replace("$action$",this.actions[i]+";return false;");if(this.ids[i]!=""){_e=_e.replace("$id$","id=\""+this.ids[i]+"\"");}else{_e=_e.replace("$id$","");} if(this.anclas[i]==0&&this.ancla==1){_e=_e.replace("$ancla_boton$","#");}else{_e=_e.replace("$ancla_boton$","javascript:;");} m3=m3+_e;} m3_aux="<div style=\" float:left; $mode$; \" id=\"ClayerBottons_"+this.id_layer+"\">";if(this.BClose!=2){m3_aux+=this.button_close;} m3_aux+=m3+"</div>";m3=m3_aux;caja=m2.replace("$ClayerMensaje$","$ClayerDuplicateBottons$"+this.texto);if(this.botones_duplicados==1){caja=caja.replace("$ClayerDuplicateBottons$","<div style='margin-bottom:30px;'>"+m3+"</div>");}else{caja=caja.replace("$ClayerDuplicateBottons$","");} caja=caja.replace("$ClayerBottom$",m3);caja=caja.replace(/\$mode2\$/g,"width:"+this.width+"px;");caja=caja.replace(/\$mode\$/g,"width:"+this.width+"px;");caja=caja.replace(/\$idLayer\$/g,this.id_layer);caja=caja.replace(/\$BgColor\$/g,this.BgColor);if(this.BClose!=2){if(this.BClose==0){text_button_close="CERRAR";}else{text_button_close="CANCELAR";} caja=caja.replace(/\$text_button_close\$/g,text_button_close);if(this.ActionBClose==""){caja=caja.replace(/\$action_button_close\$/g,"$ocultarAviso("+this.id_layer+");");}else{caja=caja.replace(/\$action_button_close\$/g,this.ActionBClose);}} if(this.topandbottom==1){AltoContenido=this.height-60;}else{AltoContenido=this.height-35;} if(_9!="undefined"&&_9=="mens"){caja=caja.replace(/\$altura_layer\$/g,"");this.showModal(caja,"si","mens");}else{caja=caja.replace(/\$altura_layer\$/g,"height:"+AltoContenido+"px;");this.showModal(caja);}};this.openScroll=function(){this.showModal(this.texto,"no");};this.AddButton=function(_f,_10,_11){this.buttons[this.numbuttons]=_f.toUpperCase();this.actions[this.numbuttons]=_10;if(_11){this.Stylesbuttons[this.numbuttons]=_11;}else{this.Stylesbuttons[this.numbuttons]="buttonExpo18";} this.ids[this.numbuttons]="";this.numbuttons++;};this.setMensaje=function(_12){this.texto=_12;this.buttons=new Array();this.actions=new Array();this.numbuttons=0;};this.addButton=function(_13,_14){this.AddButton(_13,_14);};this.setNoNeedButtonsDefault=function(){this.needbuttonsdefault=0;};this.setYesNeedButtonsDefault=function(){this.needbuttonsdefault=1;};this.setLanzador=function(_15){this.lanzador=_15;};this.setActionDefault=function(_16){this.ActionAspa=_16;this.ActionBClose=_16;};this.setModeBClose=function(num){this.BClose=num;};this.AddIdButton=function(pos,id){this.ids[pos]=id;};this.addIdButton=function(pos,id){this.AddIdButton(pos,id);};this.SinTopAndBottom=function(){this.topandbottom=0;};this.ConTopAndBottom=function(){this.topandbottom=1;};this.setTitulo=function(_1c){this.titulo=_1c;};this.getIndiceModal=function(){return indicemodal;};this.setAlto=function(num){this.height=num;};this.setAncho=function(num){this.width=num;};this.setVisibleAspa=function(){this.visibility_aspa="visible";};this.setHiddenAspa=function(){this.visibility_aspa="hidden";};this.Cerrar=function(){this.hideModal();};this.setBgColor=function(_1f){this.BgColor=_1f;};this.setAncla=function(_20){this.ancla=1;this.anclas[_20]=1;};this.setDuplicateButtons=function(){this.botones_duplicados=1;};this.setColorTrans=function(_21){this.colorTrans=_21;};this.errorLabel=function(msg){crearEtiqueta();_6.style.color="#FFF";_6.style.background="#C30";_6.innerHTML=msg;setTimeout(function(){if($("_ajax_label")){document.body.removeChild($("_ajax_label"));}},this.errorTimeout*1000);};this.showLabel=function(msg){crearEtiqueta();_6.style.color="#000";_6.style.background="#FD6";_6.innerHTML=msg;_6.style.display="";};this.hideLabel=function(msg){if(msg){crearEtiqueta();_6.style.color="#FFF";_6.style.background="#093";_6.innerHTML=msg;setTimeout(function(){if($("_ajax_label")){document.body.removeChild($("_ajax_label"));}},this.hideTimeout*1000);}else{if($("_ajax_label")){document.body.removeChild($("_ajax_label"));}}};this.NewAlto=function(_25){var _26=this.id_layer;if(_25>this.height){var _27=_25-this.height;var _28=this.height+_27;}else{if(this.height>_25){var _27=this.height-_25;var _28=this.height-_27;}else{var _28=this.height;}} $(_26).style.height=_28+"px";if(this.topandbottom==1){AltoContenido=_28-60;}else{AltoContenido=_28-35;} $("ClayerContent_"+this.id_layer).style.height=AltoContenido+"px";};this.NewAncho=function(_29){var nav=navigator.appName;if(nav=="Microsoft Internet Explorer"){NuevoAncho=_29-10;}else{NuevoAncho=_29;} var _2b=this.id_layer;$(_2b).style.width=NuevoAncho+"px";$("ClayerBottom_"+this.id_layer).style.width=NuevoAncho+"px";$("ClayerContent_"+this.id_layer).style.width=NuevoAncho+"px";$("ClayerBottons_"+this.id_layer).style.width=NuevoAncho+"px";};this.showModal=function(_2c,_2d,_2e){if(_2d=="no"){NLayer[indicemodal]=_2f;var _2f="_ajax_modalcontent_"+this.id_layer+"_"+indicemodal;if(!$(_2f)){_30=document.createElement("DIV");_30.style.cssText="z-index:"+((10000*indicemodal)+1)+";";_30.id=_2f;document.body.appendChild(_30);} $(_2f).innerHTML=_2c;document.body.style.height="100%";$(_2f).style.top=getScrollY()+"px";}else{indicemodal++;var _31="_ajax_frame_trans_"+indicemodal;var _30="";var _32=document.documentElement.scrollHeight;if(!$(_31)){_30=document.createElement("IFRAME");_30.id=_31;_30.name=_31;_30.scrolling="no";_30.frameBorder="0";if(this.nav=="Microsoft Internet Explorer"&&this.colorTrans!="default_color"){_30.src="http://casas.facilisimo.com/comun/gestion/gestion_clayer/js/layer_trans.cfm?altura="+_32+"&className="+this.colorTrans;} _30.style.cssText="border:none;width:100%; height:"+_32+"px; position:absolute; top:0; left:0; z-index:"+((10000*indicemodal)+1)+"; filter:alpha(opacity=70);opacity:.70;";if(this.colorTrans!="CLayerTransparente"){_30.className=this.colorTrans;}else{_30.className="CLayerDefaultColor";} document.body.appendChild(_30);} indicemodal++;NLayer[indicemodal]=_2f;var _2f="_ajax_modalcontent_"+this.id_layer+"_"+indicemodal;_30="";if(!$(_2f)){_30=document.createElement("DIV");_30.style.cssText="position:absolute; left: 0px; top: 0px; width: 100%; height: 100%; z-index:"+((10000*indicemodal)+1)+";";if(this.colorTrans=="CLayerTransparente"){_30.className=this.colorTrans;} _30.id=_2f;document.body.appendChild(_30);} var _33="height=\"100%\"";if(_2e!="undefined"&&_2e=="mens"){_33="";} if(this.colorTrans=="CLayerTransparente"){$(_2f).innerHTML="<table border=\"0\" width=\"100%\" "+_33+" align=\"center\" class=\"CLayerTransparente\"><tr><td align=\"center\"><div class=\"CLayerModalStyle\">"+_2c+"<div style=\"clear:both\"></div></div></td></tr></table>";}else{$(_2f).innerHTML="<table border=\"0\" width=\"100%\" "+_33+" align=\"center\"><tr><td align=\"center\"><div class=\"CLayerModalStyle\">"+_2c+"<div style=\"clear:both\"></div></div></td></tr></table>";} document.body.style.height="100%";if(_2e!="undefined"&&_2e=="mens"){$(_2f).style.top="50px";}else{$(_2f).style.top=getScrollY()+"px";}}};this.hideModal=function(){if($("_ajax_modalcontent_"+this.id_layer+"_"+indicemodal)){document.body.removeChild($("_ajax_modalcontent_"+this.id_layer+"_"+indicemodal));indicemodal--;document.body.removeChild($("_ajax_frame_trans_"+indicemodal));NLayer[indicemodal]=null;indicemodal--;} if(indicemodal>0&&$("_ajax_modalcontent_"+this.id_layer+"_"+indicemodal)){$("_ajax_modalcontent_"+this.id_layer+"_"+indicemodal).style.top=getScrollY();}};function crearEtiqueta(){if($("_ajax_label")){_6=$("_ajax_label");}else{indicemodal++;_6=document.createElement("SPAN");_6.style.cssText="position: absolute; right:0px; padding: 2px 20px 2px 20px; font-family: arial; font-size: 13px; font-weight: bold; z-index:"+((10000*indicemodal)+2);_6.id="_ajax_label";document.body.appendChild(_6);} _6.style.top=getScrollY()+"px";} function getScrollY(){var _34=0;if(document.documentElement&&document.documentElement.scrollTop){_34=document.documentElement.scrollTop;}else{if(document.body&&document.body.scrollTop){_34=document.body.scrollTop;}else{if(window.pageYOffset){_34=window.pageYOffset;}else{if(window.scrollY){_34=window.scrollY;}}}} return _34;} function $(id){return document.getElementById(id);} function $_(_36){return document.getElementsByTagName(_36);} _5=this;} function $aviso(_37,_38){if(_38){var _39=new Clayer(_37,344,120,_38);}else{var _39=new Clayer(_37,344,120);} var _3a=_39.id_layer;var _3b=_39.getIndiceModal();_39.ConTopAndBottom();_39.setTitulo("Aviso");_39.setVisibleAspa();_39.setModeBClose(0);_39.setActionDefault("$ocultarAviso("+_3a+")");_39.open();} var miLayerLoading=new Clayer("",344,120);function $Loading(_3c){var _3d="<div style=\"width:252px; margin: 0 auto; \">"+"<div style=\"padding:5px 0; width:252px; text-align:center; font-size:14px; color:#e83b45;\">"+"\t<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"80\" height=\"52\">"+"   <param name=\"movie\" value=\"/comun/swf/preloader-orange.swf\" />"+"   <param name=\"quality\" value=\"high\" />"+"\t<param name=\"wmode\" value=\"transparent\" />"+"   <embed src=\"/comun/swf/preloader-orange.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"80\" height=\"52\" wmode=\"transparent\" ></embed>"+"  \t</object>"+"</div>"+"<div style=\"padding:5px 0; text-align:center; font-size:14px; font-weight:bold;\">"+_3c+"<BR />ESPERA UN MOMENTO POR FAVOR</div>"+"</div>";miLayerLoading.setColorTrans("CLayerTransparente");miLayerLoading.SinTopAndBottom();miLayerLoading.setMensaje(_3d);miLayerLoading.setAncho(260);miLayerLoading.setModeBClose(2);miLayerLoading.open();} function $CloseLoading(){miLayerLoading.Cerrar();} function $LError(msg){var _3f=new Clayer("",0,0);_3f.errorLabel(msg);} function $LAviso(msg){var _41=new Clayer("",0,0);_41.showLabel(msg);} function $Label(msg){var _43=new Clayer("",0,0);_43.hideLabel(msg);} function $ocultarAviso(id){if(document.getElementById("_ajax_modalcontent_"+id+"_"+indicemodal)){document.body.removeChild(document.getElementById("_ajax_modalcontent_"+id+"_"+indicemodal));indicemodal--;document.body.removeChild(document.getElementById("_ajax_frame_trans_"+indicemodal));NLayer[indicemodal]=null;indicemodal--;} if(document.getElementById("_ajax_modalcontent_"+id+"_"+indicemodal)){document.getElementById("_ajax_modalcontent_"+id+"_"+indicemodal).style.top=getScrollY();}} function getScrollY(){var _45=0;if(document.documentElement&&document.documentElement.scrollTop){_45=document.documentElement.scrollTop;}else{if(document.body&&document.body.scrollTop){_45=document.body.scrollTop;}else{if(window.pageYOffset){_45=window.pageYOffset;}else{if(window.scrollY){_45=window.scrollY;}}}} return _45;}
