function MM_reloadPage(init) {  //recharger fenetre si NN4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// popup
var ff,ff3,ffa;
function WinPop(fname,w,h) {
  if (ff3==null || ff3.closed) ff3=window.open(fname,'LaVillaTosca','resizable=yes,scrollbars=yes,width='+w+',height='+h);
  else {
 	ff3.focus();
	ff3.resizeTo(w+12,h+36);
	ff3.location.href=fname;
  }
}
function WinPopa(fname,w,h) {
  if (ffa==null || ffa.closed) ffa=window.open(fname,'LaVillaTosca','resizable=yes,scrollbars=no,width='+w+',height='+h);
  else {
 	ffa.focus();
	ffa.resizeTo(w+12,h+36);
	ffa.location.href=fname;
  }
}
function wPop(fname,larg,haut) {
  if (ff==null || ff.closed)ff=window.open(fname,"","scrollbars=yes,resizable=yes,width="+larg+",height="+haut);
  else{
   ff.focus();
   ff.location.href=fname;
  }
}  
function findObj(theObj, theDoc)
{
	var p, i, foundObj;  
	if(!theDoc) theDoc = document;
	// cas des frames
	if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){
		theDoc = parent.frames[theObj.substring(p+1)].document;
		theObj = theObj.substring(0,p);}
	// IE5 et 6, NN 6-7 et autres
	if(document.getElementById)
		foundObj = document.getElementById(theObj);
	// IE4
	else if(!(foundObj = theDoc[theObj]) && theDoc.all) // enlever else pour tester Document.all sous IE
		foundObj = theDoc.all[theObj];
	// cas des forms
	for (i=0; !foundObj && i < theDoc.forms.length; i++)
		foundObj = theDoc.forms[i][theObj];
	// NN4
	for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
		foundObj = findObj(theObj,theDoc.layers[i].document);
	return foundObj;
}
function showHideLayers()
{ 
  var i, visStr, obj, args = showHideLayers.arguments;
  for (i=0; i<(args.length-1); i+=2){
    if ((obj = findObj(args[i])) != null){
      visStr = args[i+1];
      if (obj.style){
        obj = obj.style;
        if(visStr == 'show') visStr = 'visible';
        else if(visStr == 'hide') visStr = 'hidden';}
      obj.visibility = visStr;}
  }
}
function showcalq(calque){
	var calq= new Array ("limage_img1","limage_img2","limage_img3","limage_img4","limage_img5","limage_img6")
	for(var i=0; i<calq.length; i++){
		visi=calq[i]==calque?'show':'hide';
	    if ((obj = findObj(calq[i])) != null){
	      	if (obj.style){
    	    	obj = obj.style;
				visi=calq[i]==calque?'visible':'hidden';}
			obj.visibility=visi;
		}
	}
}
function setLayerTop(calque,y)
{ 
	var obj;
	if ((obj = findObj(calque)) != null){
		if (obj.style) obj = obj.style;
		if (document.layers) obj.top=y;
		else obj.top = y+'px';
	}
}
var ffama;
function AmaLeg(fname){if (ffama==null || ffama.closed) ffama=window.open(fname,"","scrollbars=yes,resizable=yes,width=490,height=480");else{ffama.focus();ffama.location.href=fname;}}

//<!--
//document.write("<img src=http://stats.federal-hotel.com/eresa_105.gif>");
/*
function valider_cotehotel(hotel,langue)
{
	if(!langue)langue="fr";la=screen.width;ht=screen.height;ttop=(ht-"460")/2;tleft=(la-"700")/2;
	win=window.open("http://www.cote.azur.fr/portail/reservation.html?hotel_id="+hotel+"&popportail=1&direct=1&langue="+langue+"","FEN","top="+ttop+",left="+tleft+",menubar=no,width=700,height=460,status=yes,scrollbars=1");
	win.focus();
}

function resa_cotehotel(langue)
{
	if(!langue)langue="fr";la=screen.width;ht=screen.height;ttop=(ht-"460")/2;tleft=(la-"700")/2;
	win=window.open("http://www.cote.azur.fr/portail/reservation.html?hotel_id=105&popportail=1&direct=1&langue="+langue+"","FEN","top="+ttop+",left="+tleft+",menubar=no,width=700,height=460,status=yes,scrollbars=1,resizable=yes");
	win.focus();
}
-->
*/
/* 
function book_test(formulaire) {
var message='';
var todaydate=new Date();
var today=new Date(todaydate.getFullYear(),todaydate.getMonth(), todaydate.getDate());
choixdate=new Date(formulaire.FirstSelectMonth.options[formulaire.FirstSelectMonth.selectedIndex].value.substring(0,4), eval(formulaire.FirstSelectMonth.options[formulaire.FirstSelectMonth.selectedIndex].value.substring(4,6))-1, formulaire.FirstSelectDay.options[formulaire.FirstSelectDay.selectedIndex].value);
if (today<=choixdate) { } else {message='Invalid date - Date invalide.'};
if (message!='') alert(message);
else
{
 formulaire.target="_blank";
 formulaire.target="";
 formulaire.submit();
}
}

function setCurrentDate() {
  var currentDate = new Date();
  setDays();
  document.PW.FirstSelectDay.selectedIndex = currentDate.getDate() - 1;
   var mois = currentDate.getMonth()+1;
   var annee = currentDate.getFullYear();
   if( mois < 10)
     mois ="0"+ mois;
   var i;
   var anneemois = annee + "" +  mois;
   for( i = 0; i < document.PW.FirstSelectMonth.length; i++)
   {
	   if(document.PW.FirstSelectMonth.options[i].value == anneemois)
	   {
			document.PW.FirstSelectMonth.options[i].selected = true;
			break;
		}
   }
}

function setDays() {

  var Monthlong = document.PW.FirstSelectMonth.options[document.PW.FirstSelectMonth.selectedIndex].value;
  var m=Monthlong.substring(4,6);
  var y=eval(Monthlong.substring(0,4));

  days = 31;
  if ( (m == "04") || (m == "06") || (m == "09") || (m == "11") ) {
    days = 30;
  }
  else if (m == "02") {
    // check for leapyear - Any year divisible by 4, except those divisible by 100 (but NOT 400)
    if ( (Math.floor(y/4) == (y/4)) && ((Math.floor(y/100) != (y/100)) || (Math.floor(y/400) == (y/400))) )
      days = 29;
    else
      days = 28;
  }

  // if (days in new month > current days) then we must add the extra days
  if (days > document.PW.FirstSelectDay.length) {
    for (i = document.PW.FirstSelectDay.length; i < days; i++) {
      document.PW.FirstSelectDay.length = days;
      document.PW.FirstSelectDay.options[i].text = i + 1;
      document.PW.FirstSelectDay.options[i].value = i + 1;
    }
  }
  
  // if (days in new month < current days) then we must delete the extra days
  if (days < document.PW.FirstSelectDay.length) {
    document.PW.FirstSelectDay.length = days;
    if (document.PW.FirstSelectDay.selectedIndex == -1) 
      document.PW.FirstSelectDay.selectedIndex = days - 1;
  }
}
*/
