// ================ 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;
}



// ============== 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 if (type == 3) { // 3 = plan d'acces
		var hauteur = 650;
		var largeur = 566;
		//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 loadProjet(pid) {
//	alert(newsid);
	var hauteur = 800;
	var largeur = 850;
	//popup centrée
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open('fiche_projet.php?pid='+pid,'fiche','toolbar=1,location=1,directories=1,status=1,scrollbars=1,resizable=1,copyhistory=1,menuBar=1,width='+largeur+',height='+hauteur+',left='+left+',top='+top+'');
}
function loadNews(newsid) {
//	alert(newsid);
	var hauteur = 800;
	var largeur = 850;
	//popup centrée
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open('news.php?nid='+newsid,'actus','toolbar=1,location=1,directories=1,status=1,scrollbars=1,resizable=1,copyhistory=1,menuBar=1,width='+largeur+',height='+hauteur+',left='+left+',top='+top+'');
}
// ============== menu de navigation =============
function loadPage(code) {
/*
Méthode d'appel :
-----------------
javascript:loadPage('01');

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

	01 -> Accueil
	02 -> Programme
	03 -> Ateliers
	04 -> Informations générales
	05 -> Organisation
	06 -> Contact/Liens
*/
/*
*/
	if (code == '00') loadNews('');
	else if (code == '01') window.location="index.php";
	else if (code == '02') window.location="societe.php";
	else if (code == '021') window.location="societe_membres.php";
	else if (code == '022') window.location="societe_chiffres.php";
	else if (code == '03') window.location="prestations.php";
	else if (code == '031') window.location="prestations_etudes.php";
	else if (code == '032') window.location="prestations_conseil_et_assistance.php";
	else if (code == '033') window.location="prestations_services.php";
	else if (code == '034') window.location="prestations_formation.php";
	else if (code == '04') window.location="realisations.php";
	else if (code == '041') window.location="realisations_carte_des_projets.php";
	else if (code == '042') window.location="realisations_conception_de_produits_geographiques.php";
	else if (code == '043') window.location="realisations_service_de_controle_qualite.php";
	else if (code == '044') window.location="realisations_optimisation_de_choix_de_sources.php";
	else if (code == '045') window.location="realisations_geomorphologie.php";
	else if (code == '05') window.location="kados_et_contact.php";
	else window.location="index.php";
}

function englishText(version)
{
	if (version==0)
	{
		// the function that performs the fade
		Effect.Fade("texte_francais", { duration:1, from:1.0, to:0.0 });
		Effect.Appear("texte_english", { duration:1, from:0.0, to:1.0 });
		
	}
	else
	{
		Effect.Fade("texte_english", { duration:1, from:1.0, to:0.0 });
		Effect.Appear("texte_francais", { duration:1, from:0.0, to:1.0 });
		
	}
}
