


function check(valeur1) {
var mot=0

if (valeur1.nom.value!="")
{
mot=mot+1
}
if (valeur1.tel.value!="")
{
mot=mot+1
}
if (valeur1.pays.value!="")
{
mot=mot+1
}

d=0
 // Puis nous recherchons des espaces dans l'adresse e-mail 
  // '-1' signifie qu'aucun espace n'a été trouvé. 
  if(valeur1.adr.value.search(/ /) != '-1') 
  {    } else {d=d+1}

  // Pour finir, nous vérifions le format. 
  // Pour cela, nous fractionnons l'adresse en deux. 
  // (avant et après le caractère"@" 
  s = valeur1.adr.value.split(/@/); 

  // Avec un seul caractère "@" il ne peut y avoir que deux parties. 
  if((s.length != 2) || s[0] == '' || s[1] == '') 
  {     } else {d=d+1}



if (d==2)
{
mot=mot+1
}

if (mot==4)
{

valeur1.action='envoi.asp'

alert ("Formulaire bien rempli")
}
else
{
valeur1.action='javascript:void(0)'
alert ("Toutes les cases marqués (*) doivent être complétées")
}

return valeur1

}

//window.onerror=stoperror

function stoperror(){
 return true
}

setTimeout ("changePage()", 10)

function changePage() {
 if (self.parent.frames.length != 0) {
  self.parent.location=self.location
 }
}

function initArray() {
 this.length = initArray.arguments.length;
 for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i]
 }
}

function MakeArray(n) {
	this.length = n
	return this
}

function VersionNavigateur(Netscape,Explorer) {
 if ((navigator.appVersion.substring(0,3))=="") return false;
 if ((navigator.appVersion.substring(0,3)>=3 && navigator.appName=='Netscape') || (navigator.appVersion.substring(0,3)>=4 && navigator.appName.substring(0,9)=='Microsoft')) 
 		{return true} 
 else {return false}
}

var isNS=(navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4)
var isMAC=(navigator.appVersion.indexOf("Mac")!=-1)
var HIDDEN=(isNS) ? 'hide' : 'hidden'
var VISIBLE=(isNS) ? 'show' : 'visible'
var lieuHebergement=document.location.toString()
var nbMenuDyn= 4

if (VersionNavigateur(4.0,4.0)) {
}
else {
 alert("Désolé ... le navigateur que vous utilisez est trop ancien. Nous vous conseillons d'installer Internet Explorer 6.")
}

function inj(c) {
 document.write(c)
}

function on(imgName) {
 imgOn=eval(imgName + "on.src")
 document[imgName].src=imgOn
}

function off(imgName) {
 document[imgName].src=eval(imgName + "off.src")
}

function ouvrirPhoto(url,x,y) {
 if (url != "") {
  x=x+18
  y=y+23
  var MinWin, winOpts="width="+x+",height="+y+",resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no"
  if (((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>3)) || (navigator.appName == "Netscape")) {
   pere=top
  }
  nouvelle_fenetre=window.open(url,'photo', winOpts)  
  if (((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>3)) || (navigator.appName == "Netscape")) {
   nouvelle_fenetre.pere=pere
  }
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion)<3)) {
   top.name="principale"
  }	
  if (navigator.appVersion.indexOf("(X11") != -1 || navigator.appVersion.indexOf("(Mac") != -1) {
   nouvelle_fenetre=window.open(url,'', winOpts)
  }
  if (navigator.appName == "Netscape" && (parseInt(navigator.appVersion) >=3 )) {
   nouvelle_fenetre.focus()
  }
 }
}

function ouvrirFenetreCentree(adresse,nomFenetre,w,h,scroll) {
 var win
 LeftPosition=(screen.width) ? (screen.width-w)/2-10 : 0
 TopPosition=(screen.height) ? (screen.height-h)/2-10 : 0
 parametres='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
 if ((adresse.substring(adresse.length-3,adresse.length).toUpperCase()=="GIF") || (adresse.substring(adresse.length-3,adresse.length).toUpperCase()=="JPG")) {
  win=window.open("",nomFenetre,parametres)
  win.document.write("<html><head><title>Hôtel Le Donjon (Carcassonne)</title>\n")
  win.document.write("<meta http-equiv=\"imagetoolbar\" content=\"no\">\n")
  win.document.write("</head><body bgcolor=white>\n")
  win.document.write("<center><img src=\""+adresse+"\"></center>\n")
  win.document.write("</body></html>\n")
  win.document.close()
 }
 else {
  win=window.open(adresse,nomFenetre,parametres)
 }
}

function ouvrirFenetre360(adresse,nomFenetre,w,h,scroll) {
 var win
 LeftPosition=(screen.width) ? (screen.width-w)/2-10 : 0
 TopPosition=(screen.height) ? (screen.height-h)/2-10 : 0
 parametres='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
 if ((adresse.substring(adresse.length-3,adresse.length).toUpperCase()=="GIF") || (adresse.substring(adresse.length-3,adresse.length).toUpperCase()=="JPG")) {
  win=window.open("",nomFenetre,parametres)
  win.document.write("<html><head><title>Hôtel Le Donjon (Carcassonne)</title>\n")
  win.document.write("<meta http-equiv=\"imagetoolbar\" content=\"no\">\n")
  win.document.write("</head><body bgcolor=white>\n")
  win.document.write("<center><img src=\""+adresse+"\"></center>\n")
  win.document.write("</body></html>\n")
  win.document.close()
 }
 else {
  win=window.open(adresse,nomFenetre,parametres)
 }
}



function ouvrirFenetreCentree2(adresse,nomFenetre,w,h,scroll) {
 var win
 LeftPosition=(screen.width) ? (screen.width-w)/2 : 0
 TopPosition=(screen.height) ? (screen.height-h)/2 : 0
 parametres='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=yes'
 if ((adresse.substring(adresse.length-3,adresse.length).toUpperCase()=="GIF") || (adresse.substring(adresse.length-3,adresse.length).toUpperCase()=="JPG")) {
  win=window.open("",nomFenetre,parametres)
  win.document.write("<html><head><title>Hôtel Le Donjon-Les Remparts & Hôtel Mercure</title>\n")
  win.document.write("<meta http-equiv=\"imagetoolbar\" content=\"no\">\n")
  win.document.write("</head><body bgcolor=#EDEAE3>\n")
  win.document.write("<center><img src=\""+adresse+"\"></center>\n")
  win.document.write("</body></html>\n")
  win.document.close()
 }
 else {
  win=window.open(adresse,nomFenetre,parametres)
 }
}

function erreur() {
 alert("En construction !")
}

function montrerObjet(objet) {
 objet.visibility = VISIBLE
}

function cacherObjet(objet) {
 objet.visibility = HIDDEN
}

function placerObjet(objet,px,py) {
 objet.left=px
 objet.top=py
}

function onOption(imgName) {
 imgOn=eval("option"+imgName+"on.src")
 document.option.src=imgOn
}

function offOption(imgName) {
 document.option.src=optionoff.src
}

function VerifSaisie() {
 if (document.formulaire.Nom.value == "") {
  alert("Vous devez remplir tous les champs du formulaire.\n\nMerci de bien vouloir entrer votre nom.")
  return false
 }
 else {
  if (document.formulaire.Adresse.value == "") {
   alert("Vous devez remplir tous les champs du formulaire.\n\nMerci de bien vouloir entrer votre adresse.")
   return false
  }
  else {
   if (document.formulaire.Code_postal.value == "") {
    alert("Vous devez remplir tous les champs du formulaire.\n\nMerci de bien vouloir entrer votre code postal.")
    return false
   }
   else {
    if (document.formulaire.Ville.value == "") {
     alert("Vous devez remplir tous les champs du formulaire.\n\nMerci de bien vouloir entrer votre ville.")
     return false
    }
   }
  }
 }
 return true
}

function ouvrir(choix,t) {
 if (t=="form") {
  url=choix.options[choix.selectedIndex].value
 }
 else {
  url=choix
 }
 if (url != "") {
  var MinWin, winOpts="width=600,height=500,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no"
  if (((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>3)) || (navigator.appName == "Netscape")) {
   pere=top
  }
  nouvelle_fenetre = window.open(url,'', winOpts)  
  if (((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>3)) || (navigator.appName == "Netscape")) {
   nouvelle_fenetre.pere=pere
  }
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion)<3)) {
   top.name="principale"
  }	
  if (navigator.appVersion.indexOf("(X11") != -1 || navigator.appVersion.indexOf("(Mac") != -1) {
   nouvelle_fenetre=window.open(url,'', winOpts)
  }
  if (navigator.appName == "Netscape" && (parseInt(navigator.appVersion) >=3 )) {
   nouvelle_fenetre.focus()
  }
 }
}

function initialiserCouches(couche, numPage) {
 if (VersionNavigateur(99,4.0)) {
  var i=1
  cd=new Array(50)
  while (i<=nbMenuDyn) {
   cd[i]= (isNS) ? eval("document.cd"+i) : eval("document.all.cd"+i+".style")
	 cd[i].display='none'   
	 if (i==couche) {cd[i].display='block'}
	 i++
  }
	op1.src='pixel.gif'
	op2.src='pixel.gif'
	op3.src='pixel.gif'
	op4.src='pixel.gif'
	op5.src='pixel.gif'
	op6.src='pixel.gif'
	op7.src='pixel.gif'
//	op8.src='pixel.gif'
	op9.src='pixel.gif'
	op10.src='pixel.gif'
	op11.src='pixel.gif'
	op12.src='pixel.gif'
	op13.src='pixel.gif'
	op14.src='pixel.gif'
	op15.src='pixel.gif'
	op16.src='pixel.gif'
	op17.src='pixel.gif'
	op18.src='pixel.gif'
	op19.src='pixel.gif'
	op20.src='pixel.gif'
	op21.src='pixel.gif'
	op22.src='pixel.gif'
	op23.src='pixel.gif'
	op24.src='pixel.gif'
	op25.src='pixel.gif'
	op26.src='pixel.gif'
	op27.src='pixel.gif'
	op28.src='pixel.gif'
	op29.src='pixel.gif'
	op30.src='pixel.gif'
	op31.src='pixel.gif'
	op32.src='pixel.gif'
	op33.src='pixel.gif'
	op34.src='pixel.gif'


	if (numPage==1) {op1.src='cocher.gif'}
	if (numPage==2) {op2.src='cocher.gif'}
	if (numPage==3) {op3.src='cocher.gif'}
	if (numPage==4) {op4.src='cocher.gif'}
	if (numPage==5) {op5.src='cocher.gif'}
	if (numPage==6) {op6.src='cocher.gif'}
	if (numPage==7) {op7.src='cocher.gif'}
//	if (numPage==8) {op8.src='cocher.gif'}
	if (numPage==9) {op9.src='cocher.gif'}
	if (numPage==10) {op10.src='cocher.gif'}
	if (numPage==11) {op11.src='cocher.gif'}
	if (numPage==12) {op12.src='cocher.gif'}
	if (numPage==13) {op13.src='cocher.gif'}
	if (numPage==14) {op14.src='cocher.gif'}
	if (numPage==15) {op15.src='cocher.gif'}
	if (numPage==16) {op16.src='cocher.gif'}
	if (numPage==17) {op17.src='cocher.gif'}
	if (numPage==18) {op18.src='cocher.gif'}
	if (numPage==19) {op19.src='cocher.gif'}
	if (numPage==20) {op20.src='cocher.gif'}
	if (numPage==21) {op21.src='cocher.gif'}
	if (numPage==22) {op22.src='cocher.gif'}
	if (numPage==23) {op23.src='cocher.gif'}
	if (numPage==24) {op24.src='cocher.gif'}
	if (numPage==25) {op25.src='cocher.gif'}
	if (numPage==26) {op26.src='cocher.gif'}
	if (numPage==27) {op27.src='cocher.gif'}
	if (numPage==28) {op28.src='cocher.gif'}
	if (numPage==29) {op29.src='cocher.gif'}
	if (numPage==30) {op30.src='cocher.gif'}
	if (numPage==31) {op31.src='cocher.gif'}
	if (numPage==32) {op32.src='cocher.gif'}
	if (numPage==33) {op33.src='cocher.gif'}
	if (numPage==34) {op34.src='cocher.gif'}
 }
}

function dynamique(couche) {
 if (VersionNavigateur(99,4.0)) { 
  var i=1  
  while (i<=nbMenuDyn) {
   if (i!=couche) {cd[i].display='none'}
	 i++
  }
  cd[couche].display=(cd[couche].display=='block') ? 'none' : 'block'
 }
}

function rollImage(act)
{
	var id="reservezBt"
	if(document.images) document.images[id].src = eval(id + act + ".src");
}

if (document.images) {
  reservezBt0 = new Image();
	reservezBt0.src = "reservez.jpg";
	reservezBt1 = new Image();
	reservezBt1.src = "reservezOver.jpg";
}
