function getHostName(n){var t=n.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return t!=null&&t.length>2&&typeof t[2]=="string"&&t[2].length>0?t[2]:null}function getDomain(n){var i=getHostName(n),r=i,t;return i!=null&&(t=i.split(".").reverse(),t!=null&&t.length>1&&(r=t[1]+"."+t[0],i.toLowerCase().indexOf(".co.uk")!=-1&&t.length>2&&(r=t[2]+"."+r))),r}function ArchipassportInit(n){ArchipassportDomain=n.ArchipassportDomain;proxyPage=n.proxyPage;AUTH_START_HANDLER=n.AuthStartHandler;FacebookAppId=n.FacebookAppId;ArchipassportLoginPage=ArchipassportDomain+"/account/login.aspx";ArchipassportConfig=n}function initJQueryFunctionsUtility(){jQuery.URLEncode==null&&jQuery.extend({URLEncode:function(n){var r="",t=0,f,i,e,u;for(n=n.toString(),f=/(^[a-zA-Z0-9_.]*)/;t<n.length;)i=f.exec(n.substr(t)),i!=null&&i.length>1&&i[1]!=""?(r+=i[1],t+=i[1].length):(n[t]==" "?r+="+":(e=n.charCodeAt(t),u=e.toString(16),r+="%"+(u.length<2?"0":"")+u.toUpperCase()),t++);return r},URLDecode:function(n){for(var t=n,i;(m=/(%[^%]{2})/.exec(t))!=null&&m.length>1&&m[1]!="";)b=parseInt(m[1].substr(1),16),i=String.fromCharCode(b),t=t.replace(m[1],i);return t}});jQuery.cookie==null&&(jQuery.cookie=function(n,t,i){var u,r,f,e;return arguments.length>1&&(t===null||typeof t!="object")?(i=jQuery.extend({},i),t===null&&(i.expires=-1),typeof i.expires=="number"&&(u=i.expires,r=i.expires=new Date,r.setDate(r.getDate()+u)),document.cookie=[encodeURIComponent(n),"=",i.raw?String(t):encodeURIComponent(String(t)),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")):(i=t||{},e=i.raw?function(n){return n}:decodeURIComponent,(f=new RegExp("(?:^|; )"+encodeURIComponent(n)+"=([^;]*)").exec(document.cookie))?e(f[1]):null)})}function ArchipassportLogout(){$.getJSON("https://www.edilportale.com/removeSession.asp",function(){});AUTH_START_HANDLER=AUTH_START_HANDLER+"?allportals=1&returnurl="+jQuery.URLEncode(location.href.replace("#_=_",""));removeCookies();jQuery.cookie(".menuAlreadyOpened",null);document.location=ArchipassportDomain+"/Services/authservice.svc/json/logout?returnurl="+jQuery.URLEncode(AUTH_START_HANDLER)}function IsAuthenticated(){var n=jQuery.cookie(".IsAuthenticated");return n==null||n=="false"?!1:!0}function ArchipassportSubscription(n){n=ManageReturnUrl(n);proxyPage=proxyPage+"?returnurl="+jQuery.URLEncode(n);document.location=ArchipassportDomain+"/account/create.aspx?returnurl="+jQuery.URLEncode(proxyPage)}function ArchipassportTeamSubscription(n){n=ManageReturnUrl(n);proxyPage=proxyPage+"?returnurl="+jQuery.URLEncode(n);document.location=ArchipassportDomain+"/account/create.aspx?team=1&returnurl="+jQuery.URLEncode(proxyPage)}function FacebookLogin(n){n=ManageReturnUrl(n);FacebookLoginClicked||(removeCookies(),NetworkLoginEventTracker("Facebook"),proxyPage=proxyPage+"?FacebookLogin=1&provider=Facebook&returnurl="+jQuery.URLEncode(n),document.location=proxyPage,FacebookLoginClicked=!0)}function GoogleLogin(){removeCookies();NetworkLoginEventTracker("Google");var n=ManageReturnUrl("");proxyPage=proxyPage+"?FacebookLogin=1&provider=Google&returnurl="+jQuery.URLEncode(n);document.location=proxyPage}function NetworkLoginEventTracker(n){try{typeof _gaq!="undefined"?_gaq.push(["_trackEvent","LOGIN_REGISTRAZIONI","Login","Login_"+n,1]):ga("send","event","LOGIN_REGISTRAZIONI","Login","Login_"+n,1)}catch(t){}}function FirstAccountRegistrationEventTracker(){try{typeof _gaq!="undefined"?_gaq.push(["_trackEvent","LOGIN_REGISTRAZIONI","Registrazioni","Registrazioni_Network",1]):ga("send","event","LOGIN_REGISTRAZIONI","Registrazioni","Registrazioni_Network",1)}catch(n){}}function ArchipassportPasswordRecover(n){n=ManageReturnUrl(n);n=jQuery.URLEncode(n);document.location=ArchipassportDomain+"/account/PasswordRecover.aspx?returnurl="+n}function ArchipassportLogin(n,t,i){var r,u;removeCookies();jQuery("#__VIEWSTATE").remove();jQuery("#__EVENTTARGET").remove();jQuery("#__EVENTARGUMENT").remove();jQuery("#__EVENTVALIDATION").remove();jQuery("#ArchipassportEmail").remove();jQuery("#ArchipassportPassword").remove();i=ManageReturnUrl(i);proxyPageReturnUrl=AUTH_START_HANDLER+"?allportals=1&returnurl="+jQuery.URLEncode(i);r=jQuery("form")[0];r==null&&(jQuery("<form><\/form>").appendTo("body"),r=jQuery("form")[0]);r.onsubmit=null;jQuery(r).attr("onsubmit","");jQuery(r).removeAttr("onsubmit");jQuery(r).unbind("onsubmit");jQuery(r).attr("method","POST");jQuery(r).attr("method","POST");jQuery(r).attr("action",ArchipassportLoginPage+"?returnurl="+jQuery.URLEncode(proxyPageReturnUrl));jQuery(r).removeAttr("onsubmit");jQuery("<input type='text' name='ArchipassportEmail' id='ArchipassportEmail' value='"+n+"' style='display:none' />").appendTo(r);jQuery("<input type='text' name='ArchipassportPassword' id='ArchipassportPassword' value='"+t+"' style='display:none' />").appendTo(r);u=/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;n&&u.test(n)&&t&&t.length>=6&&NetworkLoginEventTracker("Network");jQuery(r).submit()}function ArchipassportRegister(n,t,i,r,u){var e,f;jQuery("#__VIEWSTATE").remove();jQuery("#__EVENTTARGET").remove();jQuery("#__EVENTARGUMENT").remove();jQuery("#__EVENTVALIDATION").remove();jQuery("#ArchipassportEmail").remove();jQuery("#ArchipassportPassword").remove();jQuery("#ArchipassportName").remove();jQuery("#ArchipassportLastName").remove();u=ManageReturnUrl(u);proxyPageReturnUrl=IsMobileBrowser.any()?ArchipassportDomain+"/account/m_create.aspx?returnurl="+jQuery.URLEncode(location.href.replace("#_=_","")):ArchipassportDomain+"/account/create.aspx?returnurl="+jQuery.URLEncode(location.href.replace("#_=_",""));e=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;e.test(i)||(i="");NetworkLoginEventTracker("Network");f=jQuery("form")[0];f==null&&(jQuery("<form><\/form>").appendTo("body"),f=jQuery("form")[0]);jQuery(f).empty();jQuery(f).attr("method","POST");jQuery(f).attr("action",proxyPageReturnUrl);jQuery(f).removeAttr("onsubmit");jQuery("<input type='text' name='ArchipassportEmail' id='ArchipassportEmail' value='"+i+"' style='display:none' />").appendTo(f);jQuery("<input type='text' name='ArchipassportPassword' id='ArchipassportPassword' value='"+r+"' style='display:none' />").appendTo(f);jQuery("<input type='text' name='ArchipassportName' id='ArchipassportName' value='"+n+"' style='display:none' />").appendTo(f);jQuery("<input type='text' name='ArchipassportLastName' id='ArchipassportLastName' value='"+t+"' style='display:none' />").appendTo(f);jQuery(f).submit()}function NetworkBarLoginFocus(){jQuery("#ArchipassportLoginEmail").val("");jQuery("#ArchipassportLoginPassword").val("");jQuery("#ArchipassportLoginEmail").focus()}function AuthCheck(n){$.getJSON(ArchipassportDomain+"/scripts/authentication/VerifyUserAuthentication.ashx?callback=?",function(t){t==""?ShowLoginDialog():(jQuery.cookie(".ArchipassportToken")==null&&jQuery.cookie(".ArchipassportToken",t),jQuery.cookie(".IsAuthenticated")==null&&jQuery.cookie(".IsAuthenticated","true"),n!=null&&n!=""&&(location.href=n))})}function VerifyAuthentication(n,t){jQuery.getJSON(ArchipassportDomain+"/scripts/authentication/VerifyUserAuthentication.ashx?callback=?",function(i){i==""?typeof t=="function"&&t():(jQuery.cookie(".ArchipassportToken")==null&&jQuery.cookie(".ArchipassportToken",i),jQuery.cookie(".IsAuthenticated")==null&&jQuery.cookie(".IsAuthenticated","true"),typeof n=="function"&&n())})}function CenterLoginDialog(n,t){var i,r;t||(t=".modalLogin");i=jQuery(window).width();r=jQuery(window).height();jQuery(".blackBg").css({width:i,height:r});jQuery(".blackBg .inset").css({width:i,height:r});var u=jQuery(t).parent().height(),f=jQuery(t).height(),e=(u-f)/2;jQuery(t).css("margin-top",e);var o=jQuery(t).parent().width(),s=jQuery(t).width(),h=(o-s)/2;jQuery(t).css("margin-left",h)}function ShowLoginDialog(n){if(typeof loginDialog!="undefined")loginDialog.show(n),n&&(login_ReturnUrl=n);else if(typeof n=="undefined"?n=location.href.replace("#_=_",""):login_ReturnUrl=n,IsMobileBrowser.any()){var t=AUTH_START_HANDLER+"?allportals=1&returnurl="+jQuery.URLEncode(n);location.href=ArchipassportLoginPage+"?returnurl="+jQuery.URLEncode(t)}else jQuery("._AuthBalloon").fadeIn("slow"),CenterLoginDialog()}function ShowRegisterDialog(n){if(typeof loginDialog!="undefined")loginDialog.show(n,2);else if(IsMobileBrowser.any()){var t=ArchipassportDomain+"/account/m_create.aspx?returnurl="+jQuery.URLEncode(location.href.replace("#_=_",""));location.href=ArchipassportLoginPage+"?returnurl="+jQuery.URLEncode(t)}else jQuery("._RegisterBalloon").fadeIn("slow"),CenterLoginDialog(null,"._modalReg")}function printNetworkMenu(){typeof jQuery=="undefined"?document.write('<script type="text/javascript" src="'+ArchipassportDomain+'/scripts/jquery-1.4.4.min.js"><\/script>'):printNetworkBar()}function printNetworkMenuAsync(n){jQuery(document).ready(function(){printNetworkBarAsync(n)})}function JQueryOnLoad(){printNetworkBar()}function printNetworkBarAsync(n,t){jQuery(n).hide();var i=GetMenuBarScriptName(!0);jQuery.getJSON(i,function(i){jQuery(n).html(i);t||jQuery(n).show()})}function printNetworkBar(){var n=GetMenuBarScriptName(!1);document.write("<script src='"+n+"' type = 'text/javascript'><\/script>")}function GetMenuBarScriptName(n){var t,i,u;initJQueryFunctionsUtility();t=jQuery.cookie(".ArchipassportToken");i=jQuery.cookie(".ArchipassportTeamToken");i||(i="");var r=ArchipassportConfig.uid,e=ArchipassportConfig.portale,o=ArchipassportConfig.team,f=ArchipassportConfig.defaultculture;return(r==""||r==null)&&t!=null&&t!=""&&(r=t),f==null&&(f=""),u=ArchipassportDomain+"/scripts/RenderNetworkMenu.ashx?peopleUid="+r+"&ArchipassportTeamToken="+i+"&portaleId="+e+"&teamId="+o+"&defaultculture="+f+"&rnd="+(new Date).valueOf(),n&&(u=u+"&callback=?"),u}function activateUser(n){jQuery.ajax({type:"POST",contentType:"application/json",dataType:"html",url:"/LoversEdit/EditProfiles.aspx/activateUser",data:JSON.stringify({IdPeople:n}),context:this,success:function(){ArchipassportLogout()}})}function getParameterByName(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+n+"=([^&#]*)",r=new RegExp(i),t=r.exec(window.location.href);return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))}function ManageReturnUrl(n){var t;return t=login_ReturnUrl?login_ReturnUrl:getParameterByName("loginreturnurl"),t!=""?t:n==null||n==""?location.href.replace("#_=_",""):n}function removeCookies(){var t=document.domain.split("."),n=t[1]+"."+t[2];jQuery.cookie("RequestName",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestSurname",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestAddress",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestCivico",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestZip",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestNation",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestProvince",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestCity",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestEmail",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestTel",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestJob",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestOfficeName",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestCompany",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestWorkAs",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestMainActivity",null,{expires:-1,path:"/",domain:n});jQuery.cookie("VatNumber",null,{expires:-1,path:"/",domain:n});jQuery.cookie("TaxCode",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestName",null,{expires:-1,path:"/"});jQuery.cookie("RequestSurname",null,{expires:-1,path:"/"});jQuery.cookie("RequestAddress",null,{expires:-1,path:"/"});jQuery.cookie("RequestCivico",null,{expires:-1,path:"/"});jQuery.cookie("RequestZip",null,{expires:-1,path:"/"});jQuery.cookie("RequestNation",null,{expires:-1,path:"/"});jQuery.cookie("RequestProvince",null,{expires:-1,path:"/"});jQuery.cookie("RequestCity",null,{expires:-1,path:"/"});jQuery.cookie("RequestEmail",null,{expires:-1,path:"/"});jQuery.cookie("RequestTel",null,{expires:-1,path:"/"});jQuery.cookie("RequestJob",null,{expires:-1,path:"/"});jQuery.cookie("RequestOfficeName",null,{expires:-1,path:"/"});jQuery.cookie("RequestCompany",null,{expires:-1,path:"/"});jQuery.cookie("RequestWorkAs",null,{expires:-1,path:"/"});jQuery.cookie("RequestMainActivity",null,{expires:-1,path:"/"});jQuery.cookie("VatNumber",null,{expires:-1,path:"/"});jQuery.cookie("TaxCode",null,{expires:-1,path:"/"})}var resultType={Success:"Success",Confirm:"Confirm",Info:"Info",Alert:"Alert",Error:"Error"},portalType={Archipassport:0,Edilportale:1,Archiportale:2,BlocchiCad:3,Archiproducts:4,Archilovers:5,Archiadmin:6,None:7,Bim:8,Mobile:9,App:10},authenticationAPI={options:{apiHost:"http://test.archipassport.com",culture:"it",countryCode:"IT",portal:portalType.Edilportale,archipassportDomain:typeof ArchipassportDomain!="undefined"?ArchipassportDomain:"",proxyPage:typeof proxyPage!="undefined"?proxyPage:"",authStartHandler:typeof AUTH_START_HANDLER!="undefined"?AUTH_START_HANDLER:"",facebookAppId:typeof FacebookAppId!="undefined"?FacebookAppId:"",archipassportConfig:typeof ArchipassportConfig!="undefined"?ArchipassportConfig:"",loginReturnUrl:"",injectQueryUiCss:!0},init:function(n){var t=this.getJquery();$.extend(this.options,n);this.options.portal=this.getPortal()},getPortal:function(){return typeof ArchipassportConfig!="undefined"?ArchipassportConfig.portale?ArchipassportConfig.portale:this.options.portal:this.options.portal},getApiUrl:function(n,t){var i=this.options.apiHost,r={},u;return r.culture=this.options.culture,r.countryCode=this.options.countryCode,r.portal=this.options.portal,u=$.param(r),i=n.indexOf("?")!=-1?i+n+"&"+u:i+n+"?"+u,typeof t!="undefined"&&(i=i+"&"+$.param(t)),i},authenticate:function(n,t,i,r){var u={user:n,password:t,returnurl:i},f=this.getApiUrl("/api/login/authenticate",u),o=this,e=this.getJquery();e.ajax({url:f,jsonp:"callback",dataType:"jsonp",success:function(n){typeof r=="function"&&r(n)}})},associateRequestToUser:function(n,t,i,r){var u={userUid:n,requestUid:t,isMultiRequest:i},f=this.getApiUrl("/login/associaterequesttouser",u),o=this,e=this.getJquery();e.ajax({url:f,jsonp:"callback",dataType:"jsonp"}).done(function(n){typeof r=="function"&&r(n)})},logout:function(n){var u=this.getJquery(),r=typeof n!="undefined"&&n?n:this.getDomainWithProtocol(),t,i;u.getJSON("https://www.edilportale.com/removeSession.asp",function(){});t=this.options.authStartHandler+"?allportals=1&returnurl="+this.URLEncode(r.replace("#_=_",""));t=t+"?allportals=1&returnurl="+this.URLEncode(r.replace("#_=_",""));this.removeCookies();jQuery.cookie("TempCartToken",null,{path:"/",domain:document.location.host});jQuery.cookie("TempCartToken",null,{expires:-1,path:"/"});i=this.options.archipassportDomain+"/Services/authservice.svc/json/logout?returnurl="+this.URLEncode(t);typeof _advLogApi!="undefined"&&_advLogApi!==null&&typeof _advLogApi=="object"?_advLogApi.removeUidCookie(function(n){document.location=n},i):document.location=i},getDomainWithProtocol:function(){return document.location.protocol+"//"+document.location.host},eventSubscribe:function(n,t,i,r,u,f,e,o,s,h,c){var a=this.getApiUrl("/api/subscribe/eventsubscription"),y=this,v=this.getJquery(),l={};l.UserId=n;l.Name=t;l.LastName=i;l.Email=r;l.Password=u;l.PortalOriginUrl=o;l.FacebookId=s;l.IPaddress=f;l.Privacy=!0;v.ajax({url:a,method:"POST",dataType:"json",suppressErrors:!0,contentType:"application/json; charset=utf-8",processData:!1,data:JSON.stringify(l),cache:!1}).done(function(n){typeof h=="function"&&h(n)}).fail(function(n){typeof c=="function"&&c(n)})},basicSubscribe:function(n,t,i,r,u,f,e,o,s,h,c,l){var v=this.getApiUrl("/api/subscribe/basicsubscription"),p=this,y=this.getJquery(),a={};a.UserId=n;a.Name=t;a.LastName=i;a.Email=r;a.Password=u;a.PortalOriginUrl=o;a.FacebookId=s;a.IPaddress=f;a.recaptchaResponse=grecaptcha.getResponse();a.privacy=h;y.ajax({url:v,method:"POST",dataType:"json",suppressErrors:!0,contentType:"application/json; charset=utf-8",processData:!1,data:JSON.stringify(a),cache:!1}).done(function(n){typeof c=="function"&&c(n)}).fail(function(n){typeof l=="function"&&l(n)})},validateUser:function(n,t,i,r,u,f,e,o){var h=this.getApiUrl("/api/subscribe/validateuser"),l=this,c=this.getJquery(),s={};s.Name=n;s.LastName=t;s.Email=i;s.Password=r;s.privacy=u;s.recaptchaResponse=f;c.ajax({url:h,method:"POST",dataType:"json",suppressErrors:!0,contentType:"application/json; charset=utf-8",processData:!1,data:JSON.stringify(s),cache:!1}).done(function(n){typeof e=="function"&&e(n)}).fail(function(n){typeof o=="function"&&o(n)})},validateAdditionalUserData:function(n,t,i){var r=this.getApiUrl("/api/subscribe/validateadditionaluserdata"),f=this,u=this.getJquery();u.ajax({url:r,method:"POST",dataType:"json",suppressErrors:!0,contentType:"application/json; charset=utf-8",processData:!1,data:JSON.stringify(n),cache:!1}).done(function(n){typeof t=="function"&&t(n)}).fail(function(n){typeof i=="function"&&i(n)})},fullSubscribe:function(n,t,i){var r=this.getApiUrl("/api/subscribe/fullsubscription"),f=this,u=this.getJquery();u.ajax({url:r,method:"POST",dataType:"json",suppressErrors:!0,contentType:"application/json; charset=utf-8",processData:!1,data:JSON.stringify(n),cache:!1}).done(function(n){typeof t=="function"&&t(n)}).fail(function(n){typeof i=="function"&&i(n)})},verifyAuthentication:function(n,t){var i=this.getApiUrl("/scripts/authentication/VerifyUserAuthentication.ashx");i+="&callback=?";typeof isAuthenticated!="undefined"?isAuthenticated?n():t():jQuery.getJSON(i,function(i){i==""?typeof t=="function"&&t():(jQuery.cookie(".ArchipassportToken")==null&&jQuery.cookie(".ArchipassportToken",i,{path:"/",domain:getDomain(document.location.host)}),jQuery.cookie(".IsAuthenticated")==null&&jQuery.cookie(".IsAuthenticated","true",{path:"/",domain:getDomain(document.location.host)}),typeof n=="function"&&n())})},getLoginDialog:function(n,t){var i=this.getApiUrl("/login/getlogindialog",{dialogType:n}),u=this,r=this.getJquery();r.ajax({url:i,jsonp:"callback",dataType:"jsonp",success:function(n){typeof t=="function"&&t(n)}})},removeCookies:function(){var t=document.domain.split("."),n=t[1]+"."+t[2];jQuery.cookie("RequestName",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestSurname",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestAddress",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestCivico",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestZip",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestNation",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestProvince",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestCity",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestEmail",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestTel",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestJob",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestOfficeName",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestCompany",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestWorkAs",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestMainActivity",null,{expires:-1,path:"/",domain:n});jQuery.cookie("VatNumber",null,{expires:-1,path:"/",domain:n});jQuery.cookie("TaxCode",null,{expires:-1,path:"/",domain:n});jQuery.cookie(".menuAlreadyOpened",null,{expires:-1,path:"/",domain:n});jQuery.cookie("RequestName",null,{expires:-1,path:"/"});jQuery.cookie("RequestSurname",null,{expires:-1,path:"/"});jQuery.cookie("RequestAddress",null,{expires:-1,path:"/"});jQuery.cookie("RequestCivico",null,{expires:-1,path:"/"});jQuery.cookie("RequestZip",null,{expires:-1,path:"/"});jQuery.cookie("RequestNation",null,{expires:-1,path:"/"});jQuery.cookie("RequestProvince",null,{expires:-1,path:"/"});jQuery.cookie("RequestCity",null,{expires:-1,path:"/"});jQuery.cookie("RequestEmail",null,{expires:-1,path:"/"});jQuery.cookie("RequestTel",null,{expires:-1,path:"/"});jQuery.cookie("RequestJob",null,{expires:-1,path:"/"});jQuery.cookie("RequestOfficeName",null,{expires:-1,path:"/"});jQuery.cookie("RequestCompany",null,{expires:-1,path:"/"});jQuery.cookie("RequestWorkAs",null,{expires:-1,path:"/"});jQuery.cookie("RequestMainActivity",null,{expires:-1,path:"/"});jQuery.cookie("VatNumber",null,{expires:-1,path:"/"});jQuery.cookie("TaxCode",null,{expires:-1,path:"/"});jQuery.cookie(".menuAlreadyOpened",null,{expires:-1,path:"/"})},getJquery:function(){return typeof $j!="undefined"?$j:$},loadCssAfter:function(n,t){var i=this,r=this.getJquery();return $("head").append($("<link/>").attr({rel:"stylesheet",type:"text/css",href:n,media:t||"all"})),i},URLEncode:function(n){var r="",t=0,f,i,e,u;for(n=n.toString(),f=/(^[a-zA-Z0-9_.]*)/;t<n.length;)i=f.exec(n.substr(t)),i!=null&&i.length>1&&i[1]!=""?(r+=i[1],t+=i[1].length):(n[t]==" "?r+="+":(e=n.charCodeAt(t),u=e.toString(16),r+="%"+(u.length<2?"0":"")+u.toUpperCase()),t++);return r},loadCssAjax:function(n,t){var i=this,r=this.getJquery();$.ajax({url:n,type:"GET",success:function(n){$('<style type="text/css">'+n+"<\/style>").appendTo("head");t&&t()}})}},loginDialog,ArchipassportLoginPage,ArchipassportDomain,proxyPage,AUTH_START_HANDLER,FacebookAppId,ArchipassportConfig,login_ReturnUrl,IsMobileBrowser,FacebookLoginClicked;(function(n){function h(n,t,i,r,u,f){var s,l;n=String(n);for(var o=0,h=0,a=n.length,c="",e=0;h<a;){for(s=n.charCodeAt(h),s=s<256?i[s]:-1,o=(o<<u)+s,e+=u;e>=f;)e-=f,l=o>>e,c+=r.charAt(l),o^=l<<e;++h}return!t&&e>0&&(c+=r.charAt(o<<f-e)),c}for(var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="",e=[256],o=[256],i=0,s={encode:function(n){return n.replace(/[\u0080-\u07ff]/g,function(n){var t=n.charCodeAt(0);return String.fromCharCode(192|t>>6,128|t&63)}).replace(/[\u0800-\uffff]/g,function(n){var t=n.charCodeAt(0);return String.fromCharCode(224|t>>12,128|t>>6&63,128|t&63)})},decode:function(n){return n.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(n){var t=(n.charCodeAt(0)&15)<<12|(n.charCodeAt(1)&63)<<6|n.charCodeAt(2)&63;return String.fromCharCode(t)}).replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(n){var t=(n.charCodeAt(0)&31)<<6|n.charCodeAt(1)&63;return String.fromCharCode(t)})}},r,t;i<256;)r=String.fromCharCode(i),f+=r,o[i]=i,e[i]=u.indexOf(r),++i;t=n.base64=function(n,i,r){return i?t[n](i,r):n?null:this};t.btoa=t.encode=function(n,i){return n=t.raw===!1||t.utf8encode||i?s.encode(n):n,n=h(n,!1,o,u,8,6),n+"====".slice(n.length%4||4)};t.atob=t.decode=function(n,i){n=String(n).split("=");var r=n.length;do--r,n[r]=h(n[r],!0,e,f,6,8);while(r>0);return n=n.join(""),t.raw===!1||t.utf8decode||i?s.decode(n):n}})(jQuery);loginDialog={wizardStep:0,showing:!1,options:{returnUrl:window.location.href,facebookData:null,userId:0},init:function(n){var t=this.getJquery();t.extend(this.options,n);this.bindEvents()},userPlaceInfo:{locality:"",province:"",region:"",country:"",latitude:"",longitude:"",zipcode:"",language:"",shortCountry:"",shortProvince:"",regionLatitude:"",regionLongitude:"",localityType:"",placeId:"",geoNameId:""},emptyUserPlaceInfo:function(){var n=this.getJquery();n.each(this.userPlaceInfo,function(n){loginDialog.userPlaceInfo[n]=""})},emptyStep2:function(){this.emptyUserPlaceInfo();this.elements.userCity().val("");this.elements.userJob().val("");this.elements.userProvince().val("");this.elements.userNation().val("")},companyPlaceInfo:{locality:"",province:"",region:"",country:"",latitude:"",longitude:"",zipcode:"",language:"",shortCountry:"",shortProvince:"",regionLatitude:"",regionLongitude:"",localityType:"",placeId:"",wayLongitude:"",wayLatitude:"",zipCode:"",route:"",geoNameId:""},elements:{dialog:function(){var n=loginDialog.getJquery();return n("._login-dialog")},panelLogin:function(){return this.dialog().find(".panel-login")},steps:function(){return this.dialog().find(".step")},footer:function(){return this.dialog().find("._footer")},accountQuestion:function(){return this.dialog().find("._account-question")},confirmMessage:function(){return this.dialog().find("._confirm-message")},loginButton:function(){return this.dialog().find("._login-button")},signInFlipButton:function(){return this.dialog().find("._signin-flip-button")},subscribeFlipButton:function(){return this.dialog().find("._subscribe-flip-button")},closeButton:function(){return this.dialog().find("._close-button")},contentStep:function(){return this.dialog().find(".content-step")},subscribeButton:function(){return this.dialog().find("._subscribe-button")},subscribeContinueButton:function(){return this.dialog().find("._subscribe-continue-button")},subscribeConfirmButton:function(){return this.dialog().find("._subscribe-confirm-button")},companyGeoInfoDropDown:function(){return this.dialog().find("._company-geoinfo-dropdown")},userGeoInfoDropDown:function(){return this.dialog().find("._user-geoinfo-dropdown")},userNation:function(){return this.dialog().find("._user-nation")},userCity:function(){return this.dialog().find("._user-city")},userProvince:function(){return this.dialog().find("._user-province")},userJob:function(){return this.dialog().find("._user-job")},userName:function(){return this.dialog().find("._name")},userSurname:function(){return this.dialog().find("._surname")},userEmail:function(){return this.dialog().find("._email")},userIPAddress:function(){return this.dialog().find("._userIPAddress")},companyCity:function(){return this.dialog().find("._company-city")},companyProvince:function(){return this.dialog().find("._company-province")},companyAddress:function(){return this.dialog().find("._company-address")},companyNation:function(){return this.dialog().find("._company-nation")},password:function(){return this.dialog().find("._login-password")},subscriptionPassword:function(){return this.dialog().find("._password")},subscriptionPrivacy:function(){return this.dialog().find("._privacy")},userFullName:function(){return this.dialog().find("._user-full-name")},nextStepsFooter:function(){return this.dialog().find("._next-steps-footer")},jumpStepButton:function(){return this.dialog().find("._jump-step-button")},allDropDown:function(){return this.dialog().find("._dropdown")}},modules:{login:{email:function(){return loginDialog.elements.dialog().find("._login-mail").val()},password:function(){return loginDialog.elements.password().val()}},subscription:{name:function(){return loginDialog.elements.userName().val()},surname:function(){return loginDialog.elements.userSurname().val()},email:function(){return loginDialog.elements.userEmail().val().toLowerCase()},password:function(){return loginDialog.elements.subscriptionPassword().val()},privacy:function(){return loginDialog.elements.subscriptionPrivacy().prop("checked")},ipaddress:function(){return loginDialog.elements.userIPAddress().val()},userCity:function(){return loginDialog.userPlaceInfo.locality||loginDialog.elements.userCity().val()},userNation:function(){return loginDialog.userPlaceInfo.shortCountry?0:loginDialog.elements.userNation().val()},userProvince:function(){var n=loginDialog.userPlaceInfo.shortProvince;return!n&&loginDialog.elements.userGeoInfoDropDown().is(":visible")&&(n=loginDialog.elements.userProvince().val()),n},userJob:function(){return loginDialog.elements.userJob().val()},companyName:function(){return loginDialog.elements.dialog().find("._company-name").val()},companyType:function(){return loginDialog.elements.dialog().find("._company-type").val()},companyCity:function(){return loginDialog.companyPlaceInfo.locality||loginDialog.elements.companyCity().val()},companyNation:function(){return loginDialog.companyPlaceInfo.shortCountry?0:loginDialog.elements.companyNation().val()},companyProvince:function(){var n=loginDialog.companyPlaceInfo.shortProvince;return!n&&loginDialog.elements.companyGeoInfoDropDown().is(":visible")&&(n=loginDialog.elements.companyProvince().val()),n},companyAddress:function(){return loginDialog.elements.companyAddress().val()}}},bindEvents:function(){var n=this;this.loginButtonEvent();this.subscribeButtonEvent();this.closeButtonEvent();this.flipButtonEvent();this.googleAutocompleteInit();this.nationProvinceDropdownEvent();this.changeDropDownTextColor();this.continueSubscriptionButtonEvent();this.confirmSubscriptionButtonEvent();this.disableTabKey();this.enableReturnKeyForSubmit();this.jumpStepEvent()},loginButtonEvent:function(){var n=this.getJquery();this.elements.loginButton().click(n.proxy(this.submitLogin,this))},submitLogin:function(){var n=this;n.hideError();n.authenticate(n.modules.login.email(),n.modules.login.password(),n.getReturnUrl(),function(t){t.ResultType==resultType.Success&&(n.networkLoginEventTracker("Network"),n.options.setSourceRequest!==undefined&&(document.cookie="LoginSourceRequest="+n.options.setSourceRequest),n.joinCart(t.UserToken),n.hideError(),n.redirect(t.AuthStartPage));t.ResultType==resultType.Error&&n.showError(t.Message)})},joinCart:function(n){var i=this.getJquery(),t;typeof shoppingCartAPI!="undefined"&&shoppingCartAPI.joinCartToUser&&(t=i.cookie("TempCartToken"),t&&shoppingCartAPI.joinCartToUser(n,t))},subscribeButtonEvent:function(){var n=this;this.elements.subscribeButton().click(function(){var t=n.modules.subscription;n.removeHighlights();n.validateUser(t.name(),t.surname(),t.email(),t.password(),t.privacy(),grecaptcha.getResponse(),function(i){i.ResultType==resultType.Success||n.options.userId!=0?loginDialog.basicSubscribe(n.options.userId,t.name(),t.surname(),t.email(),t.password(),t.ipaddress(),n.getPortal(),n.getLocation(),t.privacy(),function(t){if(t!=0){n.nextStep();var i="Network";if(n.options.facebookData!==undefined&&n.options.facebookData!==""&&n.options.facebookData!==null)switch(n.options.facebookData.provider){case"facebook":i="Facebook";break;case"google":i="Google"}n.firstAccountRegistrationEventTracker(i);n.options.userId=t;n.hideError();n.setFullName(n.modules.subscription.name(),n.modules.subscription.surname())}},function(t){n.showBadRequestResponseError(t)}):(i.ResultType==resultType.Error&&loginDialog.showError(i.Message),i.ResultType==resultType.Confirm&&loginDialog.showConfirm(i.Message))},function(t){n.showBadRequestResponseError(t)})})},continueSubscriptionButtonEvent:function(){var n=this,t=this.getJquery();this.elements.subscribeContinueButton().click(function(){n.removeHighlights();authenticationAPI.validateAdditionalUserData(n.getAccountData(),function(){n.hideError();n.accountRegistrationStepEventTracker(2);t.proxy(n.sendFullSubscription(n.getAccountData(),{}),n)},function(t){n.showBadRequestResponseError(t)})})},confirmSubscriptionButtonEvent:function(){var n=this,t=this.getJquery();this.elements.subscribeConfirmButton().click(function(){var u=n.modules.subscription;n.removeHighlights();var i=n.getAccountData(),r=n.getTeamData();t.proxy(n.sendFullSubscription(i,r),this)})},jumpStepEvent:function(){var n=this,t=this.getJquery();this.elements.jumpStepButton().click(function(){if(n.wizardStep==2){var i=n.getAccountData();i.City="";i.ShortCountry="";i.Nation="";i.Province="";i.ShortProvince="";i.GeoNameId="";i.Latitude="";i.Longitude="";t.proxy(n.sendFullSubscription(i,{}),n)}else n.emptyStep2(),n.nextStep()})},nationProvinceDropdownEvent:function(){var n=this;this.elements.userNation().change(function(t){n.showProvinceIfItaly(t,"._user-province")});this.elements.companyNation().change(function(t){n.showProvinceIfItaly(t,"._company-province")})},changeDropDownTextColor:function(){var n=this.getJquery();this.elements.allDropDown().change(function(){n(this).val()==""?n(this).closest(".select.select-default").addClass("p-holder"):n(this).closest(".select.select-default").removeClass("p-holder")})},disableTabKey:function(){var n=function(n){if(n.keyCode==9)return n.preventDefault(),!1};this.elements.password().on("keydown",n);this.elements.subscriptionPassword().on("keydown",n);this.elements.userJob().on("keydown",n);this.elements.companyAddress().on("keydown",n);this.elements.userCity().on("keydown",n);this.elements.userNation().on("keydown",n);this.elements.userProvince().on("keydown",n)},enableReturnKeyForSubmit:function(){var n=this,t=this.getJquery();t("._login-module ._form-input").on("keydown",function(t){if(t.keyCode==13)return n.submitLogin(),t.preventDefault(),!1})},setFullName:function(n,t){this.elements.userFullName().html(n+" "+t)},flipButtonEvent:function(){var n=this;this.elements.signInFlipButton().click(function(){n.wizardStep=0;n.elements.panelLogin().removeClass("signup")});this.elements.subscribeFlipButton().click(function(){n.wizardStep=1;n.elements.panelLogin().addClass("signup")})},closeButtonEvent:function(){var n=this;this.elements.closeButton().click(function(){n.hide()})},userCityAutocompleteInit:function(){var n=this,t=this.getJquery();$("#login-user-city").geoinit({appendTo:"._panel-lg-body",placeChanged:function(i){i&&(n.userPlaceInfo.geoNameId=i.Id,n.userPlaceInfo.locality=i.LocalityName,n.userPlaceInfo.latitude=i.Latitude,n.userPlaceInfo.longitude=i.Longitude,n.userPlaceInfo.shortCountry=i.CountryCode,n.userPlaceInfo.shortProvince=i.ProvinceCode);n.userPlaceInfo.latitude||t("#login-user-city").val()==""?n.elements.userGeoInfoDropDown().hide():n.elements.userGeoInfoDropDown().show()}})},companyCityAutocompleteInit:function(){var n=this,t=this.getJquery();$("#login-company-city").geoinit({appendTo:"._panel-lg-body",placeChanged:function(i){i&&(n.companyPlaceInfo.geoNameId=i.Id,n.companyPlaceInfo.locality=i.LocalityName,n.companyPlaceInfo.latitude=i.Latitude,n.companyPlaceInfo.longitude=i.Longitude,n.companyPlaceInfo.shortCountry=i.CountryCode,n.companyPlaceInfo.shortProvince=i.ProvinceCode);n.companyPlaceInfo.latitude||t("#login-company-city").val()==""?n.elements.companyGeoInfoDropDown().hide():n.elements.companyGeoInfoDropDown().show()}})},companyAddressAutocompleteInit:function(){var n=this;autocomplete_init("login-company-address",function(t){n.companyPlaceInfo.wayLongitude=t.longitude;n.companyPlaceInfo.wayLatitude=t.latitude;n.companyPlaceInfo.zipCode=t.postal_code;n.companyPlaceInfo.route=t.route;t.street_number&&(n.companyPlaceInfo.route+=" "+t.street_number);n.companyPlaceInfo.route||(n.companyPlaceInfo.route=n.modules.subscription.companyAddress())},{appendTo:"._panel-lg-body",excludeStreets:!1,excludePOI:!0,excludeLocality:!0,allowDirtyData:!0,forceLastFocused:!0,concatElementId:"login-company-city",autoCompleteFilter:"geocode",customAddress:function(n){return n.terms[0].value}})},getAccountData:function(){var t=this.modules.subscription,i=this.userPlaceInfo,n={};return n.IdPeople=this.options.userId,n.Name=t.name(),n.Surname=t.surname(),n.Email=t.email(),n.EmailConfirm=t.email(),n.Password=t.password(),n.Job=t.userJob(),n.PrivacyCheck=!0,n.PublicProfileCheck=!0,n.Rank=5,n.City=t.userCity(),n.ShortCountry=i.shortCountry,n.Nation=t.userNation(),n.Province=t.userProvince(),n.ShortProvince=t.userProvince(),n.GeoNameId=i.geoNameId,n.Latitude=i.latitude,n.Longitude=i.longitude,n},getTeamData:function(){var i=this.modules.subscription,t=this.companyPlaceInfo,n={};return n.IdTeam=0,n.Name=i.companyName(),n.IdType=i.companyType(),n.GeoNameId=t.geoNameId,n.City=i.companyCity(),n.Nation=i.companyNation(),n.Province=i.companyProvince(),n.ShortProvince=i.companyProvince(),n.Latitude=t.latitude,n.Longitude=t.longitude,n.AddressLatitude=t.wayLatitude,n.AddressLongitude=t.wayLongitude,t.route||(t.route=i.companyAddress()),n.Address=i.companyAddress(),teamroute=undefined,n.Zip=t.zipcode,n.ShortCountry=t.shortCountry,n},mobileApplication:/SM\-G900P\sBuild\/LRX21T/.test(navigator.userAgent)&&!window.MSStream,freezeVp:function(n){n.preventDefault()},hideBody:function(n){n===!0?$(".homeMegaContainer").hide():$(".homeMegaContainer").show()},show:function(n,t,i){var r=this,u;u=typeof t=="undefined"?1:t;this.mobileApplication&&this.hideBody(!0);this.options.setSourceRequest=i;r.showing||(r.showing=!0,this.wizardStep=u==1?0:1,this.setReturnUrl(n),this.elements.dialog().remove(),this.loadCss(authenticationAPI.options.injectQueryUiCss),this.getLoginDialog(u,function(){r.showing=!1;var n=r.options.facebookData;n&&(n.email!=""&&r.firstAccountRegistrationEventTracker("Facebook"),r.elements.userName().val(n.name),r.elements.userSurname().val(n.surname),r.elements.userEmail().val(n.email))}))},hide:function(){var n=this;this.mobileApplication&&this.hideBody(!1);this.elements.dialog().fadeOut(500,function(){n.elements.dialog().remove();n.showing=!1})},loadCss:function(n){var t=authenticationAPI.options.apiHost+"/Styles/loginNetwork.css?v="+Math.random(),i=authenticationAPI.options.apiHost+"/Styles/login-smoothness.min.css?v="+Math.random();n==!0&&authenticationAPI.loadCssAfter(i);authenticationAPI.loadCssAfter(t)},hideFooter:function(){this.elements.footer().hide()},setReturnUrl:function(n){var t=this.getJquery();typeof n!="undefined"?this.options.returnUrl=t.trim(n)!=""?n:this.getLocation():(n=this.getParameterByName("loginreturnurl"),this.options.returnUrl=n?n:this.getLocation())},getReturnUrl:function(){return this.options.returnUrl},getPortal:function(){return authenticationAPI.options.portal},getLocation:function(){return window.location.href},redirect:function(n){window.location.href=n},authenticate:function(n,t,i,r){var u=this;authenticationAPI.removeCookies();authenticationAPI.authenticate(n,t,i,function(n){typeof r=="function"&&r(n)})},getFacebookId:function(){return this.options.facebookData?this.options.facebookData.id:""},basicSubscribe:function(n,t,i,r,u,f,e,o,s,h,c){var l=this,a=l.getFacebookId();authenticationAPI.basicSubscribe(n,t,i,r,u,f,e,o,a,s,function(n){typeof h=="function"&&h(n)},function(n){typeof c=="function"&&c(n)})},sendFullSubscription:function(n,t){var r=this,i={};i.AccountData=n;i.TeamData=t;i.TeamRegistration=!0;i.Captchacode="";i.FacebookId=r.getFacebookId();i.ReturnUrl=this.getReturnUrl();i.PortalOriginUrl=this.getLocation();this.fullSubscribe(i,function(n){loginDialog.removeHighlights();loginDialog.hideError();n.ErrorMessage==""&&n.Redirect!=""&&(loginDialog.modules.subscription.companyName()!=""&&r.fullAccountRegistrationEventTracker(),$.cookie("UserSubscribed",1,{expires:2,path:"/"}),loginDialog.redirect(n.Redirect))},function(n){loginDialog.showBadRequestResponseError(n)})},fullSubscribe:function(n,t,i){var r=this;authenticationAPI.fullSubscribe(n,function(n){typeof t=="function"&&t(n)},function(n){typeof i=="function"&&i(n)})},getLoginDialog:function(n,t){var i=this,r=this.getJquery();authenticationAPI.getLoginDialog(n,function(u){r("BODY").append(u.html);i.bindEvents();n==2&&$(".g-recaptcha").show();typeof t=="function"&&t(u)})},validateUser:function(n,t,i,r,u,f,e,o){authenticationAPI.validateUser(n,t,i,r,u,f,e,o,function(n){typeof e=="function"&&e(n)},function(n){typeof o=="function"&&o(n)})},showError:function(n){var i=this.getJquery(),t=i("._step"+this.wizardStep+" ._error-summary");t.html(n);t.removeClass("dn")},showBadRequestResponseError:function(n){var t=JSON.parse(n.responseText),i;if(t.ModelState)for(i in t.ModelState)this.showError(t.ModelState.errorSummary[0]),this.highlightsField("[modelstate-key='"+i+"']")},highlightsField:function(n){var t=this.getJquery();t(n).addClass("has-error")},removeHighlights:function(){var n=this.getJquery();n("[modelstate-key]").removeClass("has-error")},hideError:function(){var t=this.getJquery(),n=t("._step"+this.wizardStep+" ._error-summary");n.html("");n.addClass("dn")},showConfirm:function(n){this.elements.confirmMessage().html(n);this.elements.confirmMessage().show();this.elements.accountQuestion().hide();this.elements.signInFlipButton().hide();this.elements.steps().hide()},nextStep:function(){this.wizardStep+=1;var n="next0"+(this.wizardStep-1);this.wizardStep>1&&(this.hideFooter(),this.elements.nextStepsFooter().show());this.elements.contentStep().addClass(n)},showProvinceIfItaly:function(n,t){var i=this.getJquery();n&&i(n.currentTarget).val()==1?i(i(t).closest(".form-group")).show():i(i(t).closest(".form-group")).hide()},googleAutocompleteInit:function(){var n=this;this.userCityAutocompleteInit();this.companyCityAutocompleteInit()},facebookLoginClicked:!1,facebookLogin:function(n){var i=this,t;n=this.getReturnUrl();t=authenticationAPI.options.proxyPage;this.facebookLoginClicked||(authenticationAPI.removeCookies(),i.options.setSourceRequest!==undefined&&(document.cookie="LoginSourceRequest="+i.options.setSourceRequest),this.networkLoginEventTracker("Facebook"),this.networkLoginEventTracker("Network"),t=t+"?FacebookLogin=1&provider=Facebook&returnurl="+authenticationAPI.URLEncode(n),document.location=t,facebookLoginClicked=!0)},googleLogin:function(){var t=this,n,i;authenticationAPI.removeCookies();t.options.setSourceRequest!==undefined&&(document.cookie="LoginSourceRequest="+t.options.setSourceRequest);n=authenticationAPI.options.proxyPage;this.networkLoginEventTracker("Google");this.networkLoginEventTracker("Network");i=this.getReturnUrl();n=n+"?FacebookLogin=1&provider=Google&returnurl="+authenticationAPI.URLEncode(i);document.location=n},passwordRecover:function(){returnurl=this.getReturnUrl();returnurl=authenticationAPI.URLEncode(returnurl);document.location=authenticationAPI.options.apiHost+"/account/PasswordRecover.aspx?returnurl="+returnurl},networkLoginEventTracker:function(n){setTimeout(function(){try{typeof _gaq!="undefined"?_gaq.push(["_trackEvent","LOGIN_REGISTRAZIONI","Login","Login_"+n,1]):ga("send","event","LOGIN_REGISTRAZIONI","Login","Login_"+n,1)}catch(t){}},100)},firstAccountRegistrationEventTracker:function(n){n!=="Network"&&n!=="Facebook"&&n!=="Google"&&(n="Network");setTimeout(function(){try{typeof _gaq!="undefined"?_gaq.push(["_trackEvent","LOGIN_REGISTRAZIONI","Registrazioni","Registrazioni_"+n,1]):ga("send","event","LOGIN_REGISTRAZIONI","Registrazioni","Registrazioni_"+n,1)}catch(t){}},100)},fullAccountRegistrationEventTracker:function(){setTimeout(function(){try{typeof _gaq!="undefined"?_gaq.push(["_trackEvent","LOGIN_REGISTRAZIONI","Registrazioni","Registrazioni_Full",1]):ga("send","event","LOGIN_REGISTRAZIONI","Registrazioni","Registrazioni_Full",1)}catch(n){}},100)},accountRegistrationStepEventTracker:function(n){setTimeout(function(){try{typeof _gaq!="undefined"?_gaq.push(["_trackEvent","LOGIN_REGISTRAZIONI","Registrazioni","Registrazioni_Network_Step"+n,1]):ga("send","event","LOGIN_REGISTRAZIONI","Registrazioni","Registrazioni_Network_Step"+n,1)}catch(t){}},100)},getParameterByName:function(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+n+"=([^&#]*)",r=new RegExp(i),t=r.exec(window.location.href);return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))},getJquery:function(){return typeof $j!="undefined"?$j:$}};IsMobileBrowser={Android:function(){return navigator.userAgent.match(/Android/i)?!0:!1},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)?!0:!1},iOS:function(){return navigator.userAgent.match(/iPhone|iPod/i)?!0:!1},Windows:function(){return navigator.userAgent.match(/IEMobile/i)?!0:!1},any:function(){return IsMobileBrowser.Android()||IsMobileBrowser.BlackBerry()||IsMobileBrowser.iOS()||IsMobileBrowser.Windows()}};FacebookLoginClicked=!1;jQuery&&jQuery(window).resize(CenterLoginDialog);jQuery.fn.extend({geoinit:function(n){var t=this,i;t.length>0&&(n||(n={}),t.options=n,t.options.element=t,typeof t.options.appendTo=="undefined"&&(t.options.appendTo="body"),t.options.culture==undefined&&(t.options.culture="it"),t.options.apiurl==undefined&&(i="/Search/GeoSuggest",t.options.apiurl=location.href.indexOf("www2.")>0||location.href.indexOf("login2.")>0?"http://www2.archiproducts.com/"+t.options.culture+i:location.href.indexOf("staging.")>0?"http://staging.archiproducts.com/"+t.options.culture+i:"https://www.archiproducts.com/"+t.options.culture+i),t.options.cacheLength==undefined&&(t.options.cacheLength=1),t.options.autoFocus==undefined&&(t.options.autoFocus=!0),t.options.minLength==undefined&&(t.options.minLength=2),t.options.cacheLength==undefined&&(t.options.cacheLength=1),t.options.placeChanged||(t.options.placeChanged=function(){}),t.options.allowDirtyData==undefined&&(t.options.allowDirtyData=!1),t.options.forceLastFocused==undefined&&(t.options.forceLastFocused=!0),t.geoAutocomplete(t.options),t.removeAttr("autocomplete").attr("autocomplete","new-password"))},geoAutocomplete:function(n){var t=this;this.options.inputAddress=$(this).autocomplete({autoFocus:this.options.autoFocus,delay:this.options.delay,appendTo:this.options.appendTo,cacheLength:this.options.cacheLength,minLength:this.options.minLength,source:function(n,i){$.ajax({url:t.options.apiurl,dataType:"json",contentType:"application/json",type:"GET",data:{searchKey:n.term},complete:function(n){i($.map(n.responseJSON,function(n){return{label:n.Label+" ("+n.CountryName+")",value:n.LocalityName,geocode:n}}))}})},select:function(n,i){var r=i.item.geocode;t.notifyPlaceChanged(r,t.options)},change:function(i,r){r.item||(t.options.allowDirtyData?t.notifyPlaceChanged(null,t.options):t.options.forceLastFocused&&n.lastFocused?t.notifyPlaceChanged(n.lastFocused,t.options):(t.update_ui(""),t.notifyPlaceChanged(null,t.options)))},focus:function(t,i){return n.lastFocused=i,n.inputAddress=$(t.currentTarget),n.inputAddress.val(""),!1}});t.options.inputAddress.blur(function(){$("#ui-active-menuitem").length===0&&(t.options.lastFocused=null)})},notifyPlaceChanged:function(n,t){this.options.lastFocused=null;this.data("place",n);this.options.placeChanged(n,t)},update_ui:function(n){this.options.inputAddress.val(n.label)},getSelectedPlace:function(){return this.data("place")}})