/*
'*****************************************************************************
'	Agestis - Content Management System - http://www.agestis.com
'	by ARICIA http://www.aricia.fr
'*****************************************************************************
'			Version:	20100118.1454
'			coder:	Damien
'*****************************************************************************

'	Diverses fonctions javascript
'*****************************************************************************
*/
var fenetre;
var titlePopUp = "Zoom"

function zoom(sUrl,minHeight)
{
	if(fenetre){
		fenetre.close();	
	}

	/*
		Correction d'un bug avec l'appel de la fonction Zoom dans le cas d'une page du site avec Url Rewritting
		Si sUrl est égal à "zoom.asp?image=...."
		alors sUrl deviens "/zoom.asp?image=...."
	*/
	if( sUrl.substr(0,1)=="z" ){
		sUrl = "/"+ sUrl ;
	};
	/* 	Version 2
	 * l'appel de la fonction peut maintenant être zoom(/dir1/dir2[...]/fichier.ext)
	 * à la place de zoom(script.asp?image=/dir1/dir2[...]/fichier.ext)
	 */

	/*
	sUrl = ( sUrl.indexOf("zoom.asp")!=-1 ) ? sUrl.replace("/zoom.asp?image=","") : sUrl ;
	*/
	if( sUrl.indexOf("zoom.asp")==-1 )
		sUrl = "/zoom.asp?image="+ sUrl+"&minHeight="+minHeight ;
	
	
	fenetre = window.open(sUrl,titlePopUp, 
			+"top="+ ( (screen.height-250)/2 ) +",left="+ ( (screen.width-250)/2 )
			+",width="+ 250 
			+",height="+ 250
			+",resizable=yes,scrollbars=yes,toolbar=no,status=no,location=no,menubar=no,directories=no");
	fenetre.focus();
}


function TestFenetre()
{
	if(fenetre){
		fenetre.focus();
	}
}
