var detectmobile={redirectCallback:null,defaultMobileURL:null,mobileSiteDomainIdentifiers:["m","mobi"],thresholdWidthInPixels:970,cookieName:"detectmobilesticky",forceWebParameter:"force-web",forceMobileParameter:"force-mobile",stripDomains:["www","www2","www3","m","mobi"],process:function(){var a=window.location.href;var b=this.splitURLParameters(a);var c=this.readCookie(this.cookieName);if(this.forceWebParameter in b){this.createCookie(this.cookieName,"true");return}if(c){if(this.forceMobileParameter in b){this.eraseCookie(this.cookieName)}else{return}}if(this.isOnMobileSite()){return}if(this.detectMobile()||this.forceMobileParameter in b){var d=this.getRedirectTarget("mobile",a);this.performRedirect(d)}},getRedirectTarget:function(a,b){var c=null;if(this.redirectCallback){c=this.redirectCallback(a,b)}else{if(a=="mobile"){c=this.defaultMobileURL}}if(!c){throw"Cannot redirect to "+a+" because target URL cannot be resolved by detectmobile.js"}return c},performRedirect:function(a){if(a==window.location.href){window.location.reload();return}window.location=a},replaceDomainName:function(a,b,c,d){var e;if(a.substring(0,4)!="http"){throw"Only absolute http/https URLs supported"}var f=a.split("/");if(f.length<2){throw"Cannot understand:"+a}var g=f[2];hostparts=g.split(":");var h=hostparts[0];for(e=0;e<this.stripDomains.length;e++){var i=this.stripDomains[e];if(h.indexOf(i+".")==0){h=h.substring(i.length+1);break}}if(c){b=b+"."+h}if(hostparts.length>1){hostparts=[b,hostparts[1]]}else{hostparts=[b]}var g=hostparts.join(":");var j=[f[0],f[1],g];for(var e=3;e<f.length;e++){j.push(f[e])}return j.join("/")},addURLParameter:function(a,b){var c=mobilize.getUrlVars(a);var d=a.split("?",1)[0];d+="?";var e=[];for(var f=0;f<c.length;f++){var g=c[f];var h=c[g];e.push(g+"="+h)}e.push(b);d+=e.join("&");return d},splitURLParameters:function(a){if(!this._urlvars){this._urlvars={}}if(!a){a=window.location.href}if(this._urlvars[a]){return this._urlvars[a]}var b=[],c;if(a.indexOf("#")>=0){a=a.slice(0,a.indexOf("#"))}var d=a.slice(a.indexOf("?")+1).split("&");for(var e=0;e<d.length;e++){c=d[e].split("=");b.push(c[0]);b[c[0]]=c[1]}this._urlvars[a]=b;return b},createCookie:function(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+c*24*60*60*1e3);d="; expires="+e.toGMTString()}document.cookie=a+"="+b+d+"; path=/"},readCookie:function(a){var b=a+"=";var c=document.cookie.split(";");for(var d=0;d<c.length;d++){var e=c[d];while(e.charAt(0)===" "){e=e.substring(1,e.length)}if(e.indexOf(b)===0){return e.substring(b.length,e.length)}}return null},eraseCookie:function(a){this.createCookie(a,"",-1)},detectMobile:function(){var a=this.getScreenDimensions();var b=Math.max(a.width,a.height);if(b<=this.thresholdWidthInPixels){return true}return false},getScreenDimensions:function(){return{width:window.screen.availWidth,height:window.screen.availHeight}},isOnMobileSite:function(){var a=window.location.hostname;var b=a.split(".");for(var c=0;c<b.length;c++){for(var d=0;d<this.mobileSiteDomainIdentifiers.length;d++){if(b[c]==this.mobileSiteDomainIdentifiers[d]){return true}}}return false}}
