function include (lib) {
	document.write('<script type="text/javascript" src="' + lib + '"></script>');
}

include('scripts/cookie.js');

window.onload = change_window_size;
window.onresize = change_window_size;

function change_window_size () {
	var marge;
	if  (document.width > 800)
		marge = (document.width - 800) * 200 / (1600 - 800);
	else
		marge = 0;
	document.getElementById("main").style.width = "200px";
	
	if  (document.width > 400)
		document.getElementById("main").style.width = (document.width - 200 - marge * 2) + "px";
	else
		document.getElementById("main").style.width = (document.width - 20) + "px";

	document.getElementsByTagName("body")[0].style.padding = "0px "
		+ marge + "px 0px " + marge + "px";
	document.getElementById("banner").style.width = document.width - marge;
}

function change_skin (name) {
	document.location = "?skin=" + name;
}

function md5(str)
{
	return hex_md5(str) ;
}

function createXMLHttpRequest () {
	if(window.XMLHttpRequest) // FIREFOX
		return new XMLHttpRequest();
	else if(window.ActiveXObject) // IE
	return new ActiveXObject("Microsoft.XMLHTTP");
	else
		return(false);
	
}

function txtopen(fichier)
{
	xhr_object = createXMLHttpRequest();
	xhr_object.open("GET", fichier, false);
	xhr_object.send(null);
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}

