// JavaScript Document
if(!window.Event){ //IE mais pas Op�ra

	document.onmouseover=function(){

		x=window.event.srcElement

		if(x.tagName=="INPUT" && (x.className=="bouton" || x.className=="Input_IE"))x.className="hoverInput_IE"

	}

	document.onmouseout=function(){

		if(x.tagName=="INPUT" && x.className=="hoverInput_IE")x.className="Input_IE"

	}

}

function hide_elements(idarray)
{	
	for( var i = 0; i < idarray.length; i++ )
	{
		if( document.getElementById(idarray[i]) )
			document.getElementById(idarray[i]).style.visibility = 'hidden';
	}
}

function show_elements(idarray)
{
	for( var i = 0; i < idarray.length; i++ )
	{
		if( document.getElementById(idarray[i]) )
			document.getElementById(idarray[i]).style.visibility = 'visible';
	}
}

function clickonconnexion(typeinput)
{
		switch(typeinput)
		{
			case 'email':
                if( document.getElementById('form_login').value == 'Email' ) {
                    document.getElementById('form_login').value = "";
                }
				break;
			case 'mdp':
                if( document.getElementById('form_mdp').value == 'Mot de passe' ) {
                    document.getElementById('form_mdp').value = "";
                }
				break;
		}
}

//FONCTION DE GESTION DE LA SURCHARGE DES BOITES DE DIALOGUES ALERT ET CONFIRM
function setMessageDiv(innerHTML) {
    blocmask = document.getElementById('div_mask');
    blocmessage = document.getElementById('div_modalmessage');

    blocmask.style.opacity = '0.6';
    blocmask.style.khtmlOpacity = '0.6';
    blocmask.style.mozOpacity = '0.6';
    blocmask.style.filter = 'alpha(opacity=60)';
    blocmask.style.visibility = 'visible';

    blocmessage.innerHTML = '';
    blocmessage.innerHTML = innerHTML;
    blocheight = blocmessage.offsetHeight/2;
    blocmessage.style.marginTop = '-'+blocheight+'px';
    blocmessage.style.visibility = 'visible';

    if (navigator.appName=='Microsoft Internet Explorer')
        document.getElementById('frame_modalmessage').style.visibility = "visible";
}

//On surcharge la fonction Alerte pour personnaliser la Boîte de dialogue modale
window.alert = function(alert_message, fn) {
    bOK = '';
    if(fn)
        bOK = fn;

    setMessageDiv(alert_message+'<br /><br /><table width="100%"><tr><td width="37%">&nbsp;</td><td width="26%"><input type="button" value="OK" onclick="closeMsgBox();'+bOK+'" style="background-color:#8ABA18;height:22px;line-height:20px;border:1px solid #000000;text-decoration:none;font-weight:bold;font-size:11px;width:100px;min-width:100px;margin-top:5px;cursor:pointer"/></td><td width="37%">&nbsp;</td></tr></table>');
}

//On surcharge la fonction Confirm pour personnaliser la Boîte de dialogue modale
window.confirm = function(confirm_message, bYES, bNO) {
    setMessageDiv(confirm_message+'<br /><br /><table width="100%"><tr><td width="21%">&nbsp;</td><td width="25%"><input type="button" value="OUI" onclick="closeMsgBox();'+bYES+'" style="background-color:#8ABA18;height:22px;line-height:20px;border:1px solid #000000;text-decoration:none;font-weight:bold;font-size:11px;width:100px;min-width:100px;margin-top:5px;cursor:pointer"/></td><td width="8%">&nbsp;</td><td width="25%"><input type="button" value="NON" onclick="closeMsgBox();'+bNO+'" style="background-color:#8ABA18;height:22px;line-height:20px;border:1px solid #000000;text-decoration:none;font-weight:bold;font-size:11px;width:100px;min-width:100px;margin-top:5px;cursor:pointer"/></td><td width="21%">&nbsp;</td></tr></table>');
}

//On ferme la boîte de dialogue
function closeMsgBox() {
        blocmessage = document.getElementById('div_modalmessage');
        blocmessage.innerHTML = '';
        blocmessage.style.visibility = 'hidden';
        blocmask = document.getElementById('div_mask');
        blocmask.style.visibility = 'hidden';

        if (navigator.appName=='Microsoft Internet Explorer')
            document.getElementById('frame_modalmessage').style.visibility = "hidden";
}