(function($){(function(a){})(jQuery);function EndLoading(){ChangeButtomSrc();ChangeCalendarSrc();CaseAnalitycs();ChangeLinkHref();ChangeFormAction()}function pausecomp(c){var b=new Date();var a=null;do{a=new Date()}while(a-b<c)}function CaseAnalitycs(){WriteFunctionsAnalitycs();if(InitialAnalitycs==true){ChangeFormOnSubmit();AssignLinkOnclick()}}function WriteFunctionsAnalitycs(){if(AnalitycsTest==true){var b=(("https:"==document.location.protocol)?"https://ssl.":"http://www.");vare='<script src="'+b+'google-analytics.com/ga.js" type="text/javascript"><\/script>';if(navigator.appName.toUpperCase().indexOf("MICROSOFT")>=0){$("body").html(vare+$("body").html())}else{$("body").append(vare)}var a='<script type="text/javascript"> var '+AnalitycsVar+'= _gat._getTracker("UA-0"); '+AnalitycsVar+'._setDomainName("none"); '+AnalitycsVar+"._setAllowLinker(true); "+AnalitycsVar+"._trackPageview(); <\/script>";$("body").append(a)}}function ChangeFormAction(){$.each($(".form"),function(){var b=$(this).attr("action");var c=b.indexOf("?");var a=b.length-1;if(c==a){b=b+"asoc="+Asoc}else{b=b+"&asoc="+Asoc}$(this).attr("action",b)})}function ChangeFormOnSubmit(){$.each($(".form"),function(){var newonsubmit=$(this).attr("onsubmit");var Analitycs="javascript:"+AnalitycsVar+"._linkByPost(this); ";if(newonsubmit==undefined){$(this).attr("onsubmit",Analitycs)}if(newonsubmit!=undefined){$(this).removeAttr("onsubmit");$(this).submit(function(){eval("function DoSubmit() {"+Analitycs+newonsubmit+"}");return DoSubmit()})}})}function ChangeLinkHref(){$.each($(".iFSearch a"),function(){var a=$(this).attr("href");var c=a.indexOf("?");var b=a.length-1;if(c==b){a=a+"asoc="+Asoc}else{a=a+"&asoc="+Asoc}$(this).attr("href",a)})}function AssignLinkOnclick(){$.each($(".iFSearch a"),function(){var a=AnalitycsVar+"._link(this.href); return false;";$(this).attr("onClick",a)})}function ChangeButtomSrc(){$.each($(".botonSearch"),function(){var a=$(this).attr("src");a=a.substring(a.indexOf("_lib"),a.length);$(this).attr("src",RutaArchivos+a);$(this).mouseout(function(){$(this).attr("src",RutaArchivos+a)});var b=a.replace(".gif","_ov.gif");$(this).mouseover(function(){$(this).attr("src",RutaArchivos+b)})})}function ChangeCalendarSrc(){$.each($(".cal"),function(){var a=$(this).attr("src");a=a.substring(a.indexOf("_lib"),a.length);$(this).attr("src",RutaArchivos+a)})}function StyleStatus(b){var c='<style type="text/css" id="ERJSStatus'+b.attr("class")+'" >#ERJStatus'+b.attr("class")+'{margin:0;padding:0;border:0;width:189px !important;}#ERJContent{margin:0;padding:0;border:0;background:url(http://afiliados.e-travelsolution.com.mx/_lib/ResBox/public/BoxBackground.gif) no-repeat center 99%;}#ERJLogo{background: url(http://afiliados.e-travelsolution.com.mx/_lib/ResBox/public/logo.png) no-repeat center top;height:18px;margin:0;padding:0;border:0;clear:both;}#ERJTitle{margin:0;padding:0;border:0;height:20px;background: url(http://afiliados.e-travelsolution.com.mx/_lib/ResBox/public/BoxTitle.gif) no-repeat center center;}#ERJMessage{background: #FEFFA9 url(http://afiliados.e-travelsolution.com.mx/_lib/ResBox/public/line.gif) no-repeat center bottom;margin:0;padding:0;border:0;padding-bottom:2px;}#ERJResult{font-family:"Times New Roman" !important;font-size:12px !important;font-weight:bold !important;background:none;text-align:center;margin:0;color:#1c2224 !important;}#ERJAdvice{font-family:"Times New Roman" !important;font-size:11px !important;font-weight:bolder !important;background:none;text-align:center;margin:0;color:#1c2224 !important;}#ERJListStatus p{margin:0;padding:0;border:0;float:left;font-family:Arial !important;font-size:11px !important;font-weight:bold;width:104px;}#ERJListStatus span{margin:0;padding:0;border:0;padding-right:3px;float:left;font-family:Arial !important;font-size:10px !important;padding-left:1px !important;}#ERJTitleItem, #ERJContentItem,#ERJStatusItem,#ERJNoteItem{margin:0;padding:0;border:0;height:auto;width:189px;clear:left;}#ERJLogo p{margin:0;padding:0;border:0;height:15px;width:189px;}#ERJTitleItem p{width:81px;}#ERJContent img{border:0;padding:0;margin:0;width:10px;float:left;}#ERJNoteItem p{width:96px;}#ERJStatusItem p{width:105px;}#ERJContent div{padding-bottom:3px;padding-top:1px;}#ERJContent span.ERJNote{margin:0;padding:0;border:0;padding-left:3px !important;padding-right:3px !important;padding-top:0px !important;font-family: "Arial Narrow" !important;color:#6c6753;font-size:11px !important;display:block;}#ERJItems a{color:#803300 !important;text-decoration:none !important;font-weight:bold !important;}#ERJVersion{margin:0 ;padding:0;border:0;clear:both;font-family:Verdana;font-size:10px;padding-bottom:1px;}#ERJPlugin,#ERJResBox{margin:0;padding:0;border:0;font-weight:bolder;}#ERJResBox{float:right;margin-right:0px;text-align:right;}#ERJPlugin{float:left;margin-left:0px;text-align:left;}</style>';$("body").append(c)}function ContentStatus(b){StAsoc="ERJfine";StVersion="ERJerror";StRArchivo="ERJfine";StBoxName="ERJfine";StJQVersion="ERJfine";if(Asoc=="test"){StAsoc="ERJerror"}if(RutaArchivos.toLowerCase()=="/partners/resbox/"){StRArchivo="ERJwarning"}if(BoxName.toLowerCase()=="rb_esp.html"){StBoxName="ERJwarning"}if($().jquery<"1.3.2"){StJQVersion="ERJwarning"}var c='<div id="ERJStatus'+b.attr("class")+'"><div id="ERJTitle"></div><div id="ERJMessage"><p id="ERJResult">Carga Exitosa </p></div><div id="ERJContent"><div id="ERJListStatus"><div id="ERJItems"><div id="ERJTitleItem"><span>Clave de Asociado:</span><p>'+Asoc+'</p><img class="'+StAsoc+'" src="http://afiliados.e-travelsolution.com.mx/_lib/resbox/public/sgood.gif" alt="Error" title="Error"/><span class="ERJNote '+StAsoc+' ERJAsoc">Debe establecer el parametro Asoc</span></div><div id="ERJContentItem"><span>Ruta Archivos:</span><p>'+RutaArchivos+'</p><img class="'+StRArchivo+'" src="http://afiliados.e-travelsolution.com.mx/_lib/resbox/public/swarning.gif" alt="Warning" title="Warning" /></div><div id="ERJStatusItem"><span>Nombre Caja:</span><p>'+BoxName+'</p><img class="'+StBoxName+'" src="http://afiliados.e-travelsolution.com.mx/_lib/resbox/public/sgood.gif" alt="Good" title="Good" /><span class="ERJNote '+StBoxName+' ERJBoxName">Para verificar existencia de click <a href="#">Aqu&iacute;</a></span></div><div id="ERJNoteItem"><span>Versi&oacute;n JQuery:</span><p>'+$().jquery+'</p><img class="'+StJQVersion+'" src="http://afiliados.e-travelsolution.com.mx/_lib/resbox/public/swarning.gif" alt="Warning" title="Warning" /><span class="ERJNote '+StJQVersion+' ERJJQVersion">La versi&oacute;n de JQuery es antigua, podr&iacute;a generar conflictos</span></div></div><div id="ERJVersion"><div id="ERJPlugin">'+RBJQVersion+'</div><div id="ERJResBox">'+RBIVersion+'</div></div></div><div id="ERJLogo"><p>&nbsp;</p></div></div></div>';$(b).before(c);$(".ERJfine").attr("src","http://afiliados.e-travelsolution.com.mx/_lib/resbox/public/sgood.gif");$(".ERJfine").attr("alt","Good");$(".ERJfine").attr("title","Good");$(".ERJNote.ERJfine.ERJAsoc").html("Clave de asociado establecida");$(".ERJNote.ERJfine.ERJBoxName").html('El nombre de la caja ha cambiado, verifique existencia <a href="'+RutaArchivos+BoxName+'">Aqu&iacute;</a>');$(".ERJNote.ERJfine.ERJJQVersion").html("La versi&oacute;n de JQuery es compatible");$(".ERJerror").attr("src","http://afiliados.e-travelsolution.com.mx/_lib/resbox/public/serror.gif");$(".ERJerror").attr("alt","Error");$(".ERJerror").attr("title","Error");$(".ERJNote.ERJerror.ERJAsoc").html("Debe establecer el parametro Asoc");$(".ERJwarning").attr("src","http://afiliados.e-travelsolution.com.mx/_lib/resbox/public/swarning.gif");$(".ERJwarning").attr("alt","Warning");$(".ERJwarning").attr("title","Warning");$(".ERJNote.ERJwarning.ERJBoxName").html('El nombre de la caja no ha cambiado, verifique existencia <a href="'+RutaArchivos+BoxName+'">Aqu&iacute;</a>');$(".ERJNote.ERJwarning.ERJJQVersion").html("La versi&oacute;n de JQuery es antigua, podr&iacute;a generar conflictos")}function Status(b){if(iStatus.toLowerCase()=="on"){StyleStatus(b);ContentStatus(b)}}$.fn.resboxjquery=function(b){AnalitycsVar="pageTracker";Asoc="test";AnalitycsTest=false;iStatus="off";JqueryVersion="none";CValue="";RBJQVersion="RBJQuery 2.0.0.0";RBIVersion="none";vrp="";InitialAnalitycs=false;BoxName="rb_esp.html";RutaArchivosX="/partners/resbox/";if(b.asoc!=undefined){Asoc=b.asoc}if(b.rutaarchivos!=undefined){RutaArchivos=b.rutaarchivos}if(b.boxname!=undefined){BoxName=b.boxname}if(b.analitycstest!=undefined){AnalitycsTest=b.analitycstest}if(b.analitycsvar!=undefined){AnalitycsVar=b.analitycsvar;InitialAnalitycs=true}if(b.status!=undefined){iStatus=b.status}if(b.source!=undefined){RutaArchivosX=b.source}s=window.location.href;m=s.lastIndexOf("/");t=s.substring(0,m);RutaArchivos=t+RutaArchivosX;if(window.location.protocol=="http:"){RutaArchivos="http://"+window.location.host+RutaArchivosX}else{RutaArchivos=t+RutaArchivosX}Status($(this));this.each(function(){var a=RutaArchivos+BoxName;$(this).load(a,function(c,d,e){EndLoading();RBIVersion=$("#RBVersion").attr("value");$("#ERJResBox").html(RBIVersion);if(d=="error"){$("#ERJResult").html("Error "+e.status+" "+e.statusText);$("#ERJAdvice").html("Verifique Estatus")}})});return this};})(jQuery);
