function Inet(){var self=this; self._init(); }Inet.context=undefined; Inet.rootPath=undefined; Inet.pwdrecoverWSContext=undefined; Inet.prototype._init=function(){var self=this; self.context=self._getContext(); self.rootPath=configuration.getRootPath(); self.pwdrecoverWSContext=configuration.getUrlPwdRecover(); self.siteKey=configuration.getSiteKey(); self.countryCode=undefined; }; Inet.prototype._getContext=function(){var self=this; var pathName=document.location.pathname; return pathName.replace(/\/[^\/]+$/,"/"); }; Inet.prototype.loadI18n=function(){var self=this; var language=navigator.languages?navigator.languages[0]:navigator.language||navigator.browserLanguage; self._loadI18n(language); }; Inet.prototype._loadI18n=function(language){var self=this; var urlI18N=self.context+self.rootPath+"/js/i18n/"+language.toLowerCase()+".js"; $.ajax({async:false,type:"GET",url:urlI18N,data:null,success:function(data){},dataType:"script",cache:true,error:function(xhr,textStatus,errorThrown){var lang=language.split("-"); if(lang.length>1){self._loadI18n(lang[0]); }}}); }; Inet.prototype.test=function(text){var self=this; var url=self.generateUrl("recuperar_final",{}); self.renderUrl({url:url,onSuccess:function(aText){$("#msmFinal").append(aText); },onFailure:function(aStatus){alert("error"); }}); }; Inet.prototype.generateUrl=function(action,params,module){var self=this; var result; var i; var tmp; if(self.context!==undefined){result=self.context; }else{throw"Inet.generateUrl: Missing attribute 'context'."; }result+=self.rootPath; if(module){result+="/"+module; }result+="/"+action+".html"; tmp=null; if(params){for(i in params){if((params[i]!=null)&&(params[i]!=undefined)){if(tmp==null){tmp="?"; }else{tmp+="&"; }tmp+=encodeURIComponent(i)+"="+encodeURIComponent(params[i]); }}}if(tmp){result+=tmp; }return result; }; Inet.prototype.renderTemplate=function(templateUrl,params){var self=this; var textContent=null; $.ajax({context:this,async:false,type:"GET",url:templateUrl,success:function(result){textContent=result; },dataType:"html"}); if(!textContent){throw"Error loading template: "+templateUrl; }else{textContent=self.parserTemplateContent(textContent,params); }return textContent; }; Inet.prototype.parserTemplateContent=function(textContent,params){var template=null; if(params){template=_.template(textContent); template=template(params); }else{template=textContent; }return template; }; Inet.prototype.renderUrl=function(options){var self=this; if((location.protocol=="http:"&&/^https:/.test(options.url))||(location.protocol=="https:"&&/^http:/.test(options.url))){optionsArray.push(options); doMessage(); }else{var tieneDatos=false; if(options.data&&options.data.length>0){tieneDatos=true; }if(typeof XDomainRequest=="object"&&!tieneDatos&&!(new RegExp("^(http|https)://"+location.host).test(options.url))&&(new RegExp("^(http|https)://").test(options.url))){var xdr=new XDomainRequest(); xdr.onload=function(){if(options.onSuccess){options.onSuccess(xdr.responseText); }}; xdr.onerror=function(){if(options.onFailure){options.onFailure(); }}; xdr.open("GET",options.url); xdr.send(); }else{var xmlhttp=false; try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); }catch(e1){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }catch(e2){xmlhttp=false; }}if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){xmlhttp=new XMLHttpRequest(); }if(options.data&&options.data.length>0){xmlhttp.open("POST",options.url,self.iAjaxAsync); xmlhttp.setRequestHeader("Content-type",options.contentType?options.contentType:"application/x-www-form-urlencoded"); }else{xmlhttp.open("GET",options.url,self.iAjaxAsync); xmlhttp.setRequestHeader("Content-type",options.contentType?options.contentType:"application/x-www-form-urlencoded"); }xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==1){if(options.onStart){options.onStart(); }}else{if(xmlhttp.readyState==4){if(xmlhttp.status==200){if(options.onSuccess){options.onSuccess(xmlhttp.responseText); }}else{if(options.onFailure){options.onFailure(xmlhttp.status); }}}}}; xmlhttp.send(options.data); }}}; Inet.prototype.initIndex=function(){var self=this; document.title=i18n.msg("index.title"); if(!$.support.leadingWhitespace){$("").insertBefore($("#real_pass")); $("#fake_pass").val(i18n.msg("index.password")); $("#real_pass").hide(); $("#fake_pass").show(); $("#fake_pass").focus(function(){$(this).hide(); $("#real_pass").show().focus(); }); $("#real_pass").blur(function(){if($(this).val()==""){$(this).hide(); $("#fake_pass").show(); }}); }else{$("#real_pass").attr("onFocus","if(this.value==defaultValue){this.value=''; setAttribute('type', 'password');} else if(this.value==''){this.value=defaultValue; setAttribute('type', 'text');} "); $("#real_pass").attr("onblur","if(this.value==''){this.value=defaultValue; setAttribute('type', 'text');}"); $("#real_pass").attr("type","text"); $("#real_pass").attr("value",i18n.msg("index.password")); }$(".index_acepto span").html(i18n.msg("index.readAndAccept")); $("#conditions").html(i18n.msg("index.termsAndConditions")); $("#recoveryPassButton .index_boton_recuperar .index_texto_recuperar-pass").html(i18n.msg("recover.password")); $("#recoveryUserButton .index_texto_sin-pass").html(i18n.msg("unknown.my.user")); $("#requestUsrLink").html(i18n.msg("index.requestUser")); self._initHandlers(); $("#auth_form").attr("action",$("#auth_form").attr("action").concat(window.location.hash)); }; Inet.prototype._initHandlers=function(){var self=this; $("#userLogin").val(i18n.msg("index.user")); $(document).off("focus","#userLogin").on("focus","#userLogin",function(event){if(this.value==i18n.msg("index.user")){this.value=""; }}); $("#indexBtnAccept").val(i18n.msg("btn.accept")); $(document).off("blur","#userLogin").on("blur","#userLogin",function(event){if(this.value==""){this.value=i18n.msg("index.user"); }}); $(document).off("click","#conditions").on("click","#conditions",function(event){self._renderConditionsView(); }); $(document).off("click",".boton_cancelar").on("click",".boton_cancelar",function(event){$("#recoveryView").modal("hide"); }); $(document).off("show.bs.modal").on("show.bs.modal",".modal",function(event){$(this).appendTo($("body")); }).off("shown.bs.modal").on("shown.bs.modal",".modal.in",function(event){self.renderScrollbar(); if($(window).height()>=590){$(window).resize(self._adjustModalMaxHeightAndPosition).trigger("resize"); }self.setModalsAndBackdropsOrder(); self._setFirstFieldFormFocus(); }).off("hidden.bs.modal").on("hidden.bs.modal",".modal",function(event){self.setModalsAndBackdropsOrder(); $("#"+event.target.id+" .modal-content").html(""); $("#"+event.target.id+" .modal-content .modal-body").css({"max-height":""}); $("#"+event.target.id+" .modal-content").css({"max-height":""}); $("#"+event.target.id).hide(); }); }; Inet.prototype.loadStep=function(action,params,module){var self=this; var url=self.generateUrl(action,{},module); var template=self.renderTemplate(url,params); if(template){$("#recoveryView .modal-content").html(template); $("#recoveryView").modal({backdrop:"static"}); this.renderScrollbar(); this.centerModal(); }this._setFirstFieldFormFocus(); }; Inet.prototype._renderConditionsView=function(){var self=this; var options={i18n:i18n,inet:inet,messageHandler:messageHandler,}; new ConditionsView(options); }; Inet.prototype.setModalsAndBackdropsOrder=function(){var modalZIndex=1040; $(".modal.in").each(function(index){var $modal=$(this); modalZIndex++; $modal.css("zIndex",modalZIndex); $modal.next(".modal-backdrop.in").addClass("hidden").css("zIndex",modalZIndex-1); }); $(".modal.in:visible:last").focus().next(".modal-backdrop.in").removeClass("hidden"); }; Inet.prototype.updateScrollbar=function(){}; Inet.prototype.renderScrollbar=function(divClass){$(".bodyformscroll").mCustomScrollbar({theme:"dark",advanced:{autoScrollOnFocus:false,updateOnContentResize:true}}); }; Inet.prototype.centerModal=function(){this._adjustModalMaxHeightAndPosition(); this.setModalsAndBackdropsOrder(); }; Inet.prototype._adjustModalMaxHeightAndPosition=function(){var self=this; $(".modal").each(function(index,value){if($(this).hasClass("in")===false){$(this).show(); }var contentHeight="630px"; $(".modal-dialog").each(function(element){if($(element).height&&$(element).height>0){contentHeight=$(element).height()+"px"; }}); var headerHeight=$(this).find(".modal-header").outerHeight()||2; var footerHeight=$(this).find(".modal-footer").outerHeight()||2; $(this).find(".modal-content").css({"max-height":contentHeight}); $(this).find(".modal-body").css({"max-height":contentHeight}); $(this).find(".modal-dialog").addClass("modal-dialog-center").css({"margin-top":function(){return -($(this).outerHeight()/2); },"margin-left":function(){return -($(this).outerWidth()/2); }}); if($(this).find(".modal-content").html()==false){$(this).hide(); }inet.updateScrollbar(); }); }; Inet.prototype.parseStringToObject=function(str){strCleaned=""; for(var i=0,len=str.length; i