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;";

	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",cur_symbol+bal);
			ChangeState("realbal1",cur_symbol+bal);
			ChangeState("bonbal",cur_symbol+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 == "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 == "CTD"))
	{
		location.href=built_url+"/bingo/account/citadel_deposit.thtml";
	}
	else
	{
        location.href=built_url+"/bingo/account/deposit.thtml";
    }
	
}*/
function checkdeposit()
{
    if(levelId == 1) {
        location.href=built_url+"/bingo/registration/registration_step2.thtml";
    } else {
        location.href=built_url+"/deposit/depositView.do";
    }
}
function checkwithdraw()
{
	
	if(levelId == 1)
	{
		location.href=built_url+"/bingo/account/deposit.thtml";
	}
	else if((levelId == 2)&&(bal < 10))
	{
		alert("No hay suficientes fondos para efectuar el reintegro");
	}
	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("No tiene suficientes puntos para canjear");
	}
	else
	{
		location.href=built_url+"/bingo/account/redeem.thtml";
  }
}

function changeexpdate()
{
  location.href=built_url+"/bingo/account/editcardexp.thtml"
}


function Browser() {

var ua, s, i;

this.isIE = false;
this.isNS = false;
this.version = null;

ua = navigator.userAgent;

s = "MSIE";
if ((i = ua.indexOf(s)) >= 0) {
this.isIE = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}

s = "Netscape6/";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}

// Treat any other "Gecko" browser as NS 6.1.

s = "Gecko";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = 6.1;
return;
}
}

var browser = new Browser();

// Global object to hold drag information.

var dragObj = new Object();
dragObj.zIndex = 0;

function dragStart(event, id) {

var el;
var x, y;

// If an element id was given, find it. Otherwise use the element being
// clicked on.

if (id)
dragObj.elNode = document.getElementById(id);
else {
if (browser.isIE)
dragObj.elNode = window.event.srcElement;
if (browser.isNS)
dragObj.elNode = event.target;

// If this is a text node, use its parent element.

if (dragObj.elNode.nodeType == 3)
dragObj.elNode = dragObj.elNode.parentNode;
}

// Get cursor position with respect to the page.

if (browser.isIE) {

x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
}
if (browser.isNS) {
x = event.clientX + window.scrollX;
y = event.clientY + window.scrollY;
}

// Save starting positions of cursor and element.

dragObj.cursorStartX = x;
dragObj.cursorStartY = y;
dragObj.elStartLeft = parseInt(dragObj.elNode.style.left, 10);
dragObj.elStartTop = parseInt(dragObj.elNode.style.top, 10);

if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 10;
if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 500;
// Update element's z-index.

dragObj.elNode.style.zIndex = ++dragObj.zIndex;

// Capture mousemove and mouseup events on the page.

if (browser.isIE) {
document.attachEvent("onmousemove", dragGo);
document.attachEvent("onmouseup", dragStop);
window.event.cancelBubble = true;
window.event.returnValue = false;
}
if (browser.isNS) {
document.addEventListener("mousemove", dragGo, true);
document.addEventListener("mouseup", dragStop, true);
event.preventDefault();
}
}

function dragGo(event) {

var x, y;

// Get cursor position with respect to the page.

if (browser.isIE) {
x = window.event.clientX + document.documentElement.scrollLeft
+ document.body.scrollLeft;
y = window.event.clientY + document.documentElement.scrollTop
+ document.body.scrollTop;
}
if (browser.isNS) {
x = event.clientX + window.scrollX;
y = event.clientY + window.scrollY;
}

// Move drag element by the same amount the cursor has moved.

dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
dragObj.elNode.style.top = (dragObj.elStartTop + y - dragObj.cursorStartY) + "px";

if (browser.isIE) {
window.event.cancelBubble = true;
window.event.returnValue = false;
}
if (browser.isNS)
event.preventDefault();
}

function dragStop(event) {

// Stop capturing mousemove and mouseup events.

if (browser.isIE) {
document.detachEvent("onmousemove", dragGo);
document.detachEvent("onmouseup", dragStop);
}
if (browser.isNS) {
document.removeEventListener("mousemove", dragGo, true);
document.removeEventListener("mouseup", dragStop, true);
}
}

function openLiveHelp(){

	if(levelId == 2){
		if (browser.isIE){
			window.open('http://livechat.stenodoc.com/cgi-local/start.cgi/apps/livehelp/index.html?gids=Bingo&label=FD%20SP','LHC_'+Math.floor(Math.random()*100000),'left=10,top=10,resizable,height=355,width=400');
		}
		else{
			document.getElementById('boxToDrag').style.display='block';
			document.getElementById('iframeLive').src='http://livechat.stenodoc.com/cgi-local/start.cgi/apps/livehelp/index.html?gids=Bingo&label=FD%20SP';
		}
	}else if(levelId == 1){
		if (browser.isIE){
			window.open('http://livechat.stenodoc.com/cgi-local/start.cgi/apps/livehelp/index.html?gids=Bingo&label=Reg%20SP','LHC_'+Math.floor(Math.random()*100000),'left=10,top=10,resizable,height=355,width=400');
		}
		else{
			document.getElementById('boxToDrag').style.display='block';
			document.getElementById('iframeLive').src='http://livechat.stenodoc.com/cgi-local/start.cgi/apps/livehelp/index.html?gids=Bingo&label=Reg%20SP';
		}
	}
		
	return false;
}
function closeWindow(){
	document.getElementById('boxToDrag').style.display='none';
	document.getElementById('iframeLive').src='';
	return false;
}

