var compteur_style = 0;
var taille_initiale = 10;

function affecteTaille(compteur_style){
	var taille_final = taille_initiale+parseInt(compteur_style);
	document.getElementsByTagName("body")[0].style.fontSize = taille_final+"px";
	SetCookie("compteur_style", compteur_style);
}


function augmenteTaille(){
	var compteur_style = GetCookie("compteur_style");
	compteur_style++;
	affecteTaille(compteur_style)
}

function diminueTaille(){
	var compteur_style = GetCookie("compteur_style");
	compteur_style--;
	affecteTaille(compteur_style);
}


window.onload = function(e) {
  	var compteur_style = GetCookie("compteur_style");
	affecteTaille(compteur_style);
}


function SetCookie (name, value) {
	var argv=SetCookie.arguments;
	var argc=SetCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path= "/";
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=name+"="+escape(value)+
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
}


function GetCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) &&( name != document.cookie.substring( 0, name.length ) ) ){
		return 0;
	}
	if ( start == -1 ) return 0;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}


