<!--

var pathAuxImagesDuSite = "/television/ricardo/images/design/";

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

////////////////////////////////////////////////////////////////////////////////////////
// SECTION RECETTE
////////////////////////////////////////////////////////////////////////////////////////
function showChronique(param_idRecette){
	
	hideAllLayers(myArrayOfLayers);
	
	if (param_idRecette != '' )
	{
		eval('findObj(\'div_'+param_idRecette+'\').style.display= \'\'');
	}
	else
	{
		if ( myArrayOfLayers[0] != undefined ){
			eval('findObj(\'div_'+myArrayOfLayers[0]+'\').style.display= \'\'');
		}
	}
	
	window.scrollTo(0,0);
	
}

/*Scripts issus de la zone jeunesse:*/
//Debut
function detectBrowserVersion(){
		var version = 0;
		if (navigator.userAgent.indexOf("Mozilla/5.0") != -1) version = 6;
		else if (navigator.userAgent.indexOf("Mozilla/4") != -1) version = 4;
		else if (navigator.userAgent.indexOf("Mozilla/3") != -1) version = 3;
		else if (navigator.userAgent.indexOf("Mozilla/2") != -1) version = 2;
		else if (navigator.userAgent.indexOf("MSIE") != -1) version = 1;
		else version = 0;
			
		return version;
}

function printWindow(){
	if (detectBrowserVersion() == 1 ||
			detectBrowserVersion() == 4 ||
			detectBrowserVersion() == 6 ||
			detectBrowserVersion() == 0) {
	window.print();
	}
}

//FIN
//-->

////////////////////////////////////////////////////////////////////////////////////////
// SECTION EMISSION
////////////////////////////////////////////////////////////////////////////////////////
//Def des noms de calques a masquer	
var jours = new Array("lundi","mardi","mercredi","jeudi","vendredi");

function writeMenu(param_array_jours){

	document.write("<ul class=\"semaine\">");
	for (i=0; i<param_array_jours.length; i++)
	{	
		document.write("<li class=\"semaine\"><a onMouseOut=\"CheckState(jours);\"  onMouseOver='HighLight(\""+param_array_jours[i]+"\");'  href='javascript:showLayer(\""+param_array_jours[i]+"\");' ><img src='"+pathAuxImagesDuSite+""+param_array_jours[i]+".gif' name='menu_"+param_array_jours[i]+"' id='menu_"+param_array_jours[i]+"' border='0' alt='"+param_array_jours[i]+"'></a></li>");
	}
	document.write("</ul>");
	
}

//code perso
//Masque tous les calques dont les noms sont contenus dans un tableau.
function hideAllLayers(param_array_jours){
	
	var objTemp;
	
	for (i=0; i<param_array_jours.length; i++)
	{	
		eval('findObj(\'div_'+param_array_jours[i]+'\').style.display= \'none\'');
		
		// on masque l image associee a l emission, si on peut la trouver		
		if (findObj('imageEmission_'+param_array_jours[i]) != null) 
		{
			eval('findObj(\'imageEmission_'+param_array_jours[i]+'\').style.display= \'none\'');
		}
	}
}

//code perso
//remet tous les boutons du menu en mode passif.
function resetMenu(param_array_jours){

	for (i=0; i<param_array_jours.length; i++)
	{
		eval('findObj(\'menu_'+jours[i]+'\').src = \''+pathAuxImagesDuSite+''+param_array_jours[i]+'.gif\'');
		eval('StateBtn'+jours[i]+' = \'off\'');	
	}
}

function showLayer(param_string_jour){
	
	hideAllLayers(jours);
	resetMenu(jours);
	
	//on affecte l etat on au bouton
	eval('StateBtn'+param_string_jour+' = \'on\'');
	// on affiche le calque
	eval('findObj(\'div_'+param_string_jour+'\').style.display= \'\'');
	// on "allume" le bouton
	eval('findObj(\'menu_'+param_string_jour+'\').src = \''+pathAuxImagesDuSite+''+param_string_jour+'_x.gif\'');
	// on affiche l image associee a l emission
	if (findObj('imageEmission_'+param_string_jour) != null) 
	{
		eval('findObj(\'imageEmission_'+param_string_jour+'\').style.display= \'\'');
	}
	

}

//lors du mouseOut, on check l'état du bouton, si l etat est ON, on illumine le bouton
function CheckState(param_array_jours){
	
	for (i=0; i<param_array_jours.length; i++)
	{
		if (eval('StateBtn'+jours[i]) == 'on') {
			eval('findObj(\'menu_'+jours[i]+'\').src = \''+pathAuxImagesDuSite+''+param_array_jours[i]+'_x.gif\'');
		}else{
			eval('findObj(\'menu_'+jours[i]+'\').src = \''+pathAuxImagesDuSite+''+param_array_jours[i]+'.gif\'');
		}
		
	}
}

//lors du mouseOver, on highlight le bouton survolé
function HighLight(param_jour){
	eval('findObj(\'menu_'+param_jour+'\').src = \''+pathAuxImagesDuSite+''+param_jour+'_x.gif\'');
}

//Pour trouver l'objet qu'on souhaite manipuler
//MM dreamweaver MX javascript code
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}


//Pour conserver l'état des boutons
var StateBtnlundi = "off";
var StateBtnmardi = "off";
var StateBtnmercredi = "off";
var StateBtnjeudi = "off";
var StateBtnvendredi = "off";
var StateBtndimanche = "off";


/////////////////////////////////////////////////////////////////////////
// SECTION RECHERCHE
/////////////////////////////////////////////////////////////////////////

function ValiderForm(obj) {
	
	var form = obj;
	var resultat = false;

	if (form.terme.value == '') {
		alert('Veuillez entrer une expression SVP.');
	} else {
		if (form.terme.value.length < 3){
			alert('Votre expression doit contenir au moins trois caractères.');
		} else {
			resultat = true
		}
	}
	
	return resultat;

}

///////////////////////////////////////////////////////////////////////////
// UTILITAIRES
///////////////////////////////////////////////////////////////////////////

//Pour Ie Mac
if(typeof Array.prototype.push=='undefined'){

	// on simule alors la fonction push
	// car elle n existe pas sous ie mac
	Array.prototype.push=function(){
		var i=0;
		b=this.length,a=arguments;
		for(i;i<a.length;i++)this[b+i]=a[i];
		return this.length;
    }	

}

//-->

