var indicemodal=0;var indicelabel=0;var indiceloading=0;var first=0;var NLayer=new Array();var mostrando_aviso=new Array();var hide_promo=new Array();var cierre=0;function Clayer(e,d,k,a){var j;var g;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_return='<a href="#" $id$ onclick="$action_return$;return false;" title="$text_button_return$" class="$styleButtonReturn$" style=" float:left; margin-left:5px;">$text_button_return$</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=e;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.NoFlash=1;this.width=d;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.BReturn=0;this.ActionBClose="";this.BgColor="CLayerBox";this.actionsReturn="";this.buttonsReturn="";this.StylesbuttonsReturn="";this.layertipo=1;this.type=0;if(k){this.height=k}else{this.height=100}if(a){this.colorTrans=a}else{this.colorTrans="CLayerDefaultColor"}if(first==0){var l=c("head").item(0);var m=document.createElement("link");m.setAttribute("rel","stylesheet");m.setAttribute("href","http://st.fimagenes.com/css/layerV2.css");l.appendChild(m);first++}};this.init();this.open=function(q){if(this.type==1&&indicemodal>0){var m=NLayer[indicemodal];m.Cerrar()}var r="";var p=this.top;var o=this.modal;var n="";p=p.replace(/\$titulo_layer\$/,this.titulo);if(this.ActionAspa==""){p=p.replace(/\$action_aspa\$/,"$ocultarAviso("+this.id_layer+");")}else{p=p.replace(/\$action_aspa\$/,this.ActionAspa)}p=p.replace(/\$visibility_aspa\$/,this.visibility_aspa);if(this.topandbottom==1){o=o.replace("$ClayerTop$",p);if(this.numbuttons>0){o=o.replace("$ClayerRow$","CLayerRow")}else{if(this.BClose<2){o=o.replace("$ClayerRow$","CLayerRow")}else{o=o.replace("$ClayerRow$","CLayerRowWithoutBottom")}}}else{if(this.BClose<2){o=o.replace(/\$ClayerTop\$/,"");o=o.replace(/\$ClayerRow\$/,"CLayerRowWithoutTopBottom")}else{o=o.replace(/\$ClayerTop\$/,"");o=o.replace(/\$ClayerRow\$/,"CLayerRowWithoutTop")}}for(i=0;i<this.numbuttons;i++){var l=this.button;l=l.replace(/\$text_button\$/g,this.buttons[i]);l=l.replace(/\$styleButton\$/g,this.Stylesbuttons[i]);l=l.replace("$action$",this.actions[i]+";return false;");if(this.ids[i]!=""){l=l.replace("$id$",'id="'+this.ids[i]+'"')}else{l=l.replace("$id$","")}if(this.anclas[i]==0&&this.ancla==1){l=l.replace("$ancla_boton$","#")}else{l=l.replace("$ancla_boton$","javascript:;")}n=n+l}m3_aux='<div style=" float:left; $mode$; " id="ClayerBottons_'+this.id_layer+'">';if(this.BClose!=2){m3_aux+=this.button_close}if(this.BReturn!=0){m3_aux+=this.button_return;m3_aux=m3_aux.replace("$id$","BLayerVolver");m3_aux=m3_aux.replace("$action_return$",this.actionsReturn);m3_aux=m3_aux.replace(/\$text_button_return\$/g,this.buttonsReturn);m3_aux=m3_aux.replace("$styleButtonReturn$",this.StylesbuttonsReturn)}m3_aux+=n+"</div>";n=m3_aux;caja=o.replace("$ClayerMensaje$","$ClayerDuplicateBottons$"+this.texto);if(this.botones_duplicados==1){caja=caja.replace("$ClayerDuplicateBottons$","<div style='margin-bottom:30px;'>"+n+"</div>")}else{caja=caja.replace("$ClayerDuplicateBottons$","")}caja=caja.replace("$ClayerBottom$",n);if(this.type==1){caja=caja.replace(/\$mode2\$/g,"width:"+this.width+"px;border:10px solid #469dbe;")}else{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(q!="undefined"&&q=="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(n,m,l){this.buttons[this.numbuttons]=n.toUpperCase();this.actions[this.numbuttons]=m;if(l){this.Stylesbuttons[this.numbuttons]=l}else{this.Stylesbuttons[this.numbuttons]="buttonExpo18"}this.ids[this.numbuttons]="";this.numbuttons++};this.ActivateButtonReturn=function(n,m,l){this.BReturn=1;this.buttonsReturn=n.toUpperCase();this.actionsReturn=m;if(l){this.StylesbuttonsReturn=l}else{this.StylesbuttonsReturn="buttonExpo18"}};this.setMensaje=function(l){this.texto=l;this.buttons=new Array();this.actions=new Array();this.numbuttons=0};this.addButton=function(m,l){this.AddButton(m,l)};this.setNoNeedButtonsDefault=function(){this.needbuttonsdefault=0};this.setYesNeedButtonsDefault=function(){this.needbuttonsdefault=1};this.setLanzador=function(l){this.lanzador=l};this.setActionDefault=function(l){this.ActionAspa=l;this.ActionBClose=l};this.setModeBClose=function(l){this.BClose=l};this.AddIdButton=function(m,l){this.ids[m]=l};this.addIdButton=function(m,l){this.AddIdButton(m,l)};this.SinTopAndBottom=function(){this.topandbottom=0};this.ConTopAndBottom=function(){this.topandbottom=1};this.setTitulo=function(l){this.titulo=l};this.getIndiceModal=function(){return indicemodal};this.setAlto=function(l){this.height=l};this.setAncho=function(l){this.width=l};this.setVisibleAspa=function(){this.visibility_aspa="visible"};this.setHiddenAspa=function(){this.visibility_aspa="hidden"};this.Cerrar=function(){this.hideModal()};this.setBgColor=function(l){this.BgColor=l};this.setNoFlash=function(){this.NoFlash=0};this.setAncla=function(l){this.ancla=1;this.anclas[l]=1};this.setDuplicateButtons=function(){this.botones_duplicados=1};this.setColorTrans=function(l){this.colorTrans=l};this.setTypeClayer=function(l){this.type=l};this.errorLabel=function(l){b();g.style.color="#FFF";g.style.background="#C30";g.innerHTML=l;setTimeout(function(){if(f("_ajax_label")){document.body.removeChild(f("_ajax_label"))}},this.errorTimeout*1000)};this.showLabel=function(l){b();g.style.color="#000";g.style.background="#FD6";g.innerHTML=l;g.style.display=""};this.hideLabel=function(l){indicelabel--;if(l){b();g.style.color="#FFF";g.style.background="#093";g.innerHTML=l;setTimeout(function(){if(f("_ajax_label")){document.body.removeChild(f("_ajax_label"))}},this.hideTimeout*1000)}else{if(f("_ajax_label")){document.body.removeChild(f("_ajax_label"))}}};this.NewAlto=function(o){var n=this.id_layer;if(o>this.height){var m=o-this.height;var l=this.height+m}else{if(this.height>o){var m=this.height-o;var l=this.height-m}else{var l=this.height}}f(n).style.height=l+"px";if(this.topandbottom==1){AltoContenido=l-70}else{AltoContenido=l-35}f("ClayerContent_"+this.id_layer).style.height=AltoContenido+"px"};this.NewAncho=function(l){var n=navigator.appName;if(n=="Microsoft Internet Explorer"){NuevoAncho=l-10}else{NuevoAncho=l}var m=this.id_layer;f(m).style.width=NuevoAncho+"px";f("ClayerBottom_"+this.id_layer).style.width=NuevoAncho+"px";f("ClayerContent_"+this.id_layer).style.width=NuevoAncho+"px";f("ClayerBottons_"+this.id_layer).style.width=NuevoAncho+"px"};this.showModal=function(q,u,s){if(u=="no"){NLayer[indicemodal]=m;var m="_ajax_modalcontent_"+this.id_layer+"_"+indicemodal;if(!f(m)){t=document.createElement("DIV");t.style.cssText="z-index:"+((10000*indicemodal)+1)+";";t.id=m;document.body.appendChild(t)}f(m).innerHTML=q;document.body.style.height="100%";f(m).style.top=h()+"px"}else{if(this.type==0){indicemodal++;var m="_ajax_color_"+indicemodal;var n=navigator.userAgent;if(n.indexOf("Chrome")>0){var r=document.body.scrollHeight}else{var r=document.documentElement.scrollHeight}t="";if(!f(m)){t=document.createElement("DIV");t.style.cssText="position:absolute; left: 0px; top: 0px; width: 100%; height: "+r+"px; z-index:"+((10000*indicemodal)+1)+"; filter:alpha(opacity=70);opacity:.70;";t.className=this.colorTrans;t.id=m;document.body.appendChild(t)}indicemodal++;var p="_ajax_frame_trans_"+indicemodal;var t="";if(!f(p)){t=document.createElement("IFRAME");t.id=p;t.name=p;t.scrolling="no";t.frameBorder="0";if(this.nav=="Microsoft Internet Explorer"&&this.colorTrans!="default_color"){t.src="http://www.facilisimo.com/js/layer_trans.cfm?altura="+r}t.style.cssText="background:transparent;border:none;width:100%; height:"+r+"px; position:absolute; top:0; left:0; z-index:"+((10000*indicemodal)+1)+"; filter:alpha(opacity=0);opacity:.0;";if(this.colorTrans!="CLayerTransparente"){t.className=this.colorTrans}else{t.className="CLayerDefaultColor"}document.body.appendChild(t)}}indicemodal++;NLayer[indicemodal]=this;var m="_ajax_modalcontent_"+this.id_layer+"_"+indicemodal;t="";if(!f(m)){t=document.createElement("DIV");if(this.type==1){newAncho=this.width/2;newAlto=this.height/2;t.style.cssText="position:absolute;left: 50%; top: 50%;  margin-left:-"+newAncho+"px; margin-top:-"+newAlto+"px; z-index:"+((10000*indicemodal)+1)+";"}else{t.style.cssText="position:absolute;left: 0px; top: 0px; width: 100%; height: 100%; z-index:"+((10000*indicemodal)+1)+";"}if(this.colorTrans=="CLayerTransparente"){t.className=this.colorTrans}t.id=m;document.body.appendChild(t)}var l='height="100%"';if(s!="undefined"&&s=="mens"){l=""}if(this.colorTrans=="CLayerTransparente"){if(this.type==1){f(m).innerHTML='<div class="CLayerModalStyle">'+q+'<div style="clear:both"></div></div>'}else{f(m).innerHTML='<table border="0" width="100%" '+l+' align="center" class="CLayerTransparente"><tr><td align="center"><div class="CLayerModalStyle">'+q+'<div style="clear:both"></div></div></td></tr></table>'}}else{if(this.type==1){f(m).innerHTML='<div class="CLayerModalStyle">'+q+'<div style="clear:both"></div></div>'}else{f(m).innerHTML='<table border="0" width="100%" '+l+' align="center"><tr><td align="center"><div class="CLayerModalStyle">'+q+'<div style="clear:both"></div></div></td></tr></table>'}}if(this.type!=1){document.body.style.height="100%";if(s!="undefined"&&s=="mens"){f(m).style.top="150px"}else{f(m).style.top=h()+"px"}if(this.NoFlash==1){var o=document.getElementsByTagName("object");for(i=0;i<o.length;i++){o[i].style.visibility="hidden"}}}}};this.hideModal=function(){if(f("_ajax_modalcontent_"+this.id_layer+"_"+indicemodal)){if(f("_ajax_modalcontent_"+this.id_layer+"_"+indicemodal)){document.body.removeChild(f("_ajax_modalcontent_"+this.id_layer+"_"+indicemodal));indicemodal--;NLayer[indicemodal]=null}if(f("_ajax_frame_trans_"+indicemodal)){document.body.removeChild(f("_ajax_frame_trans_"+indicemodal));indicemodal--}if(f("_ajax_color_"+indicemodal)){document.body.removeChild(f("_ajax_color_"+indicemodal));indicemodal--}}if(indicemodal>0&&f("_ajax_modalcontent_"+this.id_layer+"_"+indicemodal)){f("_ajax_modalcontent_"+this.id_layer+"_"+indicemodal).style.top=h()}if(this.NoFlash==1&&indicemodal<1){var l=document.getElementsByTagName("object");for(i=0;i<l.length;i++){l[i].style.visibility="visible"}}};function b(){if(f("_ajax_label")){g=f("_ajax_label")}else{indicelabel++;g=document.createElement("SPAN");g.style.cssText="position: absolute; right:0px; padding: 2px 20px 2px 20px; font-family: arial; font-size: 13px; font-weight: bold; z-index:"+((10000*indicelabel)+2);g.id="_ajax_label";document.body.appendChild(g)}g.style.top=h()+"px"}function h(){var l=0;if(document.documentElement&&document.documentElement.scrollTop){l=document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){l=document.body.scrollTop}else{if(window.pageYOffset){l=window.pageYOffset}else{if(window.scrollY){l=window.scrollY}}}}return l}function f(l){return document.getElementById(l)}function c(l){return document.getElementsByTagName(l)}j=this}function $aviso(a,e){if(e){var c=new Clayer(a,344,120,e)}else{var c=new Clayer(a,344,120)}var d=c.id_layer;var b=c.getIndiceModal();c.ConTopAndBottom();c.setTitulo("Aviso");c.setVisibleAspa();c.setModeBClose(2);c.addButton("Aceptar","$ocultarAviso("+d+")");c.setActionDefault("$ocultarAviso("+d+")");c.open()}var miLayerLoading=new Clayer("",260,140);function $Loading(c,b){indiceloading++;var a='<div style="width:252px; margin: 0 auto; "><div style="padding:5px 0; width:252px; text-align:center; font-size:14px; color:#e83b45;">   <a href="javascript:;" title="Cerrar" class="buttonRed18" style="float:right;" onclick="miLayerLoading.Cerrar()">X</a>	<img src="http://st.fimagenes.com/images/clayer_loading.gif"/></div><div style="padding:5px 0; text-align:center; font-size:14px; font-weight:bold;">'+c+"<BR />ESPERA UN MOMENTO POR FAVOR</div></div>";miLayerLoading.setMensaje(a);if(b){miLayerLoading.setColorTrans(b)}else{miLayerLoading.setColorTrans("CLayerDefaultColor")}miLayerLoading.setAlto(140);miLayerLoading.setAncho(260);miLayerLoading.setNoFlash();miLayerLoading.SinTopAndBottom();miLayerLoading.setModeBClose(2);miLayerLoading.open()}function $CloseLoading(){indiceloading--;miLayerLoading.Cerrar()}function $LError(b){var a=new Clayer("",0,0);a.errorLabel(b)}function $LAviso(b){var a=new Clayer("",0,0);a.showLabel(b)}function $Label(b){var a=new Clayer("",0,0);a.hideLabel(b)}function $ocultarAviso(b){if(document.getElementById("_ajax_modalcontent_"+b+"_"+indicemodal)){document.body.removeChild(document.getElementById("_ajax_modalcontent_"+b+"_"+indicemodal));indicemodal--;NLayer[indicemodal]=null}if(document.getElementById("_ajax_frame_trans_"+indicemodal)){document.body.removeChild(document.getElementById("_ajax_frame_trans_"+indicemodal));indicemodal--}if(document.getElementById("_ajax_color_"+indicemodal)){document.body.removeChild($("_ajax_color_"+indicemodal));indicemodal--}if(document.getElementById("_ajax_modalcontent_"+b+"_"+indicemodal)){document.getElementById("_ajax_modalcontent_"+b+"_"+indicemodal).style.top=getScrollY()}if(indicemodal<1){var a=document.getElementsByTagName("object");for(i=0;i<a.length;i++){a[i].style.visibility="visible"}}}function getScrollY(){var a=0;if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){a=document.body.scrollTop}else{if(window.pageYOffset){a=window.pageYOffset}else{if(window.scrollY){a=window.scrollY}}}}return a}function avisoEmergente(d,b,c,a){var e=this;this.texto="";this.alto=c;this.posBottom=0;this.titulo=d;this.msg;this.idx;this.espacio=(es_ie()?15:5);this.tiempo=(es_ie()?15:5);this.init=function(){mostrando_aviso.push(e);hide_promo.push(1);cierre=0;e.idx=mostrando_aviso.length-1;e.msg=document.createElement("div");e.msg.id="mostrando_aviso"+e.idx;e.msg.className="CLayerFixedClass";if(a=="left"){e.msg.style.left="0px"}else{e.msg.style.right="0px"}e.msg.innerHTML='<div class="CLayer_promo" id="idVentanaPromo" style="display:block;" onmouseover="mostrando_aviso['+e.idx+'].mantener()" onmouseout="mostrando_aviso['+e.idx+'].nomantener()">		<div class="contS">			<div class="headS">				<a href="#" onClick="hide_promo['+e.idx+"]=1; cierre = 1; mostrando_aviso["+e.idx+'].hide();return false;" class="buttonRed18" style="float:right">X</a>facilisimo/ <span class="font14">Aviso</span>			</div>			<div class="cuerpoS" style="background:#FFF url(http://api.facilisimo/api/html/images/degVentanaPromo1.gif) repeat-x;">				<p id="txtPromo"><span style="font-size:16px"></span><span class="font20 bold" style="margin-bottom:10px; color:#469dbe;">'+this.titulo+"</span><br /><br /></p>				<p>"+this.texto+"</p>			</div>		</div></div>";var f=e.msg.getElementsByTagName("a");for(i=0;i<f.length;i++){addListen("click",f[i],function(){mostrando_aviso[e.idx].hide()})}e.msg.style.bottom=-c+"px";if(e.idx==0){e.posBottom=(e.idx*c)+215}else{e.posBottom=mostrando_aviso[e.idx-1].posBottom+c+75}document.body.appendChild(e.msg);e.show()};this.show=function(){var f=parseInt(e.msg.style.bottom.replace("px",""));if(f<e.posBottom){e.msg.style.bottom=(f+e.espacio)+"px";setTimeout("mostrando_aviso["+e.idx+"].show()",e.tiempo)}else{setTimeout("mostrando_aviso["+e.idx+"].hide()",15000)}};this.hide=function(){if(hide_promo[e.idx]==1){var f=parseInt(e.msg.style.bottom.replace("px",""));if(f>-e.alto){e.msg.style.bottom=(f-e.espacio)+"px";setTimeout("mostrando_aviso["+e.idx+"].hide()",e.tiempo)}else{e.msg.style.display="none";mostrando_aviso[e.idx].posBottom=0}}};this.mantener=function(){if(cierre==0){hide_promo[e.idx]=0;var f=parseInt(e.msg.style.bottom.replace("px",""));e.msg.style.bottom=f+"px"}};this.nomantener=function(){hide_promo[e.idx]=1;setTimeout("mostrando_aviso["+e.idx+"].hide()",15000)};if(b!=null){this.texto=b;this.init()}}function es_ie(){return(navigator.userAgent.toLowerCase().indexOf("msie")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("opera")==-1)}function addListen(d,c,b){if(c.addEventListener){c.addEventListener(d,b,false)}else{if(c.attachEvent){var a=c.attachEvent("on"+d,b);return a}else{throw"No es posible añadir evento"}}}function $avisoEmergente(c,a,b){var d=new avisoEmergente(c,a,b,"left")};