function GetCookie(nom)
{
	var deb, fin;
	deb = document.cookie.indexOf(nom + '=');
	if (deb >= 0) 
	{
		deb += nom.length + 1;
		fin = document.cookie.indexOf(';', deb);
		if (fin < 0) fin = document.cookie.length;
		return unescape(document.cookie.substring(deb, fin));
	}
	return null;
}

function ChangeSize(taille, taille2) 
{
	var expireDate = new Date();
	expireDate.setTime(expireDate.getTime() + 31557600);
	document.getElementsByTagName('body')['0'].style.fontSize = taille+'px';
	document.getElementById('inc').style.fontSize = taille2+'pt';
	document.cookie = 'TextSize' + '=' + escape(taille + '+' + taille2) + ';expires=' + expireDate.toGMTString();
}

function Init()
{
	var cookie = GetCookie('TextSize');
	if(cookie != null) 
	{
		cookie = cookie.split('+');
		ChangeSize(cookie['0'], cookie['1']);
	}
}

function popup(url, name, width, height)
{
	window.open(url, name, 'top='+(screen.height-height)/2+', left='+(screen.width-width)/2+', height='+height+', width='+width+', toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no');
}

function areyousure(link)
{
	if(confirm('Are you sure you wish to carry out this action?'))
		window.location.href = link;
}

window.onload = Init;
