// JavaScript STUDIO PRISME

/*-----------------------------------------------
FONCTION AFFICHAGE POP_UP
------------------------------------------------*/
function open_popup(page) {
       window.open(page,"","menubar=no, status=no, scrollbars=yes, menubar=no, width=800, height=600");
   }
   
/*-----------------------------------------------
FONCTION AFFICHAGE TARIFS
------------------------------------------------*/

function show_tarif(choix) {

var tarif = window.document.getElementById("focus_tarifs");

if (!tarif) {
			alert("Objet introuvable : "+tarif);    
		}
else {       
      switch (choix)
        {
        case ('studio1'):
          tarif.style.fontSize = "12pt";
          tarif.innerHTML = "<BR><SPAN class=\"title\">Location Studio 1</SPAN><BR><BR><B>&bull; Tarifs Particuliers</B><BR>Forfait d&eacute;couverte : 50&euro; TTC (2 heures) <SPAN style=\"margin-left: 80px;\">Heure supp. (quelque soit le forfait)</SPAN><BR>Forfait 1/2 journ&eacute;e : 90&euro; TTC (4 heures)<SPAN style=\"margin-left: 180px;\">30&euro; TTC</SPAN><BR>Forfait journ&eacute;e : 160&euro; TTC (8 heures)        <BR><BR><B>&bull; Tarifs Professionnels</B><BR>Forfait 1/2 journ&eacute;e : 160&euro; TTC (4 heures)<SPAN style=\"margin-left: 80px;\">Heure supp. (quelque soit le forfait)</SPAN><BR>Forfait journ&eacute;e : 290&euro; TTC (8 heures)<SPAN style=\"margin-left: 200px;\">50&euro; TTC</SPAN><BR><BR>Pour toute autre demande, <A HREF=\"contact_studio_prisme.php\" alt=\"Studio Prisme - Contact\">contactez-nous</A>, nos formules sont modulables selon vos demandes. <BR><BR><BR><CENTER><A HREF=\"location_studio_prisme.php\" alt=\"\"><IMG src=\"images/button_resa_studio_1.png\" alt=\"Reserver le studio 1\" border=\"0\"></A></CENTER><BR><BR>";
          break;
        case ('photopro'):
          tarif.style.fontSize = "11pt";
          tarif.innerHTML = "<BR><SPAN class=\"title\">Photographie professionnelle</SPAN><BR><BR><B>&bull; Tarifs Particuliers</B>     <BR>\"Book\" :  100&euro; TTC (1 heure)<BR><SPAN style=\"margin-left: 30px;\"></SPAN>3 tirages 20x30 - Environ 50 photos sur CD-ROM<BR>\"Book +\" :  200&euro; TTC (2 heures)<BR><SPAN style=\"margin-left: 30px;\"></SPAN>10 tirages 20x30 - Environ 70 photos sur CD-ROM<BR><BR>\"Femme enceinte / Naissance\" :  240&euro; TTC (3 heures)<BR><SPAN style=\"margin-left: 30px;\"></SPAN>20 tirages 20x30 - 1 tirage 30x40 - 1 Album<BR><BR>\"Mariage\" :  400&euro; TTC (1 journ&eacute;e)<BR><SPAN style=\"margin-left: 30px;\"></SPAN>30 tirages 13x19 - Environ 100 &agrave; 150 photos sur CD-ROM<BR>\"Mariage +\" :  850&euro; TTC (1 journ&eacute;e)<BR><SPAN style=\"margin-left: 30px;\"></SPAN>30 tirages 13x19 - Environ 100 &agrave; 150 photos sur CD-ROM - 1 Album - Cr&eacute;ation graphique pour les remerciements<BR><BR><B>&bull; Tarifs Professionnels</B> : Nous contacter";
          break;
        case ('studio2'):
          tarif.style.fontSize = "12pt";
          tarif.innerHTML = "<BR><SPAN class=\"title\">Location Studio 2</SPAN><BR><BR><BR><CENTER>... le studio est actuellement en cours de renovation ...</CENTER><BR><BR>";
          break;   
        }
      }
}
  
	
/*-----------------------------------------------
FONCTION TEST FORMULAIRE CONTACT
------------------------------------------------*/
function f_testFormuContact(){
	var valid = false;

	var nom = document.FormuContact.nom.value;
  var email = document.FormuContact.email.value;
  var message = document.FormuContact.message.value;
  
		
		if( nom.length == 0 ){ 
			alert("Vous n'avez pas rempli le champ \"Nom\" obligatoire.");
			valid = false;
		}else if( email == "" ){ 
			alert("Vous n'avez pas rempli le champ \"Email\" obligatoire.");
			valid = false;
		}   
    else if( message == "" ){ 
			alert("Vous n'avez pas rempli le champ \"Votre message\" obligatoire.");
			valid = false;
		} 
		  else if (email.length > 0){

	            var valide1 = false;
	
	            for(var j=1;j<(email.length);j++){
		              if(email.charAt(j)=='@'){
			                 if(j<(email.length-4)){
				                    for(var k=j;k<(email.length-2);k++){
					                       if(email.charAt(k)=='.') {valide1=true;}					     
				                    }
			                  }
		              }
	           }
	if(valide1==false) {alert("L'adresse email saisie n'est pas valide.");}
	//return valide1;
	     else { valid = true; }
		
		  }
		
if(valid) document.FormuContact.submit();

}

/*-----------------------------------------------
FONCTION TEST FORMULAIRE LOCATION WAIT
------------------------------------------------*/
function f_testFormuLocationWait(){
	var valid = false;

	var nom = document.FormuLocationWait.nom.value;
  var email = document.FormuLocationWait.email.value;
  var date = document.FormuLocationWait.date.value;
  
		
		if( nom.length == 0 ){ 
			alert("Vous n'avez pas rempli le champ \"Nom\" obligatoire.");
			valid = false;
		}else if( email == "" ){ 
			alert("Vous n'avez pas rempli le champ \"Email\" obligatoire.");
			valid = false;
		}   
    else if( date == "" ){ 
			alert("Vous n'avez pas rempli le champ \"Date\" obligatoire.");
			valid = false;
		} 
		  else if (email.length > 0){

	            var valide1 = false;
	
	            for(var j=1;j<(email.length);j++){
		              if(email.charAt(j)=='@'){
			                 if(j<(email.length-4)){
				                    for(var k=j;k<(email.length-2);k++){
					                       if(email.charAt(k)=='.') {valide1=true;}					     
				                    }
			                  }
		              }
	           }
	if(valide1==false) {alert("L'adresse email saisie n'est pas valide.");}
	//return valide1;
	     else { valid = true; }
		
		  }
		
if(valid) document.FormuLocationWait.submit();

}


function focus_form_contact(color)
{                           
  //var nom = document.FormuContact.nom.value;
  var nom = window.document.getElementById("field");
                                  
  nom.style.border = "2px outset"+ color +";";
  //      alert ("OK");
}



