//Determine Unit
var currentURL = location.href;
switch(region){
	case "US English":
		if(currentURL.match("index") == "index"){
        unit = "Home";
	    }
	    else if(currentURL.match("private-banks") == "private-banks"){
	        unit = "Banks";
	    }
	    else if(currentURL.match("banks") == "banks"){
	        unit = "Banks";
	    }
	    else if(currentURL.match("financial-advisors") == "financial-advisors"){
	        unit = "Advisors";
	    }
	    else if(currentURL.match("advisors") == "advisors"){
	        unit = "Advisors";
	    }
	    else if(currentURL.match("institutional-investors") == "institutional-investors"){
	        unit = "Institutions";
	    }
	    else if(currentURL.match("institutions") == "institutions"){
	        unit = "Institutions";
	    }
	    else if(currentURL.match("investment-managers") == "investment-managers"){
	        unit = "IMS";
	    }
	    else if(currentURL.match("im") == "im"){
	        unit = "IMS";
	    }
	    else if(currentURL.match("premium") == "premium"){
	        unit = "IMS Premium";
	    }
	    else if(currentURL.match("individuals") == "individuals"){
	        unit = "Wealth";
	    }
	    else if(currentURL.match("wealthnetwork") == "wealthnetwork"){
	        unit = "Wealth";
	    }
	    else{
	        unit = "Corporate";
	    }
	break;
	
	case "CA English":
		if(currentURL.match("index") == "index"){
	        unit = "Home";
	    }
	    else if(currentURL.match("financial-advisors") == "financial-advisors"){
	        unit = "Advisors";
	    }
	    else if(currentURL.match("advisors") == "advisors"){
	        unit = "Advisors";
	    }
	    else if(currentURL.match("clients") == "clients"){
	        unit = "Advisor Clients";
	    }
	    else if(currentURL.match("institutional-investors") == "institutional-investors"){
	        unit = "Institutions";
	    }
	    else if(currentURL.match("institutions") == "institutions"){
	        unit = "Institutions";
	    }
	    else{
	        unit = "Corporate";
	    }
	break;
	
	case "UK English":
		if(currentURL.match("index") == "index"){
	        unit = "Home";
	    }
	    else if(currentURL.match("banks-and-advisers") == "banks-and-advisers"){
	        unit = "Banks and Advisers";
	    }
	    else if(currentURL.match("banks") == "banks"){
	        unit = "Banks and Advisers";
	    }
	    else if(currentURL.match("adviser-clients") == "adviser-clients"){
	        unit = "Adviser Clients";
	    }
	    else if(currentURL.match("advisers") == "advisers"){
	        unit = "Adviser Clients";
	    }
	    else if(currentURL.match("clients") == "clients"){
	        unit = "Adviser Clients";
	    }
	    else if(currentURL.match("institutional-investors") == "institutional-investors"){
	        unit = "Institutions";
	    }
	    else if(currentURL.match("institutions") == "institutions"){
	        unit = "Institutions";
	    }
	    else if(currentURL.match("investment-managers") == "investment-managers"){
	        unit = "IMS";
	    }
	    else if(currentURL.match("im") == "im"){
	        unit = "IMS";
	    }
	    else{
	        unit = "Corporate";
	    }
	break;
	
	case "HK English":
		if(currentURL.match("index") == "index"){
	        unit = "Home";
	    }
	    else if(currentURL.match("private-banks") == "private-banks"){
	        unit = "Banks";
	    }
	    else if(currentURL.match("banks") == "banks"){
	        unit = "Banks";
	    }
	    else if(currentURL.match("institutional-investors") == "institutional-investors"){
	        unit = "Institutions";
	    }
	    else if(currentURL.match("institutions") == "institutions"){
	        unit = "Institutions";
	    }
	    else{
	        unit = "Corporate";
	    }
	break;
	
	case "SA English":
		if(currentURL.match("index") == "index"){
	        unit = "Home";
	    }
	    else if(currentURL.match("institutional-investors") == "institutional-investors"){
	        unit = "Institutions";
	    }
	    else if(currentURL.match("institutions") == "institutions"){
	        unit = "Institutions";
	    }
	    else{
	        unit = "Corporate";
	    }
	break;
	
	case "CA French":
		if(currentURL.match("index") == "index"){
	        unit = "Home";
	    }
	    else if(currentURL.match("conseillers-financiers") == "conseillers-financiers"){
	        unit = "Advisors";
	    }
		else if(currentURL.match("advisors") == "advisors"){
	        unit = "Advisors";
	    }
	    else if(currentURL.match("investisseurs-institutionnels") == "investisseurs-institutionnels"){
	        unit = "Institutions";
	    }
		else if(currentURL.match("institutions") == "institutions"){
	        unit = "Institutions";
	    }
	    else{
	        unit = "Corporate";
	    }
	break;
	
	case "ME English":
		if(currentURL.match("index") == "index"){
	        unit = "Home";
	    }
	    else if(currentURL.match("distribution-partnerships") == "distribution-partnerships"){
	        unit = "Distribution Partnerships";
	    }
	    else if(currentURL.match("banks") == "banks"){
	        unit = "Distribution Partnerships";
	    }
		else if(currentURL.match("investment-managers") == "investment-managers"){
	        unit = "IMS";
	    }
		else if(currentURL.match("im") == "im"){
	        unit = "IMS";
	    }
	    else{
	        unit = "Corporate";
	    }
	break;
	
	case "NL Dutch":
		if(currentURL.match("index") == "index"){
	        unit = "Home";
	    }
	    else if(currentURL.match("institutionele-beleggers") == "institutionele-beleggers"){
	        unit = "Institutions";
	    }
	    else if(currentURL.match("institutions") == "institutions"){
	        unit = "Institutions";
	    }
	    else{
	        unit = "Corporate";
	    }
	break;
}

s.channel = region + ": " + unit;

//404 Page Info
if(document.title.match("404") == "404"){
        s.pageType="errorPage"
}

//Prop 10 code
var secondNav = "";
var terchNav = "";
s.prop10 = "";
$(".box_content li.active").each(function(){
        secondNav = $(this).find('a').html();
        s.prop10 = secondNav;
    });
$(".active_has_child").each(function(){
    secondNav = $(this).find('a').html();
    s.prop10 = secondNav;
    $(".active_has_child .active").each(function(){
        terchNav = $(this).find('a').html();
        s.prop10 = secondNav + " : " + terchNav;
    });
});

//read cookie
var infEmail = $.cookie('seic_infEmail');
var isEmail = false;
if (infEmail == null){
    var hash = window.location.hash;
	var hashValue = hash.split("#");
	if (hashValue[1] !=null){
		var hashValueCheck = hashValue[1].split("=");
		if (hashValueCheck[0] == "email") {
			infEmailVal = hashValueCheck[1];
			window.location.hash = "";
			isEmail = true;
		}
		$.cookie('seic_infEmail', infEmailVal, {path: '/', expires: 90});
		console.log($.cookie('seic_infEmail'));
	}
}

if (isEmail == true) {
	window.location.hash = "";
}


//read cookie and set user
s.prop5 = $.cookie('seic_infEmail');
s.prop14 = $.cookie('seic_infFuture');
if (s.prop5 == null){
	s.prop5 = infEmail;
}

function queryString(ji) {
    urlLocal = window.location.search.substring(1);
    gy = urlLocal.split("&");
    for (i=0;i<gy.length;i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
            return ft[1];
        }
    }
}



/* DO NOT ALTER ANYTHING BELOW THIS LINE ! */
var s_code=s.t();if(s_code)document.write(s_code)