$(document).ready(function()
	{
	$(function () {
  
		
		function setCookie(value){
			document.cookie = "textSize="+value+"; expires=; path=/";
		}
		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 "";
		}
		
		
		function getActualSize(){
			var actualSizePx = $("body").css("font-size");
			var actualSize = actualSizePx.substr(-0,2);
			//alert(actualSize);
		return actualSize;
		
		
		}
//////////Make me bigger or smaller, I dont care
		
		getSize = getCookie("textSize");
		if(getSize!=null && getSize!=""){
			$("body").css({"font-size":""+getSize+""});
			getActualSize();	
		};

		$("#accessibilite-icon-moins").click(function(){
			showSize = getActualSize();
			parseSize = parseInt(showSize,10);
			var newSize = parseSize - 1;
			$("body").css({"font-size":newSize + "px"});
			setCookie(""+ newSize + "px");
			getActualSize();
			//alert(newSize);
		});
		$("#accessibilite-icon-plus").click(function(){
			showSize = getActualSize();
			parseSize = parseInt(showSize,10);
			var newSize = parseSize + 1;
			$("body").css({"font-size":newSize + "px"});
			setCookie(""+ newSize + "px");
			getActualSize();
			//alert(newSize);		
		});
		$("#accessibilite-icon-texte").click(function(){
			showSize = getActualSize();
			$("body").css({"font-size":"12px"});
			setCookie("12px");
			getActualSize();	
		});
		
		
//////////Print me
		$("#accessibilite-icon-print").click(function(){
			window.print();
		});
		
/////////She s The Form, you have to do what she say...
		$("#Layout").find(":text").each(function(){
			$(this).addClass("text");
		});
		$("#Layout").find(":password").each(function(){
			$(this).addClass("text");
		});
		$("#Layout").find(":checkbox").each(function(){
			$(this).addClass("check");
		});
		$("#Layout").find(":submit").each(function(){
			$(this).addClass("button");
		});
		$("#Layout").find(":button").each(function(){
			$(this).addClass("button");
		});
		
//////////Look at my child they are sooo beautifull
		$("#menu-principal-ul > li").each(function(){
			$(this).find("ul").css("display","none");
			$(this).hover(function(){
				$(this).find("ul").css("display","block");
			},function(){
				$(this).find("ul").css("display","none");
			});	
		});
	
	});
});