
var cur_symbol="&#163;";
	//alert("cur="+cur);



		try
		{
				document.getElementById("the_usernameright").innerHTML=username;	
				document.getElementById("realbal").innerHTML=cur_symbol+bal;
				document.getElementById("bonbal").innerHTML=cur_symbol+bonus;
				document.getElementById("tollypoints").innerHTML=points;
				document.getElementById("loyalty").innerHTML=loyalty;
		}
		catch(e) {}
		

//-->


function checkdeposit()
{
	if(levelId == 1)
	{
		location.href="/slotmine/casino/registration/registration_step2.thtml";
	}
	else if((ctype == "NET"))
	{
		location.href="/slotmine/casino/account/netellerdeposit.thtml";
	}
	else if(ctype=='MB')
	{
		location.href="/slotmine/casino/account/moneybookers_deposit.thtml";
	}
	else if(ctype == "PSC")
	{
		location.href = "/slotmine/casino/account/paysafe_deposit.thtml";
	}
	else if(ctype=='UKA')
	{
		location.href="/slotmine/casino/account/ukashdeposit.thtml";
	}
	else
	{
        location.href="/slotmine/casino/account/deposit.thtml";
    }
}
function checkwithdraw()
{
	
	if(levelId == 1)
	{
		location.href="/slotmine/casino/registration/registration_step2.thtml";
	}
	else if((levelId == 2)&&(bal < 10))
	{
		alert("Insufficient funds to withdraw");
	}
	else
	{
		location.href="/commonsys/withdraw/WithdrawView.do";
	}
	
}
function allTransactions(transType)
{

if(levelId == 1)
{
	location.href="/slotmine/casino/registration/registration_step2.thtml";
}
else
{
document.getElementById(transType).href="../../../deposit/common_transactions.html?type="+transType;
NewWindow(document.getElementById(transType).href,'mywin','600','550','yes','center');
return false;
}
}

function createRequestObject() {
    var httprReqobj;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        try{
                        httprReqobj = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(recreate){
                httprReqobj = new XMLHttpRequest();
        }
    }else{
        httprReqobj = new XMLHttpRequest();
    }
    return httprReqobj;
}

var balhttp_request = createRequestObject();
function getBalance()
{
        //alert('in getBalance');
        balhttp_request.open("POST",context+"/account/balance_retriver.jsp",true);
        balhttp_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        balhttp_request.setRequestHeader("Content-length", 0);
        balhttp_request.setRequestHeader("Connection", "close");
        balhttp_request.send(null);
        balhttp_request.onreadystatechange = handleBalResponse;
}
function handleBalResponse() {
                if(balhttp_request.readyState == 4)
				{
						try
						{
							response = balhttp_request.responseText;
							//alert(response)
							if(balhttp_request.status == 200)
							{
								
									 var account_res = response.split('&');
									 formatted_bal = account_res[0].split("=")[1];
									 formatted_bonus = account_res[1].split("=")[1];
									//ChangeState("realbal",cur_symbol+parseFloat(formatted_bal).toFixed(2));
									ChangeState("realbal",formatted_bal);
									ChangeState("midbal",formatted_bal);


										setTimeout("getBalance()", 5000);
						}
						}catch(e) {}
               }
}

//added by Ram
function checkredeem()
{
    if(loyalty <= 0 )
	{
        alert("You don't have sufficient loyalty points to redeem");
	}
	else
	{
		location.href="/slotmine/casino/account/redeem.thtml";
  }
}


setTimeout("getBalance()", 5000);



