// JavaScript Document
function openGallerie( basepath, gallerie, l, h, langue )
{
	window.open( basepath + "viewer.asp?gallerie=" + gallerie, "gallerie", 
		"width=" + l + ",height=" + h + ",scrollbars=0,resizable=yes,left=" + 
		((screen.width - l)/2) + ",top=" + ((screen.height - h)/2) ) ;
}

function openImage( image, l, h )
{
	var fenetre = window.open( "", "gallerie", 
		"width=" + l + ",height=" + h + ",scrollbars=0,resizable=yes,left=" + 
		((screen.width - l)/2) + ",top=" + ((screen.height - h)/2) );
	
	fenetre.document.open("text/html","replace");
	fenetre.document.write( "<html><body style=\"margin:0;padding:0;\">" );
	fenetre.document.write( "<center><img src=\"" + image + "\"></center>" );
	fenetre.document.write( "</body></html>" );
	
	fenetre.focus();
}

function openPopup( url, l, h )
{
	var fenetre = window.open( url, "gallerie", 
		"width=" + l + ",height=" + h + ",scrollbars=auto,resizable=yes,left=" + 
		((screen.width - l)/2) + ",top=" + ((screen.height - h)/2) );
	
	fenetre.focus();
}

// JavaScript Document 
function validerEmploi( refForm, lang )
{
	var bchamp = null;
	if( refForm.nom.value == "" )
		bchamp = refForm.nom;
	
	if( bchamp == null && refForm.telephone.value == "" )
		bchamp = refForm.telephone;
		
	if( bchamp == null && refForm.courriel.value == "" )
		bchamp = refForm.courriel;
		
	if( bchamp == null && refForm.adresse.value == "" )
		bchamp = refForm.adresse;
		
	if( bchamp == null && refForm.ville.value == "" )
		bchamp = refForm.ville;
	
	if( bchamp == null && refForm.pays.value == "" )
		bchamp = refForm.pays;
		
	if( bchamp == null && refForm.province.value == "" )
		bchamp = refForm.province;
		
	if( bchamp == null && refForm.codepostal.value == "" )
		bchamp = refForm.codepostal;
	
	if( bchamp != null )
	{
		bchamp.focus();
		
		if( lang == "en" )
			alert( "This field required." );
		else
			alert( "Un des champs obligatoires est vide." );
	}
	
	return ( bchamp == null );
}

function validerBrochure( refForm, lang )
{
	var bchamp = null;
	if( refForm.nom.value == "" )
		bchamp = refForm.nom;
	
	if( bchamp == null && refForm.telephone.value == "" )
		bchamp = refForm.telephone;
		
	if( bchamp == null && refForm.courriel.value == "" )
		bchamp = refForm.courriel;
		
	if( bchamp == null && refForm.adresse.value == "" )
		bchamp = refForm.adresse;
		
	if( bchamp == null && refForm.ville.value == "" )
		bchamp = refForm.ville;
	
	if( bchamp == null && refForm.pays.value == "" )
		bchamp = refForm.pays;
		
	if( bchamp == null && refForm.province.value == "" )
		bchamp = refForm.province;
		
	if( bchamp == null && refForm.codepostal.value == "" )
		bchamp = refForm.codepostal;
	
	if( bchamp != null )
	{
		bchamp.focus();
		
		if( lang == "en" )
			alert( "This field required." );
		else
			alert( "Un des champs obligatoires est vide." );
	}
	
	return ( bchamp == null );
}

function validerSoumission( refForm, lang )
{
	var bchamp = null;
	var dropList = refForm.statut;
	if( refForm.nom.value == "" )
		bchamp = refForm.nom;
		
	
	
	if( bchamp == null && refForm.telephone.value == "" )
		bchamp = refForm.telephone;
		
	if( bchamp == null && refForm.email.value == "" )
		bchamp = refForm.email;
		
	if( bchamp == null && refForm.adresse.value == "" )
		bchamp = refForm.adresse;
		
	if( bchamp == null && refForm.ville.value == "" )
		bchamp = refForm.ville;
		
	if( bchamp == null && dropList.options[ dropList.selectedIndex].value == "" )
		bchamp = refForm.statut;
		
	
	if( bchamp != null )
	{
		bchamp.focus();
		
		if( lang == "en" )
			alert( "This field required." );
		else
			alert( "Un des champs obligatoires est vide." );
	}
	
	return ( bchamp == null );
}

