// ================ frame killer ================
if (top.frames.length!=0) top.location=self.document.location;


// ================ préchargement des images ================
//préchargement des images rollover
/*
if (document.images) {	
	imgA = new Image();
	imgA.src = "../img/bouton_liste_over.gif";

	imgB = new Image();
	imgB.src = "../img/bouton_media_over.gif";
	
	imgC = new Image();
	imgC.src = "../img/bouton_more_over.gif";
	
	imgD = new Image();
	imgD.src = "../img/close.gif";
	
	imgE = new Image();
	imgE.src = "../img/open.gif";
}
*/

// ============== filtre anti-spam ==============
function noSpam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}


// ============== menu de navigation =============
function gotoURL(code) {
/*
Méthode d'appel :
-----------------
javascript:gotoURL('01');

Liste des codes :
-----------------

	01 -> Accueil
	02 -> Programme
	03 -> Ateliers
	04 -> Informations générales
	05 -> Organisation
	06 -> Contact/Liens
*/
/*
	if (code == '01') window.location="accueil.php";
	else if (code == '02') window.location="programme.php";
	else if (code == '03') window.location="ateliers.php";
	else if (code == '04') window.location="infos_generales.php";
	else if (code == '05') window.location="organisation.php";
	else if (code == '06') window.location="contact_liens.php";
	else if (code == '07') window.location="accueil.php"; //appel automatique à la fin de l'animation Flash
	else window.location="index.php";
*/
}


// ============== ouverture popup ==============
function openPopup(type,url) {
	if (type == 1) { // 1 = popup
		var hauteur = 450;
		var largeur = 500;
		//popup centrée
		var top=(screen.height-hauteur)/2;
		var left=(screen.width-largeur)/2;
		window.open(url,'popup','toolbar=0,location=0,directories=0,status=1,scrollbars=1,resizable=1,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+',left='+left+',top='+top+'');
	}
	else if (type == 2) { // 2 = liste des participants aux ateliers
		var hauteur = 450;
		var largeur = 500;
		//popup centrée
		var top=(screen.height-hauteur)/2;
		var left=(screen.width-largeur)/2;
		window.open(url,'popup','toolbar=0,location=0,directories=0,status=1,scrollbars=1,resizable=1,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+',left='+left+',top='+top+'');
	}
	else { void(0); }
}

// ============== ouverture popup ==============
function popImg(imgid,imgwidth,imgheight) {
	var hauteur = imgheight + 100;
	var largeur = imgwidth + 25;
	//popup centrée
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open('popimg.php?imgid='+imgid,'popup','toolbar=0,location=0,directories=0,status=1,scrollbars=1,resizable=1,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+',left='+left+',top='+top+'');
}


// ============== fonction new window (target = blank) ==============
function openBlank(url) {
	if (window.open) {
		window.open(url);
	}
}

function hideAllSets()
{
	if ( document.getElementById ) {
		for (var i=1; i<=numSets; i++)
		{
			document.getElementById('set'+i).style.display='none';
		}
	}
} // end function

function showSet(sid)
{
	hideAllSets();
	if ( document.getElementById ) {
		document.getElementById('set'+sid).style.display='block';
	}
} // end function