var popup_scroll 	= "toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1,width=800,height=600,top=100,left=0,status=0";
var popup_scroll1 	= "toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,width=400,height=300,top=100,left=0,status=0";
var popup_scroll3 	= "toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,width=250,height=300,top=100,left=0,status=0";
var popup_scroll4 	= "toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,width=800,height=250,top=100,left=0,status=0";
var popup_scroll5	= "toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,width=800,height=165,top=100,left=0,status=0";
var popup_scroll6   = "toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,width=680,height=680,top=100,left=0,status=0";


// Ouverture d'un popup
function ouvrir(page) {
	window.open(page);
}


// Ouverture popup photo 1
function photo_popup(page) {
	fiche = open(page,'Solutions',popup_scroll5);
	if (navigator.appVersion.substring(1,0) >= "3")
    {
    fiche.focus (); 
    }
}

// Ouverture popup activité
function popup(page) {
	fiche = open(page,'Solutions1',popup_scroll1);
	if (navigator.appVersion.substring(1,0) >= "3")
    {
    fiche.focus (); 
    }
}


// Ouverture popup info exploitant
function popup_info(page) {
	fiche = open(page,'Solution',popup_scroll4);
	if (navigator.appVersion.substring(1,0) >= "3")
    {
    fiche.focus ();
    }
}

// Ouverture popup photo
function photo_pop(page,titre) {
	var contenu =	  "<html><head><link href='css/style.css' rel='stylesheet' type='text/css'>"
					+ "<title>"+titre+"</title></head><body topmargin='0' leftmargin='0' bgColor='#FDE490' style='filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr=#4B92D9, endColorStr=#CEDFF6, gradientType=1)'>"
					+ "<table width='100%' height='100%' align='center' >"
					+ "<tr><td align='center' valign='center'><img border='0' src='"+page+"'></td></tr>"
					+ "<tr><td align=center><font face='Verdana' size='1' color='#003500'>[ <a href='javascript:window.opener.focus();window.close();' class=gris>Fermer</a>]</font></td></tr>"
					+ "</td></tr></table></body></html>";
					
	var fenetre = open('page','photo',popup_scroll);
	
	fenetre.document.write(contenu);

}

// Ouverture popup photo
function photo(page,titre) {
	var contenu =	  "<html><head><link href='css/style.css' rel='stylesheet' type='text/css'>"
					+ "<title>"+titre+"</title></head><body topmargin='0' leftmargin='0' style='filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr=#4B92D9, endColorStr=#CEDFF6, gradientType=1)'>"
					+ "<table width='100%' height='100%' align='center' >"
					+ "<tr><td align='center' valign='center'><img border='0' src='"+page+"'></td></tr>"
					+ "<tr><td align=center><font face='Verdana' size='1' color='#003500'>[ <a href='javascript:window.opener.focus();window.close();' class=bleu>Fermer</a>]</font></td></tr>"
					+ "</td></tr></table></body></html>";

	var fenetre = open('page','photo',popup_scroll);

	fenetre.document.write(contenu);

}
// Ouverture popup photo
function projet(page,titre) {
    var contenu =      "<html><head><link href='css/style.css' rel='stylesheet' type='text/css'>"
                    + "<title>"+titre+"</title></head><body topmargin='0' leftmargin='0' style='filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr=#4B92D9, endColorStr=#CEDFF6, gradientType=1)'>"
                    + "<table width='100%' height='100%' align='center' >"
                    + "<tr><td align='center' valign='center'><img border='0' src='"+page+"'></td></tr>"
                    + "<tr><td align=center><font face='Verdana' size='1' color='#003500'>[ <a href='javascript:window.opener.focus();window.close();' class=bleu>Fermer</a>]</font></td></tr>"
                    + "</td></tr></table></body></html>";

    var fenetre = open('page','projet',popup_scroll6);

    fenetre.document.write(contenu);

}
//-----> Fonction qui teste les champs de la section contact
function check_form_contact() {

  var objForm = document.form;

  missinginfo = "";

  if (objForm.nom.value == ""){
  missinginfo += "\n     -  Nom";
  }
  if ( objForm.email.value == "" || objForm.email.value.indexOf('@',0) == -1 || objForm.email.value.indexOf('.',0) == -1 || objForm.email.value.indexOf('\'',0) == 0 || objForm.email.value.indexOf('"',0) == 0  ){
  missinginfo += "\n     -  Email";
  }

  if (missinginfo != "") {
  missinginfo ="______________________________\n" + "Vous n'avez pas rempli correctement:\n" + missinginfo + "\n______________________________" +  "\nRecommencez s'il vous plait!";
  alert(missinginfo);
  return false;
}

}

//-----> Fonction qui teste l'inscription pour un dossier de candidature
function check_form_candidate() {

  var objForm = document.form_inscrit;

  missinginfo = "";

  if (objForm.nom.value == ""){
  missinginfo += "\n     -  Nom du candidat";
  }
  if (objForm.entreprise.value == ""){
  missinginfo += "\n     -  Société du candidat";
  }
  if (objForm.adresse.value == ""){
  missinginfo += "\n     -  Adresse du candidat";
  }
  if (objForm.cp.value == ""){
  missinginfo += "\n     -  Code Postal du candidat";
  }
  if (objForm.ville.value == ""){
  missinginfo += "\n     -  Ville du candidat";
  }
  if (objForm.telephone.value == ""){
  missinginfo += "\n     -  Téléphone du candidat";
  }
  if ( objForm.email.value == "" || objForm.email.value.indexOf('@',0) == -1 || objForm.email.value.indexOf('.',0) == -1 || objForm.email.value.indexOf('\'',0) == 0 || objForm.email.value.indexOf('"',0) == 0  ){
  missinginfo += "\n     -  Email du candidat";
  }


  if (objForm.nom_maitre.value == ""){
  missinginfo += "\n     -  Nom du Maître d'oeuvre";
  }
  if (objForm.entreprise.value == ""){
  missinginfo += "\n     -  Société du Maître d'oeuvre";
  }
  if (objForm.adresse_maitre.value == ""){
  missinginfo += "\n     -  Adresse du Maître d'oeuvre";
  }
  if (objForm.cp_maitre.value == ""){
  missinginfo += "\n     -  Code Postal du Maître d'oeuvre";
  }
  if (objForm.ville_maitre.value == ""){
  missinginfo += "\n     -  Ville du Maître d'oeuvre";
  }
  if (objForm.telephone_maitre.value == ""){
  missinginfo += "\n     -  Téléphone du Maître d'oeuvre";
  }
  if ( objForm.email_maitre.value == "" || objForm.email.value.indexOf('@',0) == -1 || objForm.email.value.indexOf('.',0) == -1 || objForm.email.value.indexOf('\'',0) == 0 || objForm.email.value.indexOf('"',0) == 0  ){
  missinginfo += "\n     -  Email du Maître d'oeuvre";
  }

  if (missinginfo != "") {
  missinginfo ="______________________________\n" + "Vous n'avez pas rempli correctement:\n" + missinginfo + "\n______________________________" +  "\nRecommencez s'il vous plait!";
  alert(missinginfo);
  return false;
}

}