
function popUp(URL,width,height)
{
	day = new Date();
	id = day.getTime();
	var winLeft = (screen.width - width) / 2;
	var winUp = (screen.height - height) / 2;
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height+',left='+winLeft+',top='+winUp);");
}

function contact_by_mail(user, domain, suffix, content) {
	if (!content) {
		document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + user + '@' + domain + '.' + suffix + '</a>');
	} 
	else {
		document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + content + '</a>');
	}
	return true;
}

function writeCookie(callget) 
{
 var today = new Date();
 var the_date = new Date("December 31, 2023");
 var the_cookie_date = the_date.toGMTString();
 var the_cookie = "users_res="+ screen.width +"x"+ screen.height;
 var the_cookie = the_cookie + ";expires=" + the_cookie_date;
 document.cookie=the_cookie
 if (document.cookie){  
	location = ''+callget+'';
 }
 
}


function checkRes(callget, width, height) {
	if(width != screen.width || height != screen.height) {
		writeCookie(''+callget+'');
	} else {
		return true;
	}
}

/* To set bottom repeatable correct on the bottom */
function reposTopBottom() {
	var totalWidth = document.body.offsetWidth;
	var siteWidth = document.getElementById('center_hor').offsetWidth;
	var remainingWidth = (totalWidth - siteWidth) / 2;
	
	document.getElementById('top').style.left = "-" + remainingWidth + "px";
	document.getElementById('top').style.width = siteWidth + remainingWidth + remainingWidth + "px";
	
	document.getElementById('bottom').style.left = "-" + remainingWidth + "px";
	document.getElementById('bottom').style.width = siteWidth + remainingWidth + remainingWidth + "px";
	
	
	//var maxHeight = document.getElementById('center_hor').offsetHeight;
	//document.getElementById("bottom").style.top = maxHeight - 84 + "px";
}

function resizeCenter() {
	var maxHeight = document.body.clientHeight;
	var currentHeight = document.getElementById('center_hor').style.height;
	
	if(currentHeight > maxHeight) {
		document.getElementById('center_hor').style.height = maxHeight + "px";
	}
}

function setPlayer(status) {
	var params = 'status=' + status;
	new Ajax.Request('/special/ajax.setplayer.php', { parameters:params });
}


