var temp = "no";
	var path= location.pathname;
	var built_url = location.protocol+"//"+location.host+"/"+path.split("/")[1];

	
try
{
	var cur_symbol="&#163;";
	if(cur == "978")
		cur_symbol="&#8364;";
	if(cur == "208")
		cur_symbol="kr";

	ChangeState("uname",username);
	/*ChangeState("fname",firstname);
	ChangeState("lname",surname);
	ChangeState("pwd",'********');
	ChangeState("security",'********');
	ChangeState("email",email);
	if((news=='Y')&&(mime=='H'))
		{
			ChangeState("news",'YES,Html Format');
		}
		else  if((news=='Y')&&(mime=='T'))
		{
			ChangeState("news",'YES,Text Format');
		}
		else
		{
			ChangeState("news",'No,Thankyou.');
		}
	
 			ChangeState("addr1",house+','+street);
			ChangeState("addr2",town);
			ChangeState("addr3",pcode);
			ChangeState("country",country);
			ChangeState("pno",pno);
			ChangeState("mno",mno);
			ChangeState("cname",cname);
			ChangeState("cno",cno);
			ChangeState("csecurityno",'********');*/
			ChangeState("the_usernameright",username);
			ChangeState("realbal",formatted_bal);
			ChangeState("bonbal",formatted_bonus);
			ChangeState("tollypoints",points);
			ChangeState("loyalty",loyalty);


	if(levelId == '1')
	{
		ChangeState("carddetails","")
	}
}
catch(ignore)
{
	
}

function cardverify()
{
		if(bal>minChangeCardDepAmt)
		{
			location.href=built_url+"/bingo/account/card_accessdenied.thtml";
		}
		else
		{
			location.href=built_url+"/bingo/account/change_card.thtml";
		}

}

function checkdeposit()
{
	if(levelId == 1)
	{
		location.href=built_url+"/bingo/registration/registration_step2.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 == "EWIRE")
	{
		location.href = built_url+"/bingo/account/ewiredeposit.thtml";
	}
	else if(ctype == "BTR")
	{
		location.href=built_url+"/bingo/account/bank_transfer_deposit.thtml";
	}
	else if(ctype == "NET")
	{
		location.href = built_url+"/bingo/account/neteller_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("inside of withdraw validation < 10");
		alert("Du har ikke nok penge til at foretage en udbetaling");
	}
	else
	{
		location.href="/commonapp/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("Du saknar tillräckligt med lojalitetspoäng");
	}
	else
	{
		location.href=built_url+"/bingo/account/redeem.thtml";
  }
}

function changeexpdate()
{
  location.href=built_url+"/bingo/account/editcardexp.thtml"
}