winbox=null;
var timer=6000;
function random(limits) {
     today = new Date();
     num = today.getTime();
     num = Math.round(Math.abs(Math.sin (num)*1000000)) % limits;
     return num;
}

/*
function changeLayout(i,t) {
	var max = 6;
	var r = random(max + 1);
	if (i != r && r > 0) {i = r;}
	else {i = i + 1;}
	if (i > max) {i = 1;}
	var x = document.getElementById("menu1");
	var l = new Image();
	l.src = "/fonds/fond" + i + ".jpg"; 
	// x.style.backgroundImage="url("+l.src+")";
	$("#backgroundImage").fadeIn("slow").src="+l.src+")");
	setTimeout('changeLayout('+(i)+','+t+')',t);
}
*/

function MsgBox(URL,w,h){
	if (winbox!=null){
		if (winbox.closed!=true){
		winbox.close();
		}
	}
	winbox=window.open(URL,"","width="+w+",height="+h+",toolbar=no,menubar=no,location=no,scrollbars=yes,resize=yes,resizable=yes");
	winbox.focus();
}

function MsgBoxFix(URL,w,h){
	if (winbox!=null){
		if (winbox.closed!=true){
		winbox.close();
		}
	}
	winbox=window.open(URL,"","width="+w+",height="+h+",toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,resizable=no");
	winbox.focus();
}


// Open popups for registration stuff
function reg_popup(name,params)
{
	window.focus();
	url = "./chat/" + name + ".php3?L=french&Link=1&"+params;
	pop_width = (name != 'admin'? 350:510);
	pop_height = (name != 'deluser'? 470:190);
	param = "width=" + pop_width + ",height=" + pop_height + ",resizable=yes,scrollbars=yes";
	name += "_popup";
	window.open(url,name,param);
	}

// Open popups for all the rest !!
function open_popup(name,params,pop_width,pop_height)
{
	window.focus();
	url = "./fr/" + name + ".php?"+ params ;
	param = "width=" + pop_width + ",height=" + pop_height + ",resizable=no,scrollbars=no";
	name += "_popup_all";
	window.open(url,name,param);
}