////////////////////////////////////////////////////////////////////////////////////
// CONSTANTS
// Don't touch these. :)
////////////////////////////////////////////////////////////////////////////////////
// Sticky caption center

function ouvreFenetre(monURL, nom) {
	window.open(monURL,nom, 'width=500px, height=300px, toolbar=no, resizeable=no, scrollbars=yes');
}

function selectionneDest(dest_id, dest_nom)
{
	// Verifie si existe deja
	if (opener.document.forms['message'].destinataire.value.indexOf(dest_nom)==-1) {
		opener.document.forms['message'].destinataire.value = opener.document.forms['message'].destinataire.value +";" + dest_nom;
		opener.document.forms['message'].dest.value = opener.document.forms['message'].dest.value +";" + dest_id;
	}
	//opener.focus();
//	window.close();
}

function afficheDiv(id) {
	maDiv = document.getElementById(id);
	if ((maDiv.style.visibility == 'hidden')||(maDiv.style.visibility=='')) {
		document.getElementById('attaqueProche').style.visibility = 'hidden';
		document.getElementById('magieProche').style.visibility = 'hidden';
		maDiv.style.visibility = 'visible';
	} else {
		maDiv.style.visibility = 'hidden';
	}
}

function verifieMessage(formMessage) {
	if (formMessage.sujet.value =='') {
		alert("Veuillez renseigner le sujet du message");
		return false;
	}
	if (formMessage.destinataire.value =='') {
		alert("Veuillez sélectionner un destinataire");
		return false;
	}
	if (formMessage.message.value =='') {
		alert("Veuillez message est vide!");
		return false;
	}
	return true;		
}

/*
	Utilisé dans la gestion des clans
*/

function changeMon(id) {
	document.getElementById("mon").src='img/clans/mon_'+id+'.gif';
}

function selectionneClan(id) {
	window.opener.location.href='index.php?module=clan&action=detail&cln_id='+id;
}

function montre(strId)
{
    if (document.getElementById) {
        if (document.getElementById(strId).style.display == "none") {
            document.getElementById(strId).style.display = "";
            document.getElementById('deplie').src='img/ameliorer.gif';
       } else {
            document.getElementById(strId).style.display= "none";
            document.getElementById('deplie').src='img/regresser.gif';
       }
    }
}
