/* auteur: Cath Nantel */
/* Date de création: 30/10/2004 */

  cv_on = new Image;
  cv_off = new Image;
  pf_on = new Image;
  pf_off = new Image;
  fav_on = new Image;
  fav_off = new Image;
  ph_on = new Image;
  ph_off = new Image;
	cont_on = new Image;
  cont_off = new Image;
  
  cv_on.src = "/img/cc_cv_V5ov.gif";
  cv_off.src = "/img/cc_cv_V5.gif";
  pf_on.src = "/img/cc_pf_V5ov.gif";
  pf_off.src = "/img/cc_pf_V5.gif";
  fav_on.src = "/img/cc_fav_V5ov.gif";
  fav_off.src = "/img/cc_fav_V5.gif";
  ph_on.src = "/img/cc_ph_V5ov.gif";
  ph_off.src = "/img/cc_ph_V5.gif";
  cont_on.src = "/img/cc_cont_V5ov.gif";
  cont_off.src = "/img/cc_cont_V5.gif";

function button_on ( imgId )
{
 imgName=imgId;
  if ( document.images )
  {
    butOn = eval ( imgName + "_on.src" );
    document.getElementById(imgId).src = butOn;
  }
}

function button_off ( imgId )
{
 	imgName=imgId;
  if ( document.images )
  {
    butOff = eval ( imgName + "_off.src" );
    document.getElementById(imgId).src = butOff;
  }
}

function popUp(url,winName,features) 
{ 
  var _W=window.open(url,winName,features);
	  _W.focus();
      _W.moveTo(50,50); 
} 


function AfficheHeure() {
	var dt=new Date();
	var heure=dt.getHours();
	var min=dt.getMinutes(); if (min<10) {min="0"+min;}
	var sec=dt.getSeconds(); if (sec<10) {sec="0"+sec;}
	window.status="Il est exactement "+heure+":"+min+":"+sec
	setTimeout("AfficheHeure()",1000);
}


function checkscript(al){
	//alert(al.appetit[1].checked);
	var theone=0;
	for (i=0;i<al.appetit.length;i++){
	if (al.appetit[i].checked==true)
	theone=i;
	}
	return theone;
}

function isBonneReponse(al,y){
	reponseCochee=checkscript(al);
	//alert(reponseCochee);
	if (reponseCochee==y){
		//alert("oui");
		document.getElementById("appetitReponse").innerHTML="C'est exact! Par contre, il va s'en dire que l'estomac a de moins en moins de place pour s'&eacute;pendre! En fait c'est comme une lutte &agrave; 3 : b&eacute;b&eacute; vs estomac vs vessie! <br />Devinez qui gagne la plupart du temps?";
	}
	else{
		//alert("non");
		document.getElementById("appetitReponse").innerHTML="Pas tout &agrave; fait...essaie encore";
	}
	
	return false;
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
} 
