function SetWebTrendsPropertiesFromLocalProperties(tag)
{
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);	

	if (sPage == "registration-step-3") {
	    //2011-09-30-RxG-(JIRA VG-674) - Temporary fix until can deploy Thor again - Start of DoubleClick Floodlight Tag: Please do not remove
		var axel = Math.random() + "";
		var a = axel * 10000000000000;
		document.write('<iframe src="https://fls.doubleclick.net/activityi;src=938220;type=rvbco195;cat=rvbre363;u5=' + _tag.DCS.dcsaut + ';ord=1;num=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
        
        //Start of DoubleClick Floodlight Tag: Please do not remove
        //Activity name of this tag: Poker Registration Confirmation
        //Creation Date: 04/19/2011
        var axel = Math.random() + "";
        var a = axel * 10000000000000;
        document.write('<iframe src="https://fls.doubleclick.net/activityi;src=938220;type=virgi297;cat=poker791;u5=' + _tag.DCS.dcsaut + ';u3=[registration id];u2=[user ID];ord=1;num=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
    }

	else if(sPage == "register.aspx"){
		tag.WT.si_n="signup-deposit";
		tag.WT.si_p="reg";
	}else if(sPage == "RegisterConfirm.aspx"){
		tag.WT.si_n="signup-deposit";
		tag.WT.si_p="regSuccess";
		SetCookie("Reg");
	}else if(sPage == "kyc.aspx" && checkCookie("Reg")){
		tag.WT.si_n="signup-deposit";
		tag.WT.si_p="kyc";
	}else if(sPage == "kyc.aspx" && !checkCookie("Reg")){
		tag.WT.si_n="first-deposit";
		tag.WT.si_p="kyc";
		SetCookie("FirstDeposit");
	}else if(sPage == "depositmethod.aspx" && checkCookie("Reg")){
		tag.WT.si_n="signup-deposit";
		tag.WT.si_p="paymentMethod";
	}else if(sPage == "depositmethod.aspx" && checkCookie("FirstDeposit")){
		tag.WT.si_n="first-deposit";
		tag.WT.si_p="paymentMethod";
	}else if(sPage == "deposit.aspx" && checkCookie("Reg")){
		tag.WT.si_n="signup-deposit";
		tag.WT.si_p="deposit";
	}else if(sPage == "deposit.aspx" && checkCookie("FirstDeposit")){
		tag.WT.si_n="first-deposit";
		tag.WT.si_p="deposit";
	}else if(sPage == "deposit.aspx"){
		tag.WT.si_n="deposit";
		tag.WT.si_p="deposit";
	}else if(sPage == "depositconfirm.aspx" && checkCookie("Reg")){
		tag.WT.si_n="signup-deposit";
		tag.WT.si_p="depositConfirm";
	}else if(sPage == "depositconfirm.aspx" && checkCookie("FirstDeposit")){
		tag.WT.si_n="first-deposit";
		tag.WT.si_p="depositConfirm";
	}else if(sPage == "depositconfirm.aspx"){
		tag.WT.si_n="deposit";
		tag.WT.si_p="depositConfirm";
	}
}

function SetCookie(key){

	//cookie lasts 20mins
	var time = new Date();
	time2 = time.getTime()+(20*1000*60);
	time.setTime(time2);
	var expires = time.toGMTString();
	document.cookie = key+"=true; expires="+expires;
}

function checkCookie(key){
	var cookiecontent = new String();
	if(document.cookie.length > 0) {
		var cookiename = key;
		var cookiebegin = document.cookie.indexOf(cookiename);
		var cookieend = 0;
		if(cookiebegin > -1) {
			cookiebegin += cookiename.length;
			cookieend = document.cookie.indexOf(";",cookiebegin);
			if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
			cookiecontent = document.cookie.substring(cookiebegin+1,cookieend);
		}
	}
	if(cookiecontent == "true")
		return true;
	return false;
}
