//-------------------------------- ROLLOVER MENU DE LA PAGE PUBLIC --------------------------------------------------
var menuEnSurvolPublic = false;
var timeoutMouseoutPublic;
function OverMenuPublic() {
    if( document.getElementById( "divIdFormation" ) )
        document.getElementById( "divIdFormation" ).style.display = "block";

    menuEnSurvolPublic = true;
}

function OutMenuPublic() {
    timeoutMouseoutPublic = setTimeout( timeoutOutMenuPublic, 500 );
}

function timeoutOutMenuPublic() {
    if( !menuEnSurvolPublic ) {
        if( document.getElementById( "divIdFormation" ) ) 
            document.getElementById( "divIdFormation" ).style.display = "none";
    }
}

//-------------------------------- ROLLOVER MENU DE LA PAGE ENTRE --------------------------------------------------
var menuEnSurvol = false;
var timeoutMouseout;
function imageOverMenu( imageId, imageSrc ) {
    //Enregistrement du id dans les var global
    imageOverId 		= imageId;
    imageNormalSrc 		= document.getElementById( imageId ).src;
    
    //Traitement
    document.getElementById( imageId ).src = imageSrc;

    if( imageId == "btn_college_normal_img" && document.getElementById( "menu_college_div" ) )
        document.getElementById( "menu_college_div" ).style.display = "block";

   if( imageId == "btn_formation_normal_img" && document.getElementById( "menu_formation_div" ) )
        document.getElementById( "menu_formation_div" ).style.display = "block";

    menuEnSurvol = true;
}

function imageOutMenu() {
    //Traitement
    document.getElementById( imageOverId ).src = imageNormalSrc;

    menuEnSurvol = false;
    timeoutMouseout = setTimeout( timeoutImageOutMenu, 500 );
}

function imageOutMenuBouton() {
    menuEnSurvol = false;
    timeoutMouseout = setTimeout( timeoutImageOutMenu, 500 );
}

function timeoutImageOutMenu() {
    if( !menuEnSurvol ) {
        if( document.getElementById( "menu_college_div" ) ) 
            document.getElementById( "menu_college_div" ).style.display = "none";

       if( document.getElementById( "btn_college_normal_img" ) )
           document.getElementById( "btn_college_normal_img" ).src = "http://www.multihexa.ca/web/image/menu_entre/btn_college_normal.gif";

        if( document.getElementById( "menu_formation_div" ) ) 
            document.getElementById( "menu_formation_div" ).style.display = "none";

        if( document.getElementById( "btn_formation_normal_img" ) )
           document.getElementById( "btn_formation_normal_img" ).src = "http://www.multihexa.ca/web/image/menu_entre/btn_formation_normal.gif";
    }
}

//-------------------------------- CHANGEMENT IMAGES POUR RECHERCHE PUBLIC --------------------------------------
function choixRecherche(onglet){
if(onglet=='web'){
      document.getElementById("module_recherche_formulaire").style.backgroundImage='url(http://www.multihexa.ca/web/image/publicn/background_recherche_bleu.gif)';
document.getElementById("type_recherche").value='btn_recherche_texte';
document.getElementById('img_btn_recherche').src='http://www.multihexa.ca/web/image/publicn/btn_rechercher_bleu.gif';
}else{
 document.getElementById("module_recherche_formulaire").style.backgroundImage='url(http://www.multihexa.ca/web/image/publicn/background_recherche_vert.gif)';
document.getElementById("type_recherche").value='btn_recherche_cours';
document.getElementById('img_btn_recherche').src='http://www.multihexa.ca/web/image/publicn/btn_rechercher_vert.gif';
}

}
//-------------------------------- ROLLOVER IMAGES --------------------------------------------------
//var global
var imageOverId; 		//contient le id de l'image en survol ou de la derniere image survolee
var imageNormalSrc;		//contient la source de l'image en survol de l'etat normal d'avant le survol de celle-ci

//Prechargement des images
function imageChargement()
{
	//Traitement
	var imagesList 		= Array(); 				//Liste des images pechargees
	var donneesList 	= imageChargement.arguments; 	//Liste indefinie de valeur est passee a la function
	for( i=0; i<donneesList.length; i++ )
	{
		//Push de l'image
		imagesList[i] 	= new Image;
		
		//Chargement de l'image
		if ( donneesList[i].indexOf("#")!=0 )
			imagesList[i].src = donneesList[i];
	}
}

//Au survol de l'image
function imageOver( imageId, imageSrc )
{
	//Enregistrement du id dans les var global
	imageOverId 		= imageId;
	imageNormalSrc 		= document.getElementById( imageId ).src;
	
	//Traitement
	document.getElementById( imageId ).src = imageSrc;
}

//A la sortie de l'image
function imageOut()
{
	//Traitement
	document.getElementById( imageOverId ).src = imageNormalSrc;
}


//-------------------------------- ROLLOVER ZONES ---------------------------------------------------
//var global
var zoneOverId; 		//contient le id de la zone en survol ou de la derniere zone survolee

//Au survol de la zone
function zoneCouleur( idBlock, couleur)
{
	zoneOverId = idBlock;
	document.getElementById( idBlock ).style.backgroundColor = couleur;
}

//A la sortie de la zone
function zoneOut()
{
	document.getElementById( zoneOverId ).style.backgroundColor = '';
}

var isOver = false;
function switchDiv( idDivBlock, idDivNone )
{
	if( !isOver ) {
		document.getElementById( idDivBlock ).style.display = "block";
		document.getElementById( idDivNone ).style.display = "none";
	}
}
			
function switchDivOut( idDivBlock, idDivNone )
{
	var timeout = setTimeout( switchDiv( idDivBlock, idDivNone ), 500 );
}

