function humeur1(){
	
	document.body.style.backgroundImage='';	
	document.body.style.backgroundRepeat='';
	document.body.style.backgroundColor='#ffffff';
	changerFondFlash(1);
}

function humeur2(){
	document.body.style.backgroundImage='url(http://www.pays-de-barr.fr/images/ot/background_humeur_2.jpg)';	
	document.body.style.backgroundRepeat='repeat-x';	
	document.body.style.backgroundColor='#96bc0d';	
	changerFondFlash(2);
}

function humeur3(){
	document.body.style.backgroundImage='url(http://www.pays-de-barr.fr/images/ot/background_humeur_3.jpg)';	
	document.body.style.backgroundRepeat='repeat-x';	
	document.body.style.backgroundColor='#ed1c24';
	changerFondFlash(3);
}

function humeur4(){
	document.body.style.backgroundImage='url(http://www.pays-de-barr.fr/images/ot/background_humeur_4.jpg)';	
	document.body.style.backgroundRepeat='repeat-x';	
	document.body.style.backgroundColor='#29abe2';
	changerFondFlash(4);
}

function humeur5(){
	document.body.style.backgroundImage='';	
	document.body.style.backgroundRepeat='';	
	document.body.style.backgroundColor='#c3ccac';
	changerFondFlash(5);
}

function humeur6(){
	document.body.style.backgroundImage='';	
	document.body.style.backgroundRepeat='';
	document.body.style.backgroundColor='#e0c7ad';
	changerFondFlash(6);
}

function humeur7(){
	document.body.style.backgroundImage='';	
	document.body.style.backgroundRepeat='';
	document.body.style.backgroundColor='#d9d3e2';
	changerFondFlash(7);
}

function humeur8(){
	document.body.style.backgroundImage='';	
	document.body.style.backgroundRepeat='';
	document.body.style.backgroundColor='#ccdbd8';
	changerFondFlash(8);
}

var col_sel = null;
function changerFondFlash(code){
	try{
			
		appelFlash("Bandeau").changerFond(code);
		/* alert(navigator.appCodeName); */
	
	}catch(err) {
		col_sel = code;
		window.setTimeout("retry_flash()", 10);
	}
}
function retry_flash() {
	changerFondFlash(col_sel)
}

function appelFlash(movieName) {

	if (window.document[movieName]){
		return window.document.getElementById(movieName);
    }
	
    if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
    }
    else {
	    return document[movieName];
    }
} 




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 checkCookie()
{
	humeur=getCookie('humeur');
	if (humeur!=null && humeur!="")
	  {
			if(humeur == 1){
				humeur1();	
			}
			if(humeur == 2){
				humeur2();	
			}
			if(humeur == 3){
				humeur3();	
			}
			if(humeur == 4){
				humeur4();	
			}
			if(humeur == 5){
				humeur5();	
			}
			if(humeur == 6){
				humeur6();	
			}
			if(humeur == 7){
				humeur7();	
			}
			if(humeur == 8){
				humeur8();			
			}
	  }
	  else{

			if(Color == 1){
				humeur1();
			}
			if(Color == 2){
				humeur2();	
			}
			if(Color == 3){
				humeur3();	
			}
			if(Color == 4){
				humeur4();	
			}
			if(Color == 5){
				humeur5();	
			}
			if(Color == 6){
				humeur6();	
			}
			if(Color == 7){
				humeur7();	
			}
			if(Color == 8){
				humeur8();	
			}
	  }
}
	
function deleteLastColor(value){
	
	var aujourdhui = new Date() ;
	 
	//nouvel objet date
	var expdate = new Date() ;
	
	var name = 'humeur'; 
	 
	//plus an an  partir d'aujourdh'ui le cookie ne s'efface jamais
	expdate.setTime( aujourdhui.getTime() - 31536000000 ) ;
	
	//creation du cookie de nom name et de valeur saisie en paramtre
	document.cookie = name + "=" + value + ";expires=" + expdate.toGMTString() ;
	
}



	
function setColor(value){
	
	var aujourdhui = new Date() ;
	 
	//nouvel objet date
	var expdate = new Date() ;
	
	var name = 'humeur'; 
	 
	//plus an an  partir d'aujourdh'ui le cookie ne s'efface jamais
	expdate.setTime( aujourdhui.getTime() + 31536000000 ) ;
	
	//creation du cookie de nom name et de valeur saisie en paramtre
	document.cookie = name + "=" + value + ";expires=" + expdate.toGMTString() ;
	
}



