var path= location.pathname;
var built_url = location.protocol+"//"+location.host+"/"+path.split("/")[1];

try{
	document.getElementById("jackpot1").innerHTML=jackpot1;
	document.getElementById("jackpot2").innerHTML=jackpot2;
}catch(e){}

try{
var cur_symbol="&#163;";
if(cur == "978")
		cur_symbol="&#8364;";
ChangeState("the_usernameright",username);
ChangeState("realbal",cur_symbol+bal);
ChangeState("realbal1",cur_symbol+bal);
ChangeState("bonbal",cur_symbol+bonus);
ChangeState("loyalty",loyalty);
}catch(e){}

function checkdeposit()
{
	if(levelId == 1)
	{
		location.href=built_url+"/bingo/registration/registration_step2.thtml";
	}
	else if(ctype == "UKA")
	{
		 location.href =built_url+"/bingo/account/ukashdeposit.thtml";
	}
	else if(ctype == 'MB')
	{
		 location.href =built_url+"/bingo/account/moneybookers_deposit.thtml";
	}
	else if(ctype == "NET")
	{
		location.href =built_url+"/bingo/account/neteller_deposit.thtml";
	}
	else if((ctype == "EPG"))
	{
		location.href=built_url+"/bingo/corporate/info/12730/deposito-mediante-epagado.thtml";		
	}
	else if((ctype == "BTR"))
	{
		location.href=built_url+"/bingo/corporate/info/12469/deposito-mediante-transferencia-bancaria.thtml";

	}
	else if(ctype == 'PSC')
	{
		 location.href =built_url+"/bingo/account/paysafedeposit.thtml";
	}
	else if(ctype == 'ENV')
	{
		 location.href =built_url+"/bingo/account/envoydeposit.thtml";
	}
	else
	{
        location.href=built_url+"/bingo/account/deposit.thtml";
    }
}


function checkwithdraw()
{
	
	if(levelId == 1)
	{
		location.href=built_url+"/bingo/account/deposit.thtml";
	}
	else if((levelId == 2)&&(bal < 10))
	{
		alert("Uw balans is te laag om uitbetalingen af te handelen");
	}
	else
	{
		location.href=built_url+"/withdraw/WithdrawView.do";
	}
}

function allTransactions(transType)
{
        if(levelId == 1)
        {
		location.href=built_url+"/bingo/registration/registration_step2.thtml";
		}
        else
        {
		document.getElementById(transType).href=built_url+"/deposit/common_transactions.html?type="+transType;
        NewWindow(document.getElementById(transType).href,'mywin','600','550','yes','center');
        return false;
        }
}

function checkredeem()
{
    if(loyalty <= 0)
        {
	        alert("Je hebt niet genoeg loyaliteit punten om in te wisselen");
        }
        else
        {
			location.href=built_url+"/bingo/account/redeem.thtml";
		}

}
function submitTrackers(trackerUrlsList,indexValue)
{
	var i=indexValue,flag=0;
	if( trackerUrlsList.length < indexValue+1 )
	{
		return;
	}
	else
	{
	try{
		var browser = navigator.appName;
		if(trackerUrlsList[indexValue].indexOf("scriptIncludes")!=-1)
			{
				if(browser == "Microsoft Internet Explorer")
				{
					if(indexValue!=trackerUrlsList.length)
					{
						document.getElementById("tracking").src= trackerUrlsList[indexValue];
						document.getElementById("tracking").onLoad = submitTrackers(trackerUrlsList,indexValue+1)
					}
				}
				else
				{
					document.getElementById("tracking").onLoad = submitTrackers(trackerUrlsList,indexValue+1)
					document.getElementById("tracking").src= trackerUrlsList[indexValue];
				}		
			}
		else
			{
				var img = new Image();
				if(browser == "Microsoft Internet Explorer")
				{
					if(indexValue!=trackerUrlsList.length)
					{
						img.src = trackerUrlsList[indexValue]+'&'+Math.round(Math.random()*1000); 
						img.onLoad = submitTrackers(trackerUrlsList,indexValue+1)
					}
				}
				else
				{
					img.onLoad = submitTrackers(trackerUrlsList,indexValue+1)
					img.src = trackerUrlsList[indexValue]+'&'+Math.round(Math.random()*1000); 
				}		
			}
		}catch(e){}
	}
}

function onLoadFunctions()
{
	try{allLobbyPageLoad();}catch(e){}
	try{showpopup();}catch(e){}
}
window.onload = onLoadFunctions