function brandObject() { this.nrma="nrma"; this.nrmaqld="nrmaqld"; this.sgic="sgic"; this.sgio="sgio"; this.getBrand=function() { winHost = window.location.hostname; if( winHost.toUpperCase().indexOf("NRMAQLD")>-1) return brand.nrmaqld; if( winHost.toUpperCase().indexOf("NRMA")>-1) return brand.nrma; if( winHost.toUpperCase().indexOf("SGIC")>-1) return brand.sgic; if( winHost.toUpperCase().indexOf("SGIO")>-1) return brand.sgio; return "nrma"; }; } var brand=new brandObject(); function protocolObject() { this.corretDomain = ( ((window.location.hostname.toUpperCase().indexOf("AU")>-1) && (window.location.hostname.toUpperCase().indexOf("WWW")>-1) && (window.location.hostname.toUpperCase().indexOf("NRMAINSURANCE")<0)) || (window.location.hostname.toUpperCase().indexOf("IAGLIMITED")>-1) || (window.location.hostname.toUpperCase().indexOf("AUIAG")>-1) || (window.location.hostname.toUpperCase().indexOf("TEAMSITE")>-1) || (window.location.hostname.toUpperCase().indexOf("PILOT")>-1) || (window.location.href.toUpperCase().indexOf("SEARCH?Q=CACHE")>-1)); this.corretProtocol =(window.location.protocol == "http:"); this.fix = function(){ if (!this.corretDomain || !this.corretProtocol ) { winPro = "http:"; var brand=new brandObject(); winHost = window.location.hostname if (!this.corretDomain) winHost = "www." + brand.getBrand() + ".com.au"; winPath = window.location.pathname; winQP = ''+''; newurl = winPro + "//" + winHost + winPath + winQP; //alert("fix it"+ newurl); window.location.replace(newurl); } } }