function toggle(id,from){
	var a = document.getElementById(id);
	if (a.style.display == 'block')
		a.style.display = 'none';
	else
		a.style.display = 'block';
	if (from == 'right'){
		var scwidth = screen.width;
		a.style.right = ((scwidth - 1000) / 2) + 'px';
	}
}

function openitem(link){
	window.open(link,"wopen","statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=620,height=400");
}

function refreshCode(id,link){
	var e = document.getElementById(id);
	var tmp = new Date();
	if (link.indexOf("?") != -1){
		tmp = "&"+tmp.getTime();
	}
	else{
		tmp = "?"+tmp.getTime();
	}
	e.src=link+tmp;
}

function ran(){
	out="";
	for(i=1;i<=len;i++){
		while(1){
			r=Math.random();
			if(r!=1)break;
		}
		r=""+Math.floor(r*10);
		out=out+r;
	}
	return out;
}

var background = new Array();
background[0] = ["background_01",""];
background[1] = ["background_02",""];
//background[2] = ["background_03","logo_paytobet_white.png"];
//background[3] = ["background_04","logo_paytobet_white.png"];
//background[4] = ["background_05","logo_paytobet_white.png"];

function setbgheader(){
	var e = background.length;
	e = e - 1;

	len = ("" + e).length;
	var s;
	while (1){
		s = eval(ran());
		if (s <= e)
			break;
	}
	//document.getElementById("weblogo").src = "images/"+background[s][1];
	document.getElementById("headerbg").className = background[s][0];
}
