function checkDomain( Lang ) { // Replace domain names to allow only www.aboriginalcanada.gc.ca , www.autochtonesaucanada.gc.ca, localhost, development, shq07acp01 and www.saqqivvingat.gc.ca // eg. shq07acp01.inac.gc.ca = shq07acp01 // - this script can be changed so that two arrays are used - "domainArray" and "domainArrayPrefered" (a match in domainArray would launch the equivalent element in domainArrayPrefered) var currentDomain = new String(window.location.host); /* domain variable */ var winLocation = new String(window.location.href); /* complete url variable */ // Note that the order of elements in the array is important AllowableDomainArray = new Array( "shq07acp01", "localhost", "portal-portail.inac.gc.ca", "portal-portail", "acp-dev", "sdvhqokabo", "development", "acp-red", "acp-red2", "acp-prod", "webcache.googleusercontent.com", "198.103.249.34", "198.103.254.34", "sdvhqokacp" ) // The last element in the AllowableDomainArray will be the default if (Lang == "en") {AllowableDomainArray.push("www.aboriginalcanada.gc.ca");} else if (Lang == "fr") {AllowableDomainArray.push("www.autochtonesaucanada.gc.ca");} else if (Lang == "iu") {AllowableDomainArray.push("www.saqqivvingat.gc.ca");} else {AllowableDomainArray.push("www.saqqivvingat.gc.ca", "www.autochtonesaucanada.gc.ca" , "www.aboriginalcanada.gc.ca");} //alert("current domain: " + currentDomain + "\n\nAllowableDomainArray:\n" + AllowableDomainArray + "\n\nArrayLength=" + AllowableDomainArray.length); // Check if it is one of the allowed domains for (var x=0; x < AllowableDomainArray.length; x++) { if ( currentDomain == AllowableDomainArray[x] ) { return true; } } for (var x=0; x < AllowableDomainArray.length; x++) { if ( currentDomain.indexOf(AllowableDomainArray[x] ) != -1 ) { window.location.replace(winLocation.replace(currentDomain,AllowableDomainArray[x])); return true; } } // Use the last element of AllowableDomainArray for the domain name window.location.replace(winLocation.replace(currentDomain,AllowableDomainArray[AllowableDomainArray.length - 1])); } function addHit(linkobject) { CurrentLocation = window.parent.location.href; // Trim any anchor from the CurrentLocation if (CurrentLocation.lastIndexOf("#") != -1) {CurrentLocation = CurrentLocation.substring(0,CurrentLocation.indexOf("#")); } var URLToOpen = "../AddHit?OpenAgent&Referer=" + CurrentLocation + "&URLToOpen=" + linkobject.href; window.location.href = URLToOpen; return false; }