// function popup_globres(langue)
// function popup_img(img)
// function format_prenom()
// function deformat(objet)
// function modif(code)





////////////////////////////////////////////////////////////////
// Pop-up pour Global Reservation
////////////////////////////////////////////////////////////////

function popup_globres(langue)
{ page = 'https://reservations.synxis.com/LBE/rez.aspx?Hotel=17129&Chain=5375&locale=' + langue;
  w = open(page,'hotel_ribera','left=50,top=50,width=500,height=550,titlebar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,statusbar=yes,location=no');
  w.focus();
}



////////////////////////////////////////////////////////////////
// Pop-up pour toute image
////////////////////////////////////////////////////////////////

function popup_img(img)
{ w = open(img,"H&ocirc;tel RIBERA","left=50,top=50,width=800,height=600,titlebar=no,menubar=no,toolbar=no,scrollbars=no,resizable=no,statusbar=no,location=no");
  w.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' + "\n");
  w.document.write("<html>\n");
  w.document.write("<head>\n");
  w.document.write("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' \/>\n");
  w.document.write("<title>H&ocirc;tel RIBERA, Paris</title>\n");
  w.document.write("<meta name='author'             content='Jerome F. GOUDEAU, TROIS DOUBLES' \/>\n");
  w.document.write("<meta name='content-language'   content='fr' \/>\n");
  w.document.write("<meta name='Identifier-URL'     content='http://www.hotel-ribera.fr/' \/>\n");
  w.document.write("<meta name='language'           content='French' \/>\n");
  w.document.write("<meta name='reply-to'           content='contact@trois-doubles.fr' \/>\n");
  w.document.write("<meta name='robots'             content='noindex, nofollow' \/>\n");
  w.document.write("</head>\n");
  w.document.write("<body style='margin:0'>\n");
  w.document.write("<img src='" + img + "' border='0' alt='' \/>\n");
  w.document.write("<\/body>\n");
  w.document.write("<\/html>\n");
  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");
}
