
//MyAvaya 01 SEP 10
//EV Phase 5 version 14 JAN 10
//EV Phase 4 version 05 DEC 09
//EV Phase 3 version 12 OCT 09
//EV PHASE 2 version 16 SEP 09
//staging: var s_account="avayacorpinternaltest"
//avaya.com: var s_account="avayacorpglobal,avayacorpus"

//BF 3.17.09 
var _urlpath = "";
var Country_code = "us";

function GetSiteCatalystAccount(SiteCatalyst_location) {

    //#### comment out for live version  ###//
    if (document.URL != null && document.URL.indexOf("pm.v3-gcm.avaya.com") > 0) {
        return DEV_GetSiteCatalystAccountAccount(SiteCatalyst_location);
    }
    //######################################//

    var SiteCatalyst_accountid = "";

    //SiteCatalyst_location = window.location.toString();

    if (SiteCatalyst_location.indexOf("avaya.ae") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpmena"; }
    else if (SiteCatalyst_location.indexOf("avaya.at") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpaustria"; }
    else if (SiteCatalyst_location.indexOf("avaya.be") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpbelgium"; }
    else if (SiteCatalyst_location.indexOf("avaya.ca/campaigns/nar-en/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadaeng"; }
    else if (SiteCatalyst_location.indexOf("avaya.ca/campaigns/nar-fr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadafr"; }
    else if (SiteCatalyst_location.indexOf("avaya.ca/gcm/nar/en-us/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadaeng"; }
    else if (SiteCatalyst_location.indexOf("avaya.ca/gcm/nar/fr-ca/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadafr"; }
    else if (SiteCatalyst_location.indexOf("avaya.ca") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadaeng"; }
    else if (SiteCatalyst_location.indexOf("avaya.ch/gcm/emea/ch-de/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitzgerman"; }
    else if (SiteCatalyst_location.indexOf("avaya.ch/gcm/emea/ch-fr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitzfr"; }
    else if (SiteCatalyst_location.indexOf("avaya.ch") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitz"; }
    else if (SiteCatalyst_location.indexOf("avaya.co.il") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpisrael"; }
    else if (SiteCatalyst_location.indexOf("avaya.co.jp") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpjapan"; }
    else if (SiteCatalyst_location.indexOf("avaya.co.kr") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpkorea"; }
    else if (SiteCatalyst_location.indexOf("avaya.co.uk") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpuk"; }
    else if (SiteCatalyst_location.indexOf("avaya.co.za") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpsafrica"; }
    else if (SiteCatalyst_location.indexOf("avaya.com.au") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpaustralia"; }
    else if (SiteCatalyst_location.indexOf("avaya.com.br") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpbrazil"; }
    else if (SiteCatalyst_location.indexOf("avaya.com.cn") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpchina"; }
    else if (SiteCatalyst_location.indexOf("avaya.com.mx") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpmexico"; }
    else if (SiteCatalyst_location.indexOf("avaya.com.tr") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpturkey"; }
    else if (SiteCatalyst_location.indexOf("avaya.cz") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpczech"; }
    else if (SiteCatalyst_location.indexOf("avaya.de") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpgermany"; }
    else if (SiteCatalyst_location.indexOf("avaya.dk") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpdenmark"; }
    else if (SiteCatalyst_location.indexOf("avaya.es") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpspain"; }
    else if (SiteCatalyst_location.indexOf("avaya.eu/hr") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcroatia"; }
    else if (SiteCatalyst_location.indexOf("avaya.eu/si") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpslovenia"; }
    else if (SiteCatalyst_location.indexOf("avaya.eu") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcroatia"; }

    else if (SiteCatalyst_location.indexOf("avaya.fi") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpfinland"; }
    else if (SiteCatalyst_location.indexOf("avaya.fr") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpfrance"; }
    else if (SiteCatalyst_location.indexOf("avaya.gr") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpgreece"; }
    else if (SiteCatalyst_location.indexOf("avaya.hu") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorphungary"; }
    else if (SiteCatalyst_location.indexOf("avaya.ie") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpireland"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/in/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorptempsuite1"; Country_code = "in"; }
    else if (SiteCatalyst_location.indexOf("avaya.it") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpitaly"; }
    else if (SiteCatalyst_location.indexOf("avaya.nl") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpnetherlands"; }
    else if (SiteCatalyst_location.indexOf("avaya.no") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpnorway"; }
    else if (SiteCatalyst_location.indexOf("avaya.pl") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorppoland"; }
    else if (SiteCatalyst_location.indexOf("avaya.ru") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorprussia"; }
    else if (SiteCatalyst_location.indexOf("avaya.se") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpsweden"; }
    else if (SiteCatalyst_location.indexOf("avaya.sk") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpslovakia"; }
    else if (SiteCatalyst_location.indexOf("avaya.tr") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpturkey"; }
    else if (SiteCatalyst_location.indexOf("avaya-apac.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpapac"; }
    else if (SiteCatalyst_location.indexOf("avayaglobalconnect.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpindia"; }
    else if (SiteCatalyst_location.indexOf("avayainfo.sitepepper.de") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpgermany"; }
    else if (SiteCatalyst_location.indexOf("brc.avaya.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpbusresearchcenter"; }
    else if (SiteCatalyst_location.indexOf("cala.avaya.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcalareg"; }
    else if (SiteCatalyst_location.indexOf("emea.avaya.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpemea"; }
    else if (SiteCatalyst_location.indexOf("gallery.avaya.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcustomersr"; }
    else if (SiteCatalyst_location.indexOf("intranet.tenovis.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorptenovisintra"; }
    else if (SiteCatalyst_location.indexOf("investors.avaya.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpinvestors"; }
    else if (SiteCatalyst_location.indexOf("partnerjp.avaya.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpjapbpportal"; }
    else if (SiteCatalyst_location.indexOf("pmc.avaya.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorppartnercentral"; }
    else if (SiteCatalyst_location.indexOf("research.avayalabs.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpus"; }
    else if (SiteCatalyst_location.indexOf("support.avaya.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpsupport"; }
    else if (SiteCatalyst_location.indexOf("avayablog.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpus,avaycorpblog"; Country_code = "us"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/apac/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpapac"; Country_code = "apac"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/at/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpaustria"; Country_code = "at"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/br/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpbrazil"; Country_code = "br"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/ca-en/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadaeng"; Country_code = "ca-en"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/ca-fr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadafr"; Country_code = "ca-fr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/ca%2Den/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadaeng"; Country_code = "ca-en"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/ca%2Dfr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadafr"; Country_code = "ca-fr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/cala/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcalareg"; Country_code = "cala"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/ch-de/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitzgerman"; Country_code = "ch-de"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/ch-fr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitzfr"; Country_code = "ch-fr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/ch%2Dde/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitzgerman"; Country_code = "ch-de"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/ch%2Dfr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitzfr"; Country_code = "ch-fr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/cn/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpchina"; Country_code = "cn"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/cz/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpczech"; Country_code = "cz"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/de/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpgermany"; Country_code = "de"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/emea/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpemea"; Country_code = "emea"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/es/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpspain"; Country_code = "es"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/fr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpfrance"; Country_code = "fr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpgreece"; Country_code = "gr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/hu/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorphungary"; Country_code = "hu"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/it/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpitaly"; Country_code = "it"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/jp/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpjapan"; Country_code = "jp"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/kr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpkorea"; Country_code = "kr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/mx/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpmexico"; Country_code = "mx"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/nl/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpnetherlands"; Country_code = "nl"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/pl/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorppoland"; Country_code = "pl"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/ru/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorprussia"; Country_code = "ru"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/sk/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpslovakia"; Country_code = "sk"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/tr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpturkey"; Country_code = "tr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/uk/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpuk"; Country_code = "uk"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/usa/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpus"; Country_code = "us"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/cala/es-mx/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpmexico"; Country_code = "mx"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/cala/pt-br/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpbrazil"; Country_code = "br"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/cala/en-us/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcalareg"; Country_code = "cala"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/de/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpgermany"; Country_code = "de"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/en-us/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpuk"; Country_code = "uk"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/es/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpspain"; Country_code = "es"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/fr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpfrance"; Country_code = "fr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/it/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpitaly"; Country_code = "it"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/ru/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorprussia"; Country_code = "ru"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/hu/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorphungary"; Country_code = "hu"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/gr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpgreece"; Country_code = "gr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/tr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpturkey"; Country_code = "tr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/pl/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorppoland"; Country_code = "pl"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/cz/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpczech"; Country_code = "cz"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/ch-fr/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitzfr"; Country_code = "ch-fr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/ch-de/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitzgerman"; Country_code = "ch-de"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/at/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpaustria"; Country_code = "at"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/nl/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpnetherlands"; Country_code = "nl"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/emea/sk/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpslovakia"; Country_code = "sk"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/apac/zh-cn/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpchina"; Country_code = "cn"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/apac/ja/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpjapan"; Country_code = "jp"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/apac/ko/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpkorea"; Country_code = "kr"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/apac/en-us/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpapac"; Country_code = "apac"; }
    else if (SiteCatalyst_location.indexOf("avaya.com/gcm/nar/fr-ca/") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpcanadafr"; }
    else if (SiteCatalyst_location.indexOf("/calculator-platform/") > 0) {
        if (SiteCatalyst_location.indexOf("locale=ch-de") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpswitzgerman"; Country_code = "ch-de"; }
        else if (SiteCatalyst_location.indexOf("locale=de-de") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpgermany"; Country_code = "de"; }
        else if (SiteCatalyst_location.indexOf("locale=en-us") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpus"; Country_code = "us"; }
        else { SiteCatalyst_accountid = "avayacorpglobal,avayacorpus"; Country_code = "us"; }
        // TODO: Checks for remaining countries.
    }
    else if (SiteCatalyst_location.indexOf("avaya.com") > 0) { SiteCatalyst_accountid = "avayacorpglobal,avayacorpus"; Country_code = "us-df"; }


    else {
        SiteCatalyst_accountid = "avayacorpglobal,avayacorpfallout";
    }

    return SiteCatalyst_accountid;
}


function DEV_GetSiteCatalystAccountAccount(SiteCatalyst_location) {
    var GlobalAccount = "avayacorpinternaltest";
    var SiteCatalyst_accountid = "";
    //return GlobalAccount;

    if (SiteCatalyst_location.indexOf("www.ar-v3.avaya.pub1.globalworks.com") > 0) { SiteCatalyst_accountid = "pub1"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.usa.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpus"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.cala.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpcalareg"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.mx.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpmexico"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.br.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpbrazil"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.emea.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpemea"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.at.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpaustria"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.es.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpspain"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.de.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpgermany"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.fr.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpfrance"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.it.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpitaly"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.nl.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpnetherlands"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.ru.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorprussia"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.ch.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpswitzgerman"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.tr.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpturkey"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.pl.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorppoland"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.hu.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorphungary"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.gr.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpgreece"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.cz.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpczech"; }
    else if (SiteCatalyst_location.indexOf("rt-v3.sk.stage.globalworks.com") > 0) { SiteCatalyst_accountid = "avayacorpslovakia"; }
    else {
        SiteCatalyst_accountid = "avayacorpinternaltestfallout";
    }

    //return SiteCatalyst_accountid;
    return "avayacorpinternaltest";
}

function _getEvolutionPath() {
    var m_sURL = document.URL;
    var pattern = /^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/;
    if (m_sURL.match(pattern)) {
        urlpath = m_sURL.match(pattern)[2];
        urlpath = urlpath.substr(urlpath.indexOf("/") + 1);
        _urlpath = urlpath;
        return _urlpath;
    }
    return "";
}
function _getFinderResult(keyword) {
    var kp = _urlpath.indexOf(keyword + "--");
    if (kp > 0) {
        var slash = _urlpath.length;
        if (_urlpath.indexOf("/", kp + 1) >= 0) slash = _urlpath.indexOf("/", kp + 1);
        else if (_urlpath.indexOf("&", kp + 1) >= 0) slash = _urlpath.indexOf("&", kp + 1);
        keyvalue = _urlpath.substring(kp + keyword.length + 2, slash);
        return keyvalue;
    }
    return "";
}
function _SiteCatalystStrip(a) {
    a = a.split("|").join("");
    a = a.split("&").join("");
    a = a.split("'").join("");
    a = a.split("#").join("");
    a = a.split("$").join("");
    a = a.split("%").join("");
    a = a.split("^").join("");
    a = a.split("*").join("");
    a = a.split(":").join("");
    a = a.split("!").join("");
    a = a.split("<").join("");
    a = a.split(">").join("");
    a = a.split("~").join("");
    a = a.split(";").join("");
    //a = a.split(" ").join("+");
    a = a.split("\\").join("");
    a = a.split("").join("");
    a = a.split(".").join("");
    a = a.split('"').join('');
    //left trim.
    a = a.replace(/^\s+/, "");
    //right trim.
    a = a.replace(/\s+$/, "");
    //line breaks.
    a = a.replace(/\n\r/, "");
    //tabs.
    a = a.replace(/\t/g, "");

    return a;
}
function GetVar46()
{
    if (typeof(TrackingVar46) !== 'undefined')
        return TrackingVar46;
    else 
        return "";
}
function GetPageName(n) {
    var url = document.URL;
    url = url.replace('http://' + window.location.hostname, "");
    
    _urlpath = _getEvolutionPath();
    if (_urlpath.toLowerCase().indexOf("/error404") >= 0 || (typeof(n) !== 'undefined' && n == "404")) {
        var m_s404 = "404err" + "|" + url;
        return m_s404
    }
    else if (_urlpath.toLowerCase().indexOf("/error500") >= 0 || (typeof(n) !== 'undefined' && n == "500")) {
        var m_s500 = "500err" + "|" + url;
        return m_s500
    }
    else {
        if (typeof (TrackingPageName) != 'undefined') {
            return TrackingPageName;
        }

        //Evolution START
        var title = _SiteCatalystStrip(document.title);
        if (_urlpath.indexOf("results/") >= 0) title = "Generic Finder Results";
        else if (_urlpath.indexOf("resources/") >= 0) title = "Resources Library Results";
        else if (_urlpath.toLowerCase().indexOf("/error404") >= 0) title = "404err" + "|" + document.URL;
        else if (_urlpath.toLowerCase().indexOf("/error500") >= 0) title = "500err" + "|" + document.URL;
        else if (typeof ErrorFlag != "undefined" && ErrorFlag) title = "404err" + "|" + document.URL;
        else if (typeof Error500Flag != "undefined" && Error500Flag) title = "500err" + "|" + document.URL;
        if (typeof (pageinfo) !== 'undefined') {
            if (pageinfo["title"] == "UCM Registration") {
                return title + "Agree"
            }
        }
    return title;

    //Evolution END
}
}
function GetServerId(IP) {
    ChocolateChocolateChip();
    if (IP == ".37") {
        return "Stage01"
    }
    if (IP == ".198") {
        return "PCOMPM01"
    }
    if (IP == "05") {
        return "05"
    }
    if (IP == "06") {
        return "06"
    }
    if (IP == "07") {
        return "07"
    }
}
function GetRegID() {
    var regID = readCookie("RegID");
    if (regID != null) {
        regID = fixedLength(regID, 10);
        return regID;
    } else {
        return "";
    }
}
function fixedLength(s, n) {
    n = (n < 0) ? 0 : n
    s = s.substr(0, n);
    var a = [];
    a.length = n - s.length + 1;
    return a.join('0') + s;
}
function GetChannel() {
    var m_sURL = document.URL;


    if (m_sURL.indexOf("CurrentPath=") > 0) {

        if (m_sURL.indexOf("CurrentPath=/") > 0) {
            var m_sHostused = m_sURL.substring(m_sURL.indexOf("CurrentPath=/") + 13, m_sURL.length);
        }
        else {
            var m_sHostused = m_sURL.substring(m_sURL.indexOf("CurrentPath=") + 12, m_sURL.length);
        }
        var m_sFSlash = new Array();
        var j = 0;
        for (var i = 0; i < m_sHostused.length; i++) {
            if (m_sHostused.charAt(i) == "/") {
                m_sFSlash[j] = i;
                j = j + 1;
            }
        }

        var m_sRegion = m_sHostused.substring(0, m_sFSlash[0]);
        var m_sCountry = m_sHostused.substring(m_sFSlash[0] + 1, m_sFSlash[1]);

        if ((m_sURL.indexOf("v3") > 0) && m_sRegion == "master-usa" && m_sCountry == "en-us") {
            //var m_sChannel = "en-us" + "|" + m_sHostused.substring(m_sFSlash[1], m_sFSlash[j -1] + 1);
            var m_sChannel = "us" + "|" + m_sHostused.substring(m_sFSlash[1] + 1, m_sFSlash[j - 1]);
        }
        else if ((m_sURL.indexOf("v3") > 0) && m_sRegion == "nar" && m_sCountry == "en-us") {
            var m_sChannel = "ca-en" + "|" + m_sHostused.substring(m_sFSlash[1] + 1, m_sFSlash[j - 1]);

        }
        else if ((m_sURL.indexOf("v3") > 0 || m_sURL.indexOf("avaya.com") > 0) && m_sRegion == "nar" && m_sCountry == "fr-ca") {
            var m_sChannel = "ca-fr" + "|" + m_sHostused.substring(m_sFSlash[1] + 1, m_sFSlash[j - 1]);

        }
        else if ((m_sURL.indexOf("v3") > 0) && m_sRegion == "emea" && m_sCountry == "en-us") {
            var m_sChannel = "en-uk" + "|" + m_sHostused.substring(m_sFSlash[1] + 1, m_sFSlash[j - 1]);
        }
        else if ((m_sURL.indexOf("v3") > 0) && m_sRegion == "cala" && m_sCountry == "en-us") {
            var m_sChannel = "cala" + "|" + m_sHostused.substring(m_sFSlash[1] + 1, m_sFSlash[j - 1]);
        }
        else {
            var m_sChannel = m_sCountry + "|" + m_sHostused.substring(m_sFSlash[1] + 1, m_sFSlash[j - 1]);
        }

        if (m_sHostused.indexOf("&Filter=") > 0) {
            var k;
            for (var i = 0; i < j; i++) {
                if (m_sFSlash[i] < m_sHostused.indexOf("&Filter=")) {
                    k = i;
                }
            }
            //var m_sChannel = m_sCountry + "|" + m_sHostused.substring(m_sFSlash[1], m_sFSlash[k] + 1);
            var m_sChannel = m_sCountry + "|" + m_sHostused.substring(m_sFSlash[1] + 1, m_sFSlash[k]);
        }
        var view = "", contentpath = "";

        var urlpath = m_sURL;
        var vind = urlpath.indexOf("view=");
        var aind = urlpath.indexOf("&", vind)
        if (vind > 0) {
            if (aind > 0)
                var vstr = urlpath.substring((vind + 5), aind);
            else
                var vstr = urlpath.substring(vind + 5);
            view = "|" + vstr;
        }

        m_sChannel = m_sChannel + view;

        //m_sChannel = m_sChannel.replace(/\//g,"|");
        if (typeof (pageinfo) !== 'undefined') {
            if (pageinfo["title"] == "UCM Registration") {
                return m_sChannel + "/agree";
            }
        }
        return m_sChannel.replace("index.aspx", "");

    }
    else if (m_sURL.indexOf("/gcm/") > 0) {
        var m_sHostused = m_sURL.substring(m_sURL.indexOf("/gcm/") + 4, m_sURL.length);
        var m_sFSlash = new Array();
        var j = 0;
        for (var i = 0; i < m_sHostused.length; i++) {
            if (m_sHostused.charAt(i) == "/") {
                m_sFSlash[j] = i;
                j = j + 1;
            }
        }

        var m_sRegion = m_sHostused.substring(m_sFSlash[0] + 1, m_sFSlash[1]);
        var m_sCountry = m_sHostused.substring(m_sFSlash[1] + 1, m_sFSlash[2]);

        //address region/country by Host used
        if ((m_sURL.indexOf("www.avaya.com") > 0) && (m_sURL.indexOf("master-usa/en-us") > 0)) {
            var m_sRegion = "master-usa";
            var m_sCountry = "us";
        }
        if ((m_sURL.indexOf("avaya.co.uk") > 0) || (m_sURL.indexOf("avaya.com/uk") > 0)) {
            var m_sRegion = "emea";
            var m_sCountry = "uk";
        }
        if ((m_sURL.indexOf("emea.avaya.com") > 0) || (m_sURL.indexOf("avaya.com/emea") > 0)) {
            var m_sRegion = "emea";
            var m_sCountry = "emea";
        }
        if ((m_sURL.indexOf("avaya.de") > 0) || (m_sURL.indexOf("avaya.com/de") > 0)) {
            var m_sRegion = "emea";
            var m_sCountry = "de";
        }
        if ((m_sURL.indexOf("avaya.fr") > 0) || (m_sURL.indexOf("avaya.com/fr") > 0)) {
            var m_sRegion = "emea";
            var m_sCountry = "fr";
        }
        if (m_sURL.indexOf("cala.avaya.com") > 0) {
            var m_sRegion = "cala";
            var m_sCountry = "en-us";
        }
        if (m_sURL.indexOf("avaya.com.br") > 0) {
            var m_sRegion = "cala";
            var m_sCountry = "br";
        }
        if (m_sURL.indexOf("avaya.com.mx") > 0) {
            var m_sRegion = "cala";
            var m_sCountry = "mx";
        }

        if (m_sURL.indexOf("avaya.at") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "at";
        }
        if ((m_sURL.indexOf("avaya.ch") > 0)) //Default
        {
            var m_sRegion = "emea";
            var m_sCountry = "ch-de";
        }
        if ((m_sURL.indexOf("avaya.ch") > 0) && (m_sURL.indexOf("ch-de") > 0)) {
            var m_sRegion = "emea";
            var m_sCountry = "ch-de";
        }
        if ((m_sURL.indexOf("avaya.ch") > 0) && (m_sURL.indexOf("ch-fr") > 0)) {
            var m_sRegion = "emea";
            var m_sCountry = "ch-fr";
        }
        if (m_sURL.indexOf("avaya.cz") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "cz";
        }
        if (m_sURL.indexOf("avaya.es") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "es";
        }
        if (m_sURL.indexOf("avaya.gr") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "gr";
        }
        if (m_sURL.indexOf("avaya.hu") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "hu";
        }
        if (m_sURL.indexOf("avaya.it") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "it";
        }
        if (m_sURL.indexOf("avaya.nl") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "nl";
        }
        if (m_sURL.indexOf("avaya.pl") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "pl";
        }
        if (m_sURL.indexOf("avaya.ru") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "ru";
        }
        if (m_sURL.indexOf("avaya.sk") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "sk";
        }
        if (m_sURL.indexOf("avaya.com.tr") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "tr";
        }

        if ((m_sURL.indexOf("avaya.com") > 0) && (m_sURL.indexOf("campaigns/usa") > 0)) {
            var m_sRegion = "master-usa";
            var m_sCountry = "us";
        }
        if ((m_sURL.indexOf("cala.avaya.com") > 0) && (m_sURL.indexOf("campaigns/cala-en-us") > 0)) {
            var m_sRegion = "cala";
            var m_sCountry = "en-us";
        }
        if ((m_sURL.indexOf("avaya.com.br") > 0) && (m_sURL.indexOf("campaigns/cala-pt-br") > 0)) {
            var m_sRegion = "cala";
            var m_sCountry = "br";
        }
        if ((m_sURL.indexOf("avaya.ca") > 0)) //Default
        {
            var m_sRegion = "ca";
            var m_sCountry = "ca-en";
        }
        if ((m_sURL.indexOf("avaya.ca") > 0) && (m_sURL.indexOf("nar/fr-ca") > 0)) {
            var m_sRegion = "ca";
            var m_sCountry = "ca-fr";
        }
        if ((m_sURL.indexOf("avaya.ca") > 0) && (m_sURL.indexOf("campaigns/nar-fr") > 0)) {
            var m_sRegion = "ca";
            var m_sCountry = "ca-fr";
        }
        if ((m_sURL.indexOf("avaya.ca") > 0) && (m_sURL.indexOf("campaigns/nar-en") > 0)) {
            var m_sRegion = "ca";
            var m_sCountry = "ca-en";
        }
        if (m_sURL.indexOf("avaya.com/usa/careers/") > 0) {
            var m_sRegion = "master-usa";
            var m_sCountry = "us";
        }



        if ((m_sURL.indexOf("avaya.com") > 0) && m_sRegion == "master-usa" && m_sCountry == "en-us") {
            //var m_sChannel = "en-us" + "|" + m_sHostused.substring(m_sFSlash[2], m_sFSlash[j -1] + 1);
            var m_sChannel = "us" + "|" + m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if ((m_sURL.indexOf("avaya.ca") > 0) && m_sRegion == "ca" && m_sCountry == "ca-en") {
            var m_sChannel = "ca-en" + "|" + m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if ((m_sURL.indexOf("avaya.ca") > 0) && m_sRegion == "ca" && m_sCountry == "ca-fr") {
            var m_sChannel = "ca-fr" + "|" + m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if (((m_sURL.indexOf("avaya.co.uk") > 0) || (m_sURL.indexOf("avaya.com/uk") > 0)) && m_sRegion == "emea" && m_sCountry == "en-us") {
            var m_sChannel = "uk" + "|" + m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if (((m_sURL.indexOf("emea.avaya.com") > 0) || (m_sURL.indexOf("avaya.com/emea") > 0)) && m_sRegion == "emea" && m_sCountry == "en-us") {
            var m_sChannel = "emea" + "|" + m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if ((m_sURL.indexOf("cala.avaya.com") > 0) && m_sRegion == "cala" && m_sCountry == "en-us") {
            var m_sChannel = "cala" + "|" + m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if (m_sURL.indexOf("research.avayalabs.com") > 0) {
            var m_sRegion = "us";
            var m_sCountry = "us";
            var m_sChannel = m_sCountry + "|" + m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else {
            var m_sChannel = m_sCountry + "|" + m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        if (m_sHostused.indexOf("&Filter=") > 0) {
            var k;
            for (var i = 0; i < j; i++) {
                if (m_sFSlash[i] < m_sHostused.indexOf("&Filter=")) {
                    k = i;
                }
            }
            //var m_sChannel = m_sCountry + "|" + m_sHostused.substring(m_sFSlash[2], m_sFSlash[k] + 1);
            var m_sChannel = m_sCountry + "|" + m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[k]);
        }
        //m_sChannel = m_sChannel.replace(/\//g,"|");
        if (typeof (pageinfo) !== 'undefined') {
            if (pageinfo["title"] == "UCM Registration") {
                return m_sChannel + "/agree";
            }
        }
        return m_sChannel.replace("index.aspx", "");

    }
    else if (m_sURL.indexOf("/calculator-platform/") > 0) {
        var m_localIndex = m_sURL.indexOf("locale=");
        var m_sCountry = "us";
        if (m_localIndex > 0)
            m_sCountry = m_sURL.substr(m_localIndex + 9, 2).toLowerCase(); // Extract country code
        return m_sCountry + "|calculator-platform";
    }
    else {

        if (m_sURL.indexOf("/snapshots/") > 0) {

            if (m_sURL.indexOf("snapshots/usa") > 0) {
                var m_sRegion = "master-usa";
                var m_sCountry = "us";
                var m_sChannel = m_sCountry + "|" + "usa/published_files";
            }
            if (m_sURL.indexOf("snapshots/uk") > 0) {
                var m_sRegion = "emea";
                var m_sCountry = "uk";
                var m_sChannel = m_sCountry + "|" + "uk/site_files";
            }

            return m_sChannel.replace("index.aspx", "");
        }

        //Evolution Update Start
        var channel = "", view = "", contentpath = "";
        var m_sURL = document.URL;
        var urlpath = _getEvolutionPath();
        if (urlpath == '' || urlpath == undefined) {
            var find = m_sURL.indexOf("//");
            if (find > 0) {
                find = m_sURL.indexOf("/", find + 2);
                sind = m_sURL.indexOf("/", find + 1);
            }


            m_sURL = m_sURL.substring(sind + 1);

            urlpath = m_sURL;
        }
        if (urlpath != "" && urlpath.substring(0, 1) != "?") {
            //Get the Region out of the url, and get the content path
            var cppoint = urlpath.length;
            if (urlpath.indexOf("?") > 0) {
                cppoint = urlpath.indexOf("?");
                //If View exists in the path
                if (urlpath.indexOf("view=") > 0) {
                    var vp = urlpath.length;
                    if (urlpath.indexOf("&", cppoint) > 0) vp = urlpath.indexOf("&", cppoint);
                    else if (urlpath.indexOf("/", cppoint) > 0) vp = urlpath.indexOf("/", cppoint);
                    else vp = urlpath.length;
                    view = "/" + urlpath.substring(urlpath.indexOf("view=") + 5, vp);
                    view = view.replace(/%20/, "");
                }
            }
            if (urlpath.substr(cppoint - 1, 1) == "/") contentpath = urlpath.substring(0, cppoint - 1)
            else contentpath = urlpath.substring(0, cppoint);
        }
        channel = Country_code + "|" + contentpath + view;
        return channel.replace("index.aspx", "");

        //Evolution Update End

        var m_sFSlash = new Array();
        var j = 0;
        for (var i = 0; i < m_sURL.length; i++) {
            if (m_sURL.charAt(i) == "/") {
                m_sFSlash[j] = i;
                j = j + 1;
            }
        }


        if (m_sURL.indexOf("/campaigns/") > 0) {
            if (m_sURL.indexOf("campaigns/usa") > 0) {
                var m_sRegion = "master-usa";
                var m_sCountry = "us";
            }
            if (m_sURL.indexOf("campaigns/cala-en-us") > 0) {
                var m_sRegion = "cala";
                var m_sCountry = "en-us";
            }
            if (m_sURL.indexOf("campaigns/cala-pt-br") > 0) {
                var m_sRegion = "cala";
                var m_sCountry = "br";
            }
            if (m_sURL.indexOf("campaigns/nar-fr") > 0) {
                var m_sRegion = "ca";
                var m_sCountry = "ca-fr";
            }
            if (m_sURL.indexOf("campaigns/nar-en") > 0) {
                var m_sRegion = "ca";
                var m_sCountry = "ca-en";
            }

            var m_sChannel = m_sCountry + "|" + m_sURL.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if (m_sURL.indexOf("avayainfo.sitepepper.de") > 0) {
            var m_sRegion = "emea";
            var m_sCountry = "de";
            var m_sChannel = m_sCountry + "|" + m_sURL.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if (m_sURL.indexOf("research.avayalabs.com") > 0) {
            var m_sRegion = "us";
            var m_sCountry = "us";
            var m_sChannel = m_sCountry + "|" + m_sURL.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if (m_sURL.indexOf("avaya.com/usa/careers/") > 0) {
            var m_sRegion = "master-usa";
            var m_sCountry = "us";
            var m_sChannel = m_sCountry + "|" + m_sURL.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else if ((m_sURL.indexOf("avaya.co.uk") > 0) || (m_sURL.indexOf("avaya.com/uk") > 0)) {
            var m_sRegion = "emea";
            var m_sCountry = "uk";
            var m_sChannel = m_sCountry + "|" + m_sURL.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
        }
        else {
            //var m_sChannel = m_sURL.substring(m_sFSlash[2] + 1, m_sURL.length);
            //var m_sChannel = m_sURL.substring(m_sFSlash[2], m_sFSlash[j -1] + 1);
            var m_sChannel = m_sURL.substring(m_sFSlash[2] + 1, m_sFSlash[j - 1]);
            //m_sChannel = m_sChannel.replace(/\//g,"|");
        }
        if (typeof (pageinfo) !== 'undefined') {
            if (pageinfo["title"] == "UCM Registration") {
                return m_sChannel + "/agree";
            }
        }
        return m_sChannel.replace("index.aspx", "");
    }
}
function GetPageType(n)
{
    if (typeof(TrackingPageType) !== 'undefined')
        return TrackingPageType;
    else {
        if (typeof(n) !== 'undefined' && n == "404") {
            var m_s404 = "errorPage";
            return m_s404
        }
        else if (typeof(n) !== 'undefined'  && n == "500") {
            var m_s500 = "errorPage";
            return m_s500
        }
        else if (typeof ErrorFlag != "undefined" && ErrorFlag) return "errorPage";
        else if (typeof Error500Flag != "undefined" && Error500Flag) return "errorPage";
        else {
            return ""
        }
    } 
        
}
function GetProp1() {
    var m_sURL = document.URL;
    if (m_sURL.indexOf("CurrentPath=/") > 0) {
        var m_sHostused = m_sURL.substring(m_sURL.indexOf("CurrentPath=") + 12, m_sURL.length);
    }
    if (m_sURL.indexOf("CurrentPath=/") < 0) {
        var m_sHostused = "/" + m_sURL.substring(m_sURL.indexOf("CurrentPath=") + 12, m_sURL.length);
    }
    if (m_sURL.indexOf("/gcm/") > 0) {
        var m_sHostused = m_sURL.substring(m_sURL.indexOf("/gcm/") + 4, m_sURL.length);
    }
    //Evolution Start
    if (m_sHostused == "") {
        var pathArray = _urlpath.split("/");
        if (pathArray.length >= 1) {
            return pathArray[0];
        } else {
            return "";
        }
    }
    //Evolution End

    var m_sFSlash = new Array();
    var j = 0;
    for (var i = 0; i < m_sHostused.length; i++) {
        if (m_sHostused.charAt(i) == "/") {
            m_sFSlash[j] = i;
            j = j + 1;
        }
    }
    //alert(j);
    if (j > 3) {
        var m_sProp1 = m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[3]);
        return m_sProp1
    }
    else {
        return ""
    }
}
function GetProp2() {
    var m_sURL = document.URL;
    if (m_sURL.indexOf("CurrentPath=/") > 0) {
        var m_sHostused = m_sURL.substring(m_sURL.indexOf("CurrentPath=") + 12, m_sURL.length);
    }
    if (m_sURL.indexOf("CurrentPath=/") < 0) {
        var m_sHostused = "/" + m_sURL.substring(m_sURL.indexOf("CurrentPath=") + 12, m_sURL.length);
    }
    if (m_sURL.indexOf("/gcm/") > 0) {
        var m_sHostused = m_sURL.substring(m_sURL.indexOf("/gcm/") + 4, m_sURL.length);
    }
    //Evolution Start -- _urlpath is already been assigned by the first call of getEvolutionPath
    if (m_sHostused == "") {
        var pathArray = _urlpath.split("/");
        if (pathArray.length >= 2) {
            return pathArray[0] + "/" + pathArray[1];
        } else {
            return "";
        }
    }
    //Evolution End


    var m_sFSlash = new Array();
    var j = 0;
    for (var i = 0; i < m_sHostused.length; i++) {
        if (m_sHostused.charAt(i) == "/") {
            m_sFSlash[j] = i;
            j = j + 1;
        }
    }
    if (j > 4 && (m_sHostused.indexOf("&Filter=") < 0)) {
        var m_sProp2 = m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[4]);
        //m_sProp2 = m_sProp2.replace(/\//g,"|");
        return m_sProp2
    }
    else {
        return ""
    }
}
function GetProp3() {
    var m_sURL = document.URL;
    if (m_sURL.indexOf("CurrentPath=/") > 0) {
        var m_sHostused = m_sURL.substring(m_sURL.indexOf("CurrentPath=") + 12, m_sURL.length);
    }
    if (m_sURL.indexOf("CurrentPath=/") < 0) {
        var m_sHostused = "/" + m_sURL.substring(m_sURL.indexOf("CurrentPath=") + 12, m_sURL.length);
    }
    if (m_sURL.indexOf("/gcm/") > 0) {
        var m_sHostused = m_sURL.substring(m_sURL.indexOf("/gcm/") + 4, m_sURL.length);
    }

    //Evolution Start -- _urlpath is already been assigned by the first call of getEvolutionPath
    if (m_sHostused == "") {
        var pathArray = _urlpath.split("/");
        if (pathArray.length >= 3) {
            return pathArray[0] + "/" + pathArray[1] + "/" + pathArray[2];
        } else {
            return "";
        }
    }
    //Evolution End

    var m_sFSlash = new Array();
    var j = 0;
    for (var i = 0; i < m_sHostused.length; i++) {
        if (m_sHostused.charAt(i) == "/") {
            m_sFSlash[j] = i;
            j = j + 1;
        }
    }
    if (j > 5 && (m_sHostused.indexOf("&Filter=") < 0)) {
        var m_sProp3 = m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[5]);
        //m_sProp3 = m_sProp3.replace(/\//g,"|");
        return m_sProp3
    }
    else {
        return ""
    }
}
function GetProp4() {
    var m_sURL = document.URL;
    if (m_sURL.indexOf("CurrentPath=/") > 0) {
        var m_sHostused = m_sURL.substring(m_sURL.indexOf("CurrentPath=") + 12, m_sURL.length);
    }
    if (m_sURL.indexOf("CurrentPath=/") < 0) {
        var m_sHostused = "/" + m_sURL.substring(m_sURL.indexOf("CurrentPath=") + 12, m_sURL.length);
    }
    if (m_sURL.indexOf("/gcm/") > 0) {
        var m_sHostused = m_sURL.substring(m_sURL.indexOf("/gcm/") + 4, m_sURL.length);
    }
    //Evolution Start -- _urlpath is already been assigned by the first call of getEvolutionPath
    if (m_sHostused == "") {
        var pathArray = _urlpath.split("/");
        if (pathArray.length >= 4) {
            return pathArray[0] + "/" + pathArray[1] + "/" + pathArray[2] + "/" + pathArray[3];
        } else {
            return "";
        }
    }
    //Evolution End

    var m_sFSlash = new Array();
    var j = 0;
    for (var i = 0; i < m_sHostused.length; i++) {
        if (m_sHostused.charAt(i) == "/") {
            m_sFSlash[j] = i;
            j = j + 1;
        }
    }
    if (j > 6 && (m_sHostused.indexOf("&Filter=") < 0)) {
        var m_sProp4 = m_sHostused.substring(m_sFSlash[2] + 1, m_sFSlash[6]);
        //m_sProp4 = m_sProp4.replace(/\//g,"|");
        return m_sProp4
    }
    else {
        return ""
    }
}
function GetProp12() {
    var PageName = GetPageName();
    var Channel = GetChannel();
    var m_sProp12 = Channel + "|" + PageName;
    return m_sProp12;
}
function GetEvents() {
    if (typeof (TrackingEvents) !== 'undefined') {
        return TrackingEvents;
    }
    var m_sURL = document.URL
    var PageName = GetPageName();
    if (typeof (pageinfo) !== 'undefined') {
        if (pageinfo["title"] == "UCM Thank You") {
            return "event36"
        }
        else if (pageinfo["title"] == "UCM Registration") {
            return "event35"
        }
    }
    if (m_sURL.indexOf("hottopics/registration_form.htm") > 0) {
        return "event2"
    }
    else if (m_sURL.indexOf("hottopics/registration_download.htm") > 0) {
        return "event5"
    }
    //My Avaya //
    else if ((m_sURL.indexOf("my-avaya/myavayaregistration") > 0) && (PageName.indexOf("Registration") >= 0)) {
        return "event31"
    }
    else if ((m_sURL.indexOf("my-avaya/myavayaregistration") > 0) && (PageName.indexOf("Thank") >= 0)) {
        return "event32"
    }
    //Handle Products //
    else if ((m_sURL.indexOf("products/offers") > 0) && (m_sURL.indexOf("&View=") < 0)) {
        return "event12"
    }
    else if ((m_sURL.indexOf("products/offers") > 0) && (m_sURL.indexOf("&View=ProdOverview") > 0)) {
        return "event12"
    }
    else if ((m_sURL.indexOf("products/offers") > 0) && (m_sURL.indexOf("&View=ProdDesc") > 0)) {
        return ""
    }
    else if ((m_sURL.indexOf("products/offers") > 0) && (m_sURL.indexOf("&View=ProdFeatures") > 0)) {
        return ""
    }
    else if ((m_sURL.indexOf("products/offers") > 0) && (m_sURL.indexOf("&View=ProdTech") > 0)) {
        return ""
    }
    else if ((m_sURL.indexOf("products/offers") > 0) && (m_sURL.indexOf("&View=ProdResources") > 0)) {
        return ""
    }
    //Handle Services//
    else if ((m_sURL.indexOf("services/offers") > 0) && (m_sURL.indexOf("&View=") < 0)) {
        return "event12"
    }
    else if ((m_sURL.indexOf("services/offers") > 0) && (m_sURL.indexOf("&View=ServOverview") > 0)) {
        return "event12"
    }
    else if ((m_sURL.indexOf("services/offers") > 0) && (m_sURL.indexOf("&View=ServDesc") > 0)) {
        return ""
    }
    else if ((m_sURL.indexOf("services/offers") > 0) && (m_sURL.indexOf("&View=ServOfferings") > 0)) {
        return ""
    }
    else if ((m_sURL.indexOf("services/offers") > 0) && (m_sURL.indexOf("&View=ServResources") > 0)) {
        return ""
    }
    //Handle Solutions//
    else if ((m_sURL.indexOf("solutions/offers") > 0) && (m_sURL.indexOf("&View=") < 0)) {
        return "event12"
    }
    else if ((m_sURL.indexOf("solutions/offers") > 0) && (m_sURL.indexOf("&View=SolOverview") > 0)) {
        return "event12"
    }
    else if ((m_sURL.indexOf("solutions/offers") > 0) && (m_sURL.indexOf("&View=SolDesc") > 0)) {
        return ""
    }
    else if ((m_sURL.indexOf("solutions/offers") > 0) && (m_sURL.indexOf("&View=SolComponents") > 0)) {
        return ""
    }
    else if ((m_sURL.indexOf("solutions/offers") > 0) && (m_sURL.indexOf("&View=SolResources") > 0)) {
        return ""
    }
    else if ((m_sURL.indexOf("corpform/emailavayathankyou") > 0)) {
        return "event13"
    }
    else if ((m_sURL.indexOf("corpform/contactavaya") > 0)) {
        return "event14"
    }
    else {
        return ""
    }

}

function GetProp50() {
    if (typeof (TrackingProp50) !== 'undefined') {
        return TrackingProp50;
    }
    if (typeof (pageinfo) !== 'undefined') {
        if (pageinfo["title"] == "UCM Thank You") {
            return pageinfo["prop50"];
        }
    }
    return "";

}
function GetProp46() {
    if (typeof (TrackingProp46) !== 'undefined') {
        return TrackingProp46;
    }
    return "";
}
function GetVar32() {
    if (typeof (TrackingVar32) !== 'undefined') {
        return TrackingVar32;
    }
    return "";
}
function GetVar1() {
    if (typeof (TrackingVar1) !== 'undefined') {
        return TrackingVar1;
    }
    var m_sURL = document.URL
    var PageName = GetPageName();
    if (typeof (pageinfo) !== 'undefined') {
        if (pageinfo["title"] == "UCM Thank You") {
            return "UCM Software Trial"
        }
    }
    if (m_sURL.indexOf("hottopics/registration_form.htm") > 0) {
        return "Premium Documents"
    }
    if (m_sURL.indexOf("hottopics/registration_download.htm") > 0) {
        return "Premium Documents"
    }
    else if (m_sURL.indexOf("corpform/emailavayathankyou.htm") > 0) {
        return "Contact Us"
    }
    else if ((m_sURL.indexOf("my-avaya/myavayaregistration") > 0) && (PageName.indexOf("Thank") >= 0)) {
        return "My Avaya Registration"
    }
    else {
        return ""
    }
}
function GetProp48() {
    //s.prop48=’[anon | knwn | malgn | malgy]’
    if (readCookie("RegisteredUser") != null) {
        return "malgy";
    } else if (readCookie("MyAvayaUser") != null) {
        return "malgn";
    } else if (readCookie("RegID") != null) {
        return "knwn";
    } else {
        return "anon";
    }
}
function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}
