	/* Détection du navigateur */
var n = 0;
var ie = 0;
var nv=null;

if (navigator.appName.indexOf("Netscape") != -1){//Netscape
	
	n = 1;
	ie = 0;
	
	if (navigator.appVersion.indexOf("4")!= -1) //Netscape 4.7 et - 	
		nv = 4;
	else
		nv = 5;	//Netscape 6, 7
		
} else { //Internet Explorer ou autre
	n = 0;
	ie = 1;
}
		function montrer(id) {
			var d = document.getElementById(id);
				d.style.display='block';
		}
		function cacher(id)
		{
			var d = document.getElementById(id);
				d.style.display='none';
		}
		function findPosX(obj)
		{
			var curleft = 0;
			if (obj.offsetParent)
			{
				while (obj.offsetParent)
				{
					curleft += obj.offsetLeft
					obj = obj.offsetParent;
				}
			}
			else if (obj.x)
				curleft += obj.x;
			return curleft;
		}
		function findPosY(obj)
		{
			var curtop = 0;
			if (obj.offsetParent)
			{
				while (obj.offsetParent)
				{
					curtop += obj.offsetTop
					obj = obj.offsetParent;
				}
			}
			else if (obj.y)
				curtop += obj.y;
			return curtop;
		}
		
function test(item){
var strOut="";
temp= item;
/*for (var i in temp)
 if (temp[i])
 	strOut += i + "=" + temp[i] + "\n";
alert(strOut); 	 
*/
alert(item.offsetTop);
}			
function hideShowMenu(itemName, state) {

		if (ie) {			
			
			/* IE */											
			//style n'est pas defini sur l'objet parent
			itemObject = document.all(itemName).style;




																																							
			if (state=='hidden') {
				itemObject.display = 'none';

			}	else {				
				itemObject.display = 'block';				

			}
									
		} else if (n){			
			if (nv == 4){			
									
					/* Netscape 4 */
					//eval("document." + itemName + ".visibility='hide'");
			}	else {
					/* Netscape 6.0 et + */
					itemObject = document.getElementById(itemName).style;
					//alert("itemName="+itemName + ", state=" + state);
																																																																	
					if (itemObject.display == "none" || state == 'show' || state == 'visible') {



						itemObject.display = "block";		

					} else {
						itemObject.display = "none";					

					}
					
			}				
		}		
}
	function mainmenuOver(item) {
	item.className = "corpo-menulink-sel";
	}

	function mainmenuOut(item, isCurrent) {
		if (isCurrent == "0") //ne pas changer la classe si c'est le menu courant
			item.className = "corpo-menulink";
	}
var maxTop;
function mainmenuOverBgcolor(item, isCurrent, ssmenu){
	item.style.backgroundColor="#FCFBF7";
	ssmenuObject = document.getElementById(ssmenu);
	//alert(ssmenuObject.style.top + "|" + item.offsetTop);
	ssmenuObject.style.top = "-" + (maxTop - item.offsetTop) + "px";
}

function mainmenuOutBgcolor(item, isCurrent){
	if (isCurrent == "0")
		item.style.backgroundColor="#F5F0E1";
}
function setBoxAccueilHeight(){
	var maxBoxHeight = 0;
	for (var i=1; i<=3;i++){
	eval("temp = document.getElementById('box" + i +"').offsetHeight");
		if (maxBoxHeight < temp)
			maxBoxHeight = temp
	}
document.getElementById("box1").style.height = maxBoxHeight + "px";
document.getElementById("box2").style.height = maxBoxHeight + "px";
document.getElementById("box3").style.height = maxBoxHeight + "px";

}

function survolMenuOver(item, id, nbSection){
	item.style.backgroundColor = "#aa1d25";
	item.className = 'menuSurvolon';
	showSummarySection(id, nbSection);
}
function survolMenuOut(item, id){
	item.style.backgroundColor = "#ffffff";
	item.className = 'menuSurvol';
}
	function showSummarySection(id, nbSection){
	for (var i=1;i<=nbSection;i++)
		if (i == id){			
			document.getElementById("section_" + i).style.display = "block";
			document.getElementById("menuSurvol_" + i).style.backgroundColor = "#aa1d25";
		}
		else{
			document.getElementById("section_" + i).style.display = "none";
			document.getElementById("menuSurvol_" + i).style.backgroundColor = "#ffffff";
		}
	}	
	/**************************************************
	* Cette fonction adapte la hauteur du separateur  *
	* au plus long contenu gauche ou droite           *
 	* Bug bizarre: ds EGC, ca ne marche pas,item1.offsetHeight=0 et item2.offsetHeight = 0
 	**************************************************/
	function equivHeights(id1,id2) {
     item1 = document.getElementById(id1);
     item2 = document.getElementById(id2);
     if (item1.offsetHeight > item2.offsetHeight ) {
        item2.style.height = item1.offsetHeight + 'px';
     } else {
        item1.style.height = item2.offsetHeight + 'px';
     }
  }
  
  // cacher le select lorsque le sous menu est present
function hideSelect(theSelect){
if (!document.getElementById(theSelect)){
	return;
}	
if (ie == 1 && nv < 7){
	 document.getElementById(theSelect).style.visibility = 'hidden';
}

}
function showSelect(theSelect){
if (!document.getElementById(theSelect)){
	return;
}	
	if (ie == 1  && nv < 7){
	document.getElementById(theSelect).style.visibility = 'visible';
}
}

var tabImagesVideo = new Array(2);
tabImagesVideo[0] = new Image(20,20);
tabImagesVideo[0].src = "/images/metro/video_star_rating_off.gif";
tabImagesVideo[1] = new Image(20,20);
tabImagesVideo[1].src = "/images/metro/video_star_rating_on.gif";

function swapImagesVideo(isOn, name, number) {
	for (var i = 0; i < number ; i++) {
		document.getElementById(name + i).src = (!isOn ? tabImagesVideo[0].src : tabImagesVideo[1].src);
		}
}

/**
 Fonctions pour le "rating" de vidéos
*/
function resetStars(currentRating)
{
    // Set the length of the timer, in seconds
    secs = 1
    StopTheClock()
    StartTheTimer(currentRating)
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer(currentRating)
{
    if (secs==0)
    {
        StopTheClock()
				swapImagesVideo(true,'ownRating',currentRating)
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer(" + currentRating + ")", delay)
    }
}