//
//  THIS FILE IS SERVED FROM COMMONAPACHE SERVER.
//
try{
document.getElementById("jackpot1").innerHTML=jackpot1;
document.getElementById("jackpot2").innerHTML=jackpot2;
}catch(e){}

var cur_symbol="&#163;";
try
{
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);


	//Added for Common Header
	ChangeState("header_realbal",cur_symbol+bal);
	ChangeState("header_bonbal",cur_symbol+bonus);
	ChangeState("header_loyalty",loyalty);
}catch(e){}

function checkdeposit()
{
        if(levelId == 1)
		{
				location.href=built_url+"/bingo/registration/registration_step2.thtml"
		}
		else if((ctype == "NET"))
		{
			location.href=built_url+"/bingo/account/neteller_deposit.thtml";
		}
		else if(ctype == 'MB')
		{
			location.href = built_url+"/bingo/account/moneybookers_deposit.thtml";
		}
		else if(ctype == 'PSC')
		{
			location.href = built_url+"/bingo/account/paysafe_deposit.thtml";
		}
		else if(ctype=='UKA')
		{
			
			location.href=built_url+"/bingo/account/ukashdeposit.thtml";
		}
		else if(ctype=='PP')
		{
			
			location.href=built_url+"/bingo/account/paypal_deposit.thtml";
		}
		else if(ctype=='CTD')
		{			
			location.href=built_url+"/bingo/account/citadel_deposit.thtml";
		}
		else
		{
			location.href=built_url+"/bingo/account/deposit.thtml";
		}
}

function checkwithdraw()
{
        
        if(levelId == 1)
        {
                location.href=built_url+"/bingo/registration/registration_step2.thtml";
        }
        else if((levelId == 2)&&(bal < 10))
        {
                alert("Insufficient funds available");
        }
        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("Insufficient loyalty points available");
        }
        else
        {
                location.href=built_url+"/bingo/account/redeem.thtml";
        }

}

function checkredeemBonus()
{
	location.href=built_url+"/bingo/account/redeembonus.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;
