// JavaScript Document

function verifPageActive()
{
	var url = ""+window.location;
	var temp = new Array();
	temp = url.split('/');

	// si on est dans la rubrique tourisme
	if(""+temp[temp.length-1]=="index.php?p=tourisme")
	{
		afficheDetailsTourisme(5);
	}


	$("div.corps_paragraphe").hide();
	
	$("div#p1").show();
}

function afficheDiv(idDiv, nbpar)
{
	// vitesse: slow, normal, fast ou vitesse en millisecondes
	var vitesse=1200;
	
	$("div.corps_paragraphe").hide(vitesse);	
	$("div#"+idDiv).show(vitesse);
		
/*	if($("div#"+idDiv+":visible").length != 0)
		$("div#"+idDiv).hide("normal");
	else
		$("div#"+idDiv).show("normal");*/
}

/*

function verifPageActive()
{
	// On verifie quelle est la page active

	var url = ""+window.location;
	var temp = new Array();
	temp = url.split('/');
	var page_active=""+temp[temp.length-1];
	
	// si c'est la page origine
	if(page_active=="index.php?p=origine" || page_active=="index.php?p=origine#")
	{
		afficheDiv("p1", 11);
	}
	
	// si c'est la page savoir-faire
	if(page_active=="index.php?p=savoir_faire" || page_active=="index.php?p=savoir_faire#")
	{
		afficheDiv("p1", 7);
	}
	
	// si c'est la page tourisme
	if(page_active=="index.php?p=tourisme" || page_active=="index.php?p=tourisme#")
	{
		afficheDiv("p1", 3);
	}
}

function afficheDiv(idDiv, nbpar)
{
	var pid="";
	var hauteur = "0px";
	
	for(j=1; j<=nbpar; j++)
	{
		pid="p"+j;
		if(document.getElementById(pid).style.height!=hauteur || document.getElementById('par_'+pid).style.height!=hauteur )
		{
			document.getElementById(pid).style.height = hauteur;			
			document.getElementById(pid).style.display = 'none';	
			document.getElementById('par_'+pid).style.height = hauteur;			
			document.getElementById('par_'+pid).style.display = 'none';
		}
	}
	var div = document.getElementById(idDiv);
	div.style.display = "block";
	div.style.height = "auto";
	
	var par = document.getElementById("par_"+idDiv);
	par.style.display = "block";
	par.style.height = "auto";
}
*/

function OuvrirPopup(page,w,h)
{
	var top;
	var left;
	
	top=(window.screen.height/2)-(h/2);
	left=(window.screen.width/2)-(w/2);
	
	window.open(page,'','resizable=no, location=no, width='+w+', height='+h+', top='+top+', left='+left+', menubar=no, status=no, scrollbars=no, menubar=no');
}

function changerApercuImage(image)
{
	document.getElementById('apercuImage').src='../images/photos/'+image;
}