function echoDate() {
	var rdsDate = new Date();
	var rdsDay = rdsDate.getDate();
	var rdsMonth = rdsDate.getMonth() + 1;
	var rdsYear = rdsDate.getFullYear();
	
	var rdsToday = rdsDay + "/" + rdsMonth + "/" + rdsYear;
	
	return rdsToday
}

var checkIt;
var action;
var	sMenu;
var	xCoord;
var	yCoord;	
var	sMenuStatut;
var lienID;	

function menuHautPop (menuHautPopVal, xVal, menuStatut) {
	
	sMenu = menuHautPopVal;
	xCoord = xVal;
	sMenuStatut = menuStatut;					
	
	if ((document.getElementById) && (isPageLoaded == true)) {
		// Ferme tous les sous-menus
		menuHautHideAll ();
		menuGaucheHideAll ();
		// Si menu gauche sport est presente, ferme ces sous-menus aussi
		if (document.getElementById('menuGauchePopSport1')) {
			menuGaucheSportHideAll ();
		}		
		
		// Ouvre le bon sous menu (si enabled)
		if (sMenuStatut == "enabled") {									
			document.getElementById(sMenu).style.display = 'block';
			document.getElementById(sMenu).style.left = xCoord + 'px';							
		}	
	}
}

function menuHautHide () {		
	if (document.getElementById) {
		if (checkIt) clearTimeout(checkIt);
		checkIt = setTimeout('menuHautHideAll()',3000);
	}
}

function menuHautHideAll () {	
	if ((document.getElementById) && (isPageLoaded == true)) {
		document.getElementById('menuHautPopA').style.display = 'none';
		document.getElementById('menuHautPopB').style.display = 'none';
		document.getElementById('menuHautPopC').style.display = 'none';
		document.getElementById('menuHautPopD').style.display = 'none';
		document.getElementById('menuHautPopE').style.display = 'none';
		document.getElementById('menuHautPopF').style.display = 'none';
		document.getElementById('menuHautPopG').style.display = 'none';
		document.getElementById('menuHautPopH').style.display = 'none';
		document.getElementById('menuHautPopI').style.display = 'none';
	}
}	

function menuHautPopLien (actionVal, lienVal) {
	if (document.getElementById) {		
		action = actionVal;
		lienID = lienVal;
				
		// mouseover
		if (action == "mouseover") {
			document.getElementById(lienID).style.cursor = 'pointer';
			document.getElementById(lienID).style.cursor = 'hand';
			document.getElementById(lienID).style.color = '#FFFFFF';
			document.getElementById(lienID).style.backgroundColor = '#999999';
		}
		
		// mouseout
		if (action == "mouseout") {
			document.getElementById(lienID).style.color = '#000000';
			document.getElementById(lienID).style.backgroundColor = '#CCCCCC';
			menuHautHide();
		}
		
		// onclick
		if (action == "click") {
			if (currURI.indexOf('vdl2') == -1 ){
				document.location = 'http://www.rds.ca' + lienID;
			}
			else {
				document.location = lienID;
			}
		}
	}
}


// GESTIONNAIRE SECTION ACTIVE MENU HAUT
var currentURI = ""+document.location;

function topMenuSelect() {
	if ((currentURI != "http://rds.vdl2.ca/") && (currentURI != "htt://www.rds.ca/")) { 	
		if ((currentURI.indexOf("/hockey/") != -1) || (currentURI.indexOf("/canadien/") != -1) || (currentURI.indexOf("/senateurs/") != -1) || (currentURI.indexOf("/citadelles/") != -1) || (currentURI.indexOf("/lhjmq/") != -1) || (currentURI.indexOf("/semipro/") != -1) || (currentURI.indexOf("/lhjaaa/") != -1) || (currentURI.indexOf("/midgetaaa/") != -1) || (currentURI.indexOf("/lsaa/") != -1)) {
			document.getElementById('menuHautA').className = "menuHautActifSub";
		}	
		else if ((currentURI.indexOf("/courses/") != -1) || (currentURI.indexOf("/f1/") != -1) || (currentURI.indexOf("/nascar/") != -1) || (currentURI.indexOf("/rallye/") != -1) || (currentURI.indexOf("/irl/") != -1)) {
			document.getElementById('menuHautB').className = "menuHautActifSub";
		}
		else if ((currentURI.indexOf("/football/") != -1) || (currentURI.indexOf("/alouettes/") != -1) || (currentURI.indexOf("/superbowl/") != -1) || (currentURI.indexOf("/usic/") != -1)) {
			document.getElementById('menuHautC').className = "menuHautActifSub";
		}
		else if ((currentURI.indexOf("/baseball/") != -1) || (currentURI.indexOf("/baseballquebec/") != -1) || (currentURI.indexOf("/lbeq/") != -1) || (currentURI.indexOf("/capitales/") != -1)) {
			document.getElementById('menuHautD').className = "menuHautActifSub";
		}
		else if ((currentURI.indexOf("/golf/") != -1) || (currentURI.indexOf("/britishopen/") != -1) || (currentURI.indexOf("/omniumcanadien/") != -1) || (currentURI.indexOf("/masters/") != -1) || (currentURI.indexOf("/championnatpga/") != -1) || (currentURI.indexOf("/usopengolf/") != -1)) {
			document.getElementById('menuHautE').className = "menuHautActifSub";
					}			
		else if ((currentURI.indexOf("/tennis/") != -1) || (currentURI.indexOf("/omniumaustralie/") != -1) || (currentURI.indexOf("/intercanada/") != -1) || (currentURI.indexOf("/roland-garros/") != -1) || (currentURI.indexOf("/usopentennis/") != -1) || (currentURI.indexOf("/wimbledon/") != -1)) {
			document.getElementById('menuHautF').className = "menuHautActifSub";
		}
		else if ((currentURI.indexOf("/soccer/") != -1) || (currentURI.indexOf("/coupedumonde/") != -1) || (currentURI.indexOf("/impact/") != -1) || (currentURI.indexOf("/euro/") != -1)) {
			document.getElementById('menuHautG').className = "menuHautActifSub";
		}
		else if (currentURI.indexOf("/boxe/") != -1) {
			document.getElementById('menuHautH').className = "menuHautActifSub";
		}	
		
		// detect sport 'AUTRES' avec sous-menu	
		else if ((currentURI.indexOf("/cyclisme/") != -1) || (currentURI.indexOf("/tourfrance/") != -1) || (currentURI.indexOf("/ski/") != -1) || (currentURI.indexOf("/britishopen/") != -1) || (currentURI.indexOf("/omniumcanadien/") != -1) || (currentURI.indexOf("/masters/") != -1) || (currentURI.indexOf("/championnatpga/") != -1) || (currentURI.indexOf("/usopengolf/") != -1)) {
			document.getElementById('menuHautI').className = "menuHautActifSub";		}	
				
	
								
		else {
			document.getElementById('menuHautI').className = "menuHautActifNoSub";
		}	
	}
}