/*****************************
*  Check the current domain an change the gmaps key and the search heading 
*/
function domainChecker(n) {
    var currURL = location.href;
    var googleKey;
    var googleIndex = "http://maps.google.com/maps?file=api&amp;v=2&amp;key=";
    var searchHeading = "Listings Search";

        if(location.host.indexOf("www.staging2.discovertasmania.clients.squiz.net") != -1) {searchHeading = "Listings Search"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBQjBmYmlHDPN66QNDWOUytIvoFXBhTu_FKxqgHqwWv-yvOSn_hg3XuOOg"; }
        if(location.host.indexOf("www.discovertasmania.com") != -1) {searchHeading = "Listings Search"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBRfVvUY5CTzCkkFgZdl3F6RANMB6hRYoG_MBcFuTLNF0PHsVxHK7MyvrA";}
        if(location.host.indexOf("it.discovertasmania.com") != -1) {searchHeading = "Prodotto di cerca"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBQO0u4ZUION4Mn2ryzPqOoz0vUXfhQsh5pi6wypQ4Ct5C_sAYuXjhnI6g";}
        if(location.host.indexOf("fr.discovertasmania.com")  != -1) {searchHeading = "Recherche de produits"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBTnhCZGoBzO0dmKpbe3GQ1C5cZSqhTAT3EmA09zWE4ZjFIS4RMOQtshvw";}
        if(location.host.indexOf("de.discovertasmania.com")  != -1) {searchHeading = "Produkte Suchen"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBTY4frWkpR0JuvPbkurS7d6NdrDhRTsD6QN-29J7sLIWtAnIsgTsKC8WA";}
        if(location.host.indexOf("www.discovertasmania.de")  != -1) {searchHeading = "Produkte Suchen"; googleKey = "ABQIAAAAvM6KaUoBySzXo2AQYTpFaRQlfVBj7jwAc_mh4d6aE7E2eCl4HhQTppqucpClEl3JGfGZdpzaAb2PIw";}
        if(location.host.indexOf("ja.discovertasmania.com") != -1) {searchHeading = "商品検索"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBTm4zWxj-yDigTpNe2b5GowM7w9jRS-qtxXy-eURdNEAyVFIhyll_f9OA";}
        if(location.host.indexOf("ko.discovertasmania.com") != -1) {searchHeading = "상품검색"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBSQxrOGb1kks-2Qpzh5Au8X-mt62xR8b9WXtnrJ_4aZax3MbL5EVXzc-Q";}
        if(location.host.indexOf("zht.discovertasmania.com")  != -1) {searchHeading = "產品搜索"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBSufK5aJRrEZ6fcNG7DnTgG5H62cRQCGj3ZuwRavKOZ8NaISRIBfq8F9Q";}
        if(location.host.indexOf("zhs.discovertasmania.com")  != -1) {searchHeading = "产品搜索"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBR3vfS4yUxuoKqwo97mwE8ZUM3hahQTGywxnCb7R7Z4DGqWV4oQJZJMNg";}
        if(location.host.indexOf("ens.discovertasmania.com")  != -1) {searchHeading = "Listings Search"; googleKey = "ABQIAAAASO5sC7Svje_a30gKoYzpDBSR6EsW5zd1ui513t-nskhZtiA9NRQ9oMP_zz_g2ppodLMH7hVesqG10w";}
        if(location.host.indexOf("www.discovertasmania.jp")  != -1) {searchHeading = "Listings Search"; googleKey = "ABQIAAAApdC-zh61Fa-oDfjx_iCtvBS1HsyplpH5lY1Dzofqmtl8OyVGrRR4DTe5HgQ-VlJO-WJ-buOrxykNCQ";}
        if(location.host.indexOf("www.discovertasmania.co.kr")  != -1) {searchHeading = "Listings Search"; googleKey = "ABQIAAAApdC-zh61Fa-oDfjx_iCtvBQp1Oi-OLWzkQ2_G9DMcQRVnn9ggRRxPqnIffE5m1xH2aCsf7uFZFLxrA";}
        if(location.host.indexOf("www.discovertasmania.net.cn")  != -1) {searchHeading = "Listings Search"; googleKey = "ABQIAAAApdC-zh61Fa-oDfjx_iCtvBR1uLNVvWY4mARvYFinLh9MNP8X-hQB_OFbAtDFMJE1t1mPiarhJ3RuKg";}
        if(location.host.indexOf("dev.discovertasmania.clients.squiz.net")  != -1) {searchHeading = "Listings Search"; googleKey = "ABQIAAAApdC-zh61Fa-oDfjx_iCtvBRCQB-0Ykfx5xX8HBgecucz1xeYKBRKw34MyrPlTYPKbecs0vvjj8CiTA";}
        if(location.host.indexOf("mount.discovertasmania.clients.squiz.net")  != -1) {searchHeading = "Listings Search"; googleKey = "ABQIAAAA71Cm6OC09mH6oQmVWApbMBSSo9Wd7FA_Gt5ihmt-qtao-5aI8RTsF1pobAr2BpjNkasRFml77C7CGQ";}



switch(n) {
    case 1 :
        document.write('<scr'+'ipt src='+googleIndex+googleKey+' type=\"text/javascript\"></scr'+'ipt>')
        break;
    case 2 :
        document.write(searchHeading)
    }
}


function addLoadEvent(func) {

	var oldonload = window.onload;

	if (typeof window.onload != 'function') {

		window.onload = func;

	}

	else {

		window.onload = function() {

			oldonload();

			func();

		}

	}

}

