/*
if (document.images)
   { var1 = new Image; var1 = "images/accueil_2.jpg";
     var2 = new Image; var2 = "images/situation_2.jpg";
     var3 = new Image; var3 = "images/nos_prix_2.jpg";
     var4 = new Image; var4 = "images/reservation_2.jpg";
     var5 = new Image; var5 = "images/contact_2.jpg";
   }
*/



function superpo(photo)
{ var objet = document.getElementById(photo);
  objet.style.display = "block";
}



function popup(page)
{ window.open(page,'popup','width=319,height=350,toolbar=false,scrollbars=no,top=0,left=0');
}



function popupimage(img)
{ titre = "Htel Poussin, Paris";
  w = open("",'image','width=500,height=500,toolbar=no,scrollbars=no,resizable=yes');	
  w.document.write("<html><head><title>" + titre + "<\/title><\/head>");
  w.document.write("<script type='text/javascript'>");
  w.document.write("function checksize()");
  w.document.write("{ if (document.images[0].complete)");
  w.document.write("     {  window.resizeTo(document.images[0].width+16,document.images[0].height+60);");
  w.document.write("        window.focus();");
  w.document.write("     }");
  w.document.write("     else");
  w.document.write("     { setTimeout('check()',250);");
  w.document.write("     }");
  w.document.write("}");
  w.document.write("<\/script>");
  w.document.write("<body onload='checksize()'>");
  w.document.write("<img src='" + img + "' border='0' alt='' \/>");
  w.document.write("<\/body><\/html>");
  w.document.close();
}



////////////////////////////////////////////////////////////////
// Formatage du prenom
////////////////////////////////////////////////////////////////

function format_prenom()
{ var prenom    = window.document.form_contact.contact_prenom.value;
  var newprenom = window.document.form_contact.contact_prenom.value.charAt(0).toUpperCase();
  for (i=1 ; i<prenom.length ; i++)
      { newprenom += prenom.charAt(i).toLowerCase();
        if ((prenom.charAt(i)==" ") || (prenom.charAt(i)=="-"))
           { newprenom += prenom.charAt(i+1).toUpperCase();
             i++;
           }
      }
  window.document.form_contact.contact_prenom.value = newprenom;
}



////////////////////////////////////////////////////////////////
// Deformatage du numero de telephone, du code postal, ...
////////////////////////////////////////////////////////////////

function deformat(objet)
{ var nouv = '';
  var caractere;
  switch (objet)
         { case 'cp'  : var anc = window.document.form_contact.contact_cp.value;  var autorises = '0123456789ABab'; break;
           case 'tel' : var anc = window.document.form_contact.contact_tel.value; var autorises = '0123456789';     break;
         }
  for (var i=0 ; i<anc.length ; i++)
      { caractere = anc.charAt(i);
        if (autorises.indexOf(caractere)!=-1)
           { nouv += caractere;
           }
      }
  switch (objet)
         { case 'cp'  : window.document.form_contact.contact_cp.value = nouv;  break;
           case 'tel' : window.document.form_contact.contact_tel.value = nouv; break;
         }
}



////////////////////////////////////////////////////////////////
// Affichage du bouton RESET du formulaire de contact
////////////////////////////////////////////////////////////////

function modif(code)
{ isIE = (document.all);
  isNN6 = (!isIE) && (document.getElementById);
  if (isIE)  btn = document.all['modif'];
  if (isNN6) btn = document.getElementById('modif');
  btn.style.visibility = (code==0 ? "hidden" : "visible");
}
