
//gestion plus d'info page fiche
function close_plusinfo(){
	document.getElementById("explicatif-complementaire").style.display="none";
	document.getElementById("plus-infos").style.display="block";
}
function open_plusinfo(){
	document.getElementById("explicatif-complementaire").style.display="block";		
	document.getElementById("plus-infos").style.display="none";
}

//ouvre une popup centerer par default
function open_popup(lien,fenetre,width,height,param){
	var left=(screen.availWidth-width)/2;
	var top=(screen.availHeight-height)/2;
	if (top <0) top=0;
	if (param!='') param=','+param;
	window.open(lien,fenetre,'top='+top+',left='+left+',width='+width+',height='+height+param);
	return false;
}
//Gestion du portfolio page fiche
var index_photo=0;
liste_photo= new Array();
function next_photo(){
	if (index_photo>=liste_photo.length-1)
		index_photo=0;	
	else
		index_photo++;
	document.getElementById("photo-port-folio").src=liste_photo[index_photo];
	document.getElementById("num_photo").value="Photo "+(index_photo+1)+"/"+liste_photo.length;
}
function previous_photo(){
	if (index_photo<=0)
		index_photo=liste_photo.length-1;
	else
		index_photo--;
	document.getElementById("photo-port-folio").src=liste_photo[index_photo];
	document.getElementById("num_photo").value="Photo "+(index_photo+1)+"/"+liste_photo.length;
}
function open_port_folio(){
	//document.getElementById("photo-port-folio").src=liste_photo[0];
	document.getElementById("num_photo").value='Photo 1/'+liste_photo.length;
	//alert(document.getElementById("apercu-image").style.display);
	document.getElementById("apercu-image").style.display="none";
	document.getElementById("port-folio").style.display="block";		
}
function close_port_folio(){
	document.getElementById("apercu-image").style.display="block";
	document.getElementById("port-folio").style.display="none";	
}
function preload_image_fiche(){
	document.img_preload=new Array();
	for(i=0;i<liste_photo.length;i++){
		document.img_preload[i]=new Image;
		document.img_preload[i].src=liste_photo[i];
	}
}


function open_plan_swf(swf){
	var taille=swf.substring(swf.indexOf('-')+1,swf.indexOf('.swf'));
	var width=parseInt(taille.substring(0,taille.indexOf('x')));
	var height=parseInt(taille.substring(taille.indexOf('x')+1,taille.length));
	var left=(screen.availWidth-width)/2;
	var top=(screen.availHeight-height)/2;
	if (top <0) top=0;
	fen=window.open(swf,"_blank",'top='+top+',left='+left+',width='+width+',height='+height);
	/*fen.write('<script language="JavaScript" type="text/JavaScript" src="../../scripts/detection_flash.js"></script>');
	fen.write('<script>insert_flash_1(\''+swf+'\',\''+width+'\',\''+height+'\');</script>');*/
}

function afficheGrand(chemin,titre)
	{
	i1 = new Image;
	i1.src = chemin;
	html = '<html><head><title>'+titre+'</title></head><body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0><center><a href="javascript: window.close();"><img src="'+chemin+'" border="0" name="imageTest" onLoad="window.resizeTo(document.imageTest.width,document.imageTest.height)"></a></center></body></html>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
	}