var fontSize = 1;
var minFontSize = 1;
var maxFontSize = 3;

// Set a cookie value
function setCookie(c_name,value,expiredays)
{  var exdate=new Date()
	 exdate.setDate(exdate.getDate()+expiredays)
	 document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString() +";path=/")
} 

// get a cookie value
function getCookie(c_name)
	{if (document.cookie.length>0)
		{  c_start=document.cookie.indexOf(c_name + "=")
		if (c_start!=-1)
			{ c_start=c_start + c_name.length+1 
			  c_end=document.cookie.indexOf(";",c_start)
			  if (c_end==-1) c_end=document.cookie.length
				{return unescape(document.cookie.substring(c_start,c_end))}
			} 
		}
	return 0
}

function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		 if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
		   a.disabled = true;
		   
		   if(a.getAttribute("title") == title) {
		   	 a.disabled = false;
		   }
		 }
   }
}
	
//Pour agrandir le texte
function changeFontSize()
{
	if (fontSize < maxFontSize)
	{
		ChangeFontSize(1)
	}
	else {
		fontSize = minFontSize
		ChangeFontSize(0)
	}
}

//Pour reduire le texte
function InitFontSize()
{
	fontSize = getCookie ("fontSize")
	
	if (fontSize == 0)
		{fontSize = minFontSize}
		
	ChangeFontSize(0)
}

//Pour changer la grosseur du texte
function ChangeFontSize(value)
{
	fontSize = Number(fontSize) + Number(value);
	setCookie ("fontSize", fontSize+'', 7)
	setActiveStyleSheet(fontSize);
	
}