

<!--
/******************************************
    Librairie
******************************************/

var InternetExplorer= navigator.appName.indexOf ("Microsoft") !=-1; // verif du navigateur
var thewin = null;
var thewin2 = null;
var thewin3 = null;
if (!InternetExplorer) {
var origWidth = innerWidth;
var origHeight = innerHeight;
}      

function CrsPackage(cluster, price, nights, title)
{
waction = "http://www.fastbooking.com/00000001/032/023112/presearch.phtml?clusterName="+cluster;
if (price != "") waction += "&FSTBKNGCode="+price;
if (nights != "") waction += "&nights="+nights;
if (title != "") waction += "&title="+escape(title);
window.open(waction,"searchpackages","toolbar=no,width=650,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

function hotelBooking(val, lg)
{
	window.open("http://www.fastbooking.com/00000001/032/023112/preresa.phtml?Hotelnames="+val+"&langue="+lg,"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

function hhotelcode(val, codeval, lg){
	if(codeval.length > 0) {
		window.open("http://www.fastbooking.com/00000001/032/023112/preresa.phtml?Hotelnames="+val+"&langue="+lg+"&FSTBKNGCode="+codeval,"reservation","toolbar=no,width=700,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
	}
}

function openwindow(theurl,winname,theWidth,theHeight,theScroll){
if (thewin && !thewin.closed && thewin.name!=winname) {thewin.close();}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable=0";
thewin = window.open(theurl,winname,winfeatures);
thewin.document.close();
thewin.focus();
}

function openwindow2(theurl,winname,theWidth,theHeight,theScroll){
if (thewin2 && !thewin2.closed && thewin2.name!=winname) {thewin2.close();}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=50,left=50,screenX=50,screenY=50,resizable=0";
thewin2 = window.open(theurl,winname,winfeatures);
thewin2.document.close();
thewin2.focus();
}

function openwindow3(theurl,winname,theWidth,theHeight,theScroll){
if (thewin3 && !thewin3.closed && thewin3.name!=winname) {thewin3.close();}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=100,left=100,screenX=100,screenY=100,resizable=0";
thewin3 = window.open(theurl,winname,winfeatures);
thewin3.document.close();
thewin3.focus();
}

function cab(val, lg)
{
window.open("http://www.fastbooking.com/00000001/032/CAB/preresa.phtml?Hotelnames="+val+"&langue="+lg,  
"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

function openwindow_Send(thePath){
	openwindow("../send/send.asp?path="+thePath,"win4",350,506,0);
}


function opencreditsForHome(){
	openwindow("credits/credits.asp","win5",516,506,0);
}

function openwindow_Sejour(code_type){
	openwindow_Prog(code_type, '', '', '0')
}

function openwindow_Prog(code_type, liste, windowPos, menu){
	openwindow2("../prog/"+code_type+".asp?liste="+liste+"&windowpos="+windowPos+"&menu="+menu,"win10",500,484,0);
}

function openwindow_Comb(code_type, liste, windowPos, menu){
	openwindow2("../comb/"+code_type+".asp?liste="+liste+"&windowpos="+windowPos+"&menu="+menu,"win9",500,484,0);
}

function openwindow_Aqua(code_type, liste, windowPos, menu){
	openwindow3("../aqua/"+code_type+".asp?liste="+liste+"&windowpos="+windowPos+"&menu="+menu,"win7",500,484,0);
}

function openwindow_Soin(code_type, liste, windowPos, menu){
	openwindow("../treatments/"+code_type+".asp?liste="+liste+"&windowpos="+windowPos+"&menu="+menu,"win8",500,484,0);
}

/**** Gestion des Rollovers ****/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function top() {
  window.location="#top";
}

function gotoUrlOffres(theUrlFolder,theFileName) {
	
		var absoluteUrl= theUrlFolder.toLowerCase().indexOf("http://") !=-1;
		if (absoluteUrl) {
			window.open(theUrlFolder,'link','location=1,status=1,menubar=1,toolbar=1,scrollbars=1,top=0,left=0,screenX=0,screenY=0,resizable=1');
		}else{
			if (parent.window.opener && !parent.window.opener.closed) {
				parent.window.opener.parent.document.location=theUrlFolder+"/default.asp?"+"BOTTOM="+theFileName;
			}else{
				window.open(theUrlFolder+"/default.asp?"+"BOTTOM="+theFileName,'link','location=1,status=1,menubar=1,toolbar=1,scrollbars=1,top=0,left=0,screenX=0,screenY=0,resizable=1');
			}
		}
		parent.window.close();
}

function gotoUrl(theUrlFolder,theFileName) {
	var absoluteUrl= theUrlFolder.toLowerCase().indexOf("http://") !=-1;
	if (absoluteUrl) {
		window.open(theUrlFolder,'link','location=1,status=1,menubar=1,toolbar=1,scrollbars=1,top=0,left=0,screenX=0,screenY=0,resizable=1');
	}else{
		document.link.BOTTOM.value=theFileName;
		document.link.action=theUrlFolder+"/default.asp";
		document.link.target="_top";
		document.link.submit();
	}
}

function gotoUrlTop(theUrlFolder,theFileName) {
	var absoluteUrl= theUrlFolder.toLowerCase().indexOf("http://") !=-1;
	if (absoluteUrl) {
		window.open(theUrlFolder,'link','location=1,status=1,menubar=1,toolbar=1,scrollbars=1,top=0,left=0,screenX=0,screenY=0,resizable=1');
	}else{
		//alert(parent.frames[1].location);
		parent.frames[1].document.link.BOTTOM.value=theFileName;
		parent.frames[1].document.link.action=theUrlFolder+"/default.asp";
		parent.frames[1].document.link.target="_top";
		parent.frames[1].document.link.submit();
	}
}


function enews() {
	if (self.location.toString().indexOf("/e_news/") !=-1) {
		self.location="presentation.asp";
	}else{
		gotoUrl("../e_news","presentation.asp");
	}
}

function contact() {
	if (self.location.toString().indexOf("/contact/") !=-1) {
		self.location="presentation.asp";
	}else{
		gotoUrl("../contact","presentation.asp");
	}
}

function resetform(formName) {
	eval("document."+formName+".reset()");
}


function booking() {
	if (self.location.toString().indexOf("/booking/") !=-1) {
		self.location="presentation.asp";
	}else{
		gotoUrlTop("../booking","presentation.asp");
	}
}

function visit() {
	if (self.location.toString().indexOf("/overlooking_the_sea/") !=-1) {
		self.location="unique_place.asp";
	}else{
		gotoUrlTop("../overlooking_the_sea","unique_place.asp");
	}
}

function visithome() {
	document.link.BOTTOM.value="unique_place.asp";
	document.link.action="overlooking_the_sea/default.asp";
	document.link.target="_top";
	document.link.submit();
}


function profile() {
	if (self.location.toString().indexOf("/check_your_profile/") !=-1) {
		self.location="presentation.asp";
	}else{
		gotoUrlTop("../check_your_profile","presentation.asp");
	}
}

function validField(theFormName,selectedField,theMsg) {
	field = eval("document."+theFormName+"."+selectedField);
	str = field.value;
  	if  (str =="") {
        window.alert(theMsg);
    	field.focus();
    	field.select();
    	return false;
  	} else {
  		return true;
  	}
}

function validBrochureSelection(theFormName,field,compteur,theMsg) {
	result=0;
	for (i=0;i<=compteur;i++) {
		if (eval("document."+theFormName+"."+field+"[i].checked")) {
			result++;
		}
	}
	if (result==0) {
		field = eval("document."+theFormName+"."+field+"[0]");
		window.alert(theMsg);
    	field.focus();
    	//field.select();
    	return false;
  	} else {
  		return true;
  	}
}

function validEmail(theFormName,selectedField,theMsg) {
	field = eval("document."+theFormName+"."+selectedField);
	str = field.value;
  	if (window.RegExp) {
    	var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    	var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
    	var reg1 = new RegExp(reg1str);
    	var reg2 = new RegExp(reg2str);
    	if (!(!reg1.test(str) && reg2.test(str))) {
     		window.alert(theMsg);
    		field.focus();
    		field.select();
    		return false;
    	}else{
    		return true;
    	}
  	} else {
    	serie=str.split(" ");
  		nb=serie.length;
  		newstr="";
  		for(i=0; i<nb;i++) {
  			newstr=newstr+serie[i];
  		}
  		if ( newstr =="" || newstr.indexOf("@")== -1 || newstr.indexOf(".")== -1 || newstr.indexOf(" ")!= -1) {
        	window.alert(theMsg);
        	field.focus();
        	field.select();
        	return false;
  		}else{
    		return true;
    	}
  	}
}

function validationFormPrintRequest(theFormName,msg,msgEmail) { 
  if (validField(theFormName,'CIVILITE',msg)) {
  	field = eval("document."+theFormName+".CIVILITE");
  	field2= eval("document."+theFormName+".CIVILITENAME");
	for (i=0;i<field.length;i++){
		if (field[i].selected){field2.value=field[i].text}
	}
  	if (validField(theFormName,'PRENOM',msg)) {
  		if (validField(theFormName,'NOM',msg)) {
  			if (validField(theFormName,'ADRESSE',msg)) {
  				if (validField(theFormName,'CODEPOSTAL',msg)) {
  					if (validField(theFormName,'VILLE',msg)) {
  						if (validField(theFormName,'PAYS',msg)) {
  						
						field = eval("document."+theFormName+".PAYS");
  						field2= eval("document."+theFormName+".PAYSNAME");
						for (i=0;i<field.length;i++){
							if (field[i].selected){field2.value=field[i].text}
						}
  							if (validField(theFormName,'EMAIL',msg)) {
  								if (validEmail(theFormName,'EMAIL',msgEmail)) {
  									if (validBrochureSelection(theFormName,'BRO',9,msg)) {
										field = eval("document."+theFormName+".PROFESSION");
										field2= eval("document."+theFormName+".PROFESSIONNAME");
										for (i=0;i<field.length;i++){
											if (field[i].selected){field2.value=field[i].text}
										}
										field = eval("document."+theFormName+".AGE");
										field2= eval("document."+theFormName+".AGENAME");
										for (i=0;i<field.length;i++){
											if (field[i].selected){field2.value=field[i].text}
										}
  										eval("document."+theFormName+".submit()");
  										return true;
  									}
  									
  								}
  							}
  						}
  					}
  				}
  			}
  		}
  	}
  }
  return false;
}  

function validationFormEnews(theFormName,msg,msgEmail) { 
  if (validField(theFormName,'CIVILITE',msg)) {
  	field = eval("document."+theFormName+".CIVILITENAME");
	if (field.value=="") {field.value=eval("document."+theFormName+".CIVILITE.options[0].text")};
  	if (validField(theFormName,'PRENOM',msg)) {
  		if (validField(theFormName,'NOM',msg)) {
  			if (validField(theFormName,'EMAIL',msg)) {
  				if (validEmail(theFormName,'EMAIL',msgEmail)) {
  					eval("document."+theFormName+".submit()");
  					//document.formulaire.submit();
  					return true;
  				}
  			}
  		}
  	}
  }
  return false;
}  

function validationFormSend(theFormName,msgFrom,msgTo) {
	if (!validEmail(theFormName,'FROM',msgFrom)) {return false;};
	if (eval("document."+theFormName+".LISTETO.value")=="") {
		if (!validEmail(theFormName,'TO',msgTo)) {return false;};	
  	}else{
  		if (eval("document."+theFormName+".TO.value")!="") {
  			if (!validEmail(theFormName,'TO',msgTo)) {return false;};	
  		}
  	}
	eval("document."+theFormName+".submit()");
  	return true;
}

 function resetFormSend(){
 	document.formulaire.reset();
 	document.formulaire.TEST.options.length=0;
 	document.formulaire.LISTETO.value="";
 }

function openwindow_VR_Spa(theVR,theLang){
	openwindow("http://195.154.238.164/viewer/ng/classic/viewer.asp?Ref=vv777108&width=650&language="+theLang+"&num="+theVR,"win11",650,530,0);
}

//-->

