//-->
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_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_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 temps(date)
{
var d = new Date(date[2], date[1] - 1, date[0]);
return d.getTime();
}


function trim(string) 
{ 
return string.replace(/(^\s*)|(\s*$)/g,''); 
}
function DecocheDestinations()
{
for (i= 0; i < 15; i++) {

document.Form1.destination[i].checked=false;

}	
}
function verifmoteur()
{
var top_destination="";
var nb_destination=15
for (i= 0; i < 15; i++) {

if(document.Form1.destination[i].checked==true) top_destination=document.Form1.destination[i].value;

}

if((document.Form1.pays.value == "") && (top_destination== ""))
 {
alert(' Merci de choisir une destination !!');
return false; 
 }
else
{
	
var destinationcode="";
if(document.Form1.pays.value!="") destinationcode=document.Form1.pays.value;
if(top_destination!="") destinationcode=top_destination;	
	
var strCode1 = document.Form1.DropDownList_RoomType0.value;
var strCode2 = document.Form1.DropDownList_RoomType1.value;
var strCode3 = document.Form1.DropDownList_RoomType2.value;
var strCode4 = document.Form1.DropDownList_RoomType3.value;
var strRoomCode= strCode1 + ";" + strCode2 + ";" + strCode3+ ";" + strCode4;


var strRoomsCount = document.Form1.DropDownList_RoomCount0.value + ";" + document.Form1.DropDownList_RoomCount1.value + ";" + document.Form1.DropDownList_RoomCount2.value + ";" + document.Form1.DropDownList_RoomCount3.value + ";";





var strCotsCount= document.Form1.DropDownList_CotsCount0.value + ";" + document.Form1.DropDownList_CotsCount1.value  + ";" + document.Form1.DropDownList_CotsCount2.value + ";" + document.Form1.DropDownList_CotsCount3.value + ";";





var strChildAge="";
var strChildAge00 = "";
var strChildAge01 = "";
var strChildAge02 = "";
var strChildAge03 = "";
var strChildAge10 = "";
var strChildAge11 = "";
var strChildAge12 = "";
var strChildAge13 = "";
var strChildAge20 = "";
var strChildAge21 = "";
var strChildAge22 = "";
var strChildAge23 = "";
var strChildAge30 = "";
var strChildAge31 = "";
var strChildAge32 = "";
var strChildAge33 = "";

if(document.Form1.Dropdownlist_Age00!= null)   strChildAge00 = document.Form1.Dropdownlist_Age00.value ;
if(document.Form1.Dropdownlist_Age01!= null)   strChildAge01 = document.Form1.Dropdownlist_Age01.value ;
if(document.Form1.Dropdownlist_Age02!= null)   strChildAge02 = document.Form1.Dropdownlist_Age02.value ;
if(document.Form1.Dropdownlist_Age03!= null)   strChildAge03 = document.Form1.Dropdownlist_Age03.value ;
if(document.Form1.Dropdownlist_Age10!= null)   strChildAge10 = document.Form1.Dropdownlist_Age10.value ;
if(document.Form1.Dropdownlist_Age11!= null)   strChildAge11 = document.Form1.Dropdownlist_Age11.value ;
if(document.Form1.Dropdownlist_Age12!= null)   strChildAge12 = document.Form1.Dropdownlist_Age12.value ;
if(document.Form1.Dropdownlist_Age13!= null)   strChildAge13 = document.Form1.Dropdownlist_Age13.value ;
if(document.Form1.Dropdownlist_Age20!= null)   strChildAge20 = document.Form1.Dropdownlist_Age20.value ;
if(document.Form1.Dropdownlist_Age21!= null)   strChildAge21 = document.Form1.Dropdownlist_Age21.value ;
if(document.Form1.Dropdownlist_Age22!= null)   strChildAge22 = document.Form1.Dropdownlist_Age22.value ;
if(document.Form1.Dropdownlist_Age23!= null)   strChildAge23 = document.Form1.Dropdownlist_Age23.value ;
if(document.Form1.Dropdownlist_Age30!= null)   strChildAge30 = document.Form1.Dropdownlist_Age30.value ;
if(document.Form1.Dropdownlist_Age31!= null)   strChildAge31 = document.Form1.Dropdownlist_Age31.value ;
if(document.Form1.Dropdownlist_Age32!= null)   strChildAge32 = document.Form1.Dropdownlist_Age32.value ;
if(document.Form1.Dropdownlist_Age33!= null)   strChildAge33 = document.Form1.Dropdownlist_Age33.value ;

                  

strChildAge = strChildAge00 + ";" + strChildAge01 + ";" + strChildAge02 + ";" + strChildAge03 + ";" 

                        + strChildAge10 + ";" +strChildAge11 + ";" + strChildAge12 + ";" + strChildAge13 + ";" 

                        + strChildAge20 + ";" + strChildAge21 + ";" + strChildAge22 + ";" + strChildAge23 + ";"

                        + strChildAge30 + ";" + strChildAge31 + ";" + strChildAge32 + ";" + strChildAge33 + ";";


               


var debut = temps(document.getElementById('TextBox_ArrivalDate').value.split("/"));
var fin = temps(document.getElementById('TextBox_DepartureDate').value.split("/"));
var ts = (fin - debut) / (1000 * 60 * 60 * 24); // + " jours";





  

                  var strUrl                = "http://booking.selectraveltours.com/cr.resa/gta/Hotel_List.aspx?user=725&curr=1&ilng=1&destinationtype=city"

                        + "&destinationcode=" + trim(destinationcode)

                        + "&checkindate=" + document.getElementById('TextBox_ArrivalDate').value

                        + "&duration=" + ts + "&roomcode=" + strRoomCode

                        + "&roomscount=" + trim(strRoomsCount) + "&cotscount=" + trim(strCotsCount) + "&age=" + trim(strChildAge)

						+ "&facility=&hotelname=&categrie=&location=&hotel=";
                       

 
//alert(strUrl); 
document.location.href=strUrl;
return false;               
}

}

function redirect()
{
location.href=document.rapide.acces.value;
}

function agrandir() {
  false;
}
function opennewwindow(page, nom, hauteur, largeur) {
options='height='+hauteur+',width='+largeur+',left=2, top=2,toolbar=no,scrollbars=yes';
newWindow=window.open(page, nom,options); 
}

function afficheMaxi(chemin)
	{
	Imageslim = new Image;
	Imageslim.src = chemin;
	titre='Jetsetmagazine.net';
	popupImage = window.open('','grande','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,height=10,width=10,left=0, top=0');
	html = '<HTML><HEAD><TITLE>'+titre+'</TITLE><link href="../../styles/styles.css" rel="stylesheet" type="text/css"></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 onLoad="self.focus();">';
	html =html+'<table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0"><tr>';
    html =html+'<td valign="middle"><table border="0" align="center" cellpadding="0" cellspacing="0"><tr>';
	html =html+'<td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr>';
	html =html+'<td align="left"><strong><img src="../../images/logo_min.gif" width="97" height="40" hspace="10" vspace="3"></strong></td>';
    html =html+'<td align="right" valign="bottom"><img src="../../images/url.gif" width="136" height="10" hspace="3" vspace="2"></td>';
    html =html+'</tr></table></td></tr><tr>';
    html =html+'<td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr>';
	html =html+'<td width="10" valign="top" background="../../images/bg_v.gif"><img src="../../images/coinv.gif" width="13" height="17" border="0"></td>';
   	html =html+'<td rowspan="2" bgcolor="#FFFFFF" class="photolarge"><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+50,document.imageTest.height+110);window.moveTo(100,100);self.focus();"></td>';
    html =html+'</tr><tr><td valign="bottom" background="../../images/bg_v.gif"><img src="../../images/coinfooter.gif" width="13" height="28" border="0" style="background-color:#292C33"></td></tr>';
    html =html+'</table></td></tr></table></td></tr></table></body></HTML>';      
      
		
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close();
	}
function VerificationEmail(elm)
{
if (elm.value.indexOf("@") != "-1" &&
    elm.value.indexOf(".") != "-1" &&
    elm.value != "")
    return true;

return false;
}

function Verifmail(formulaire)
{
	//alert(formulaire.email_newsletter.value);
	if(VerificationEmail(formulaire.email_newsletter) == false)

		{
		alert('Adresse e-mail invalide!!');
        formulaire.email_newsletter.focus();
		return false;		
		}
		else return true;
}


function more_rooms()
{
if(document.getElementById('tab_chambre1').style.display=='') document.getElementById('tab_chambre1').style.display='block';
else
{
if(document.getElementById('tab_chambre2').style.display=='') document.getElementById('tab_chambre2').style.display='block';
else if(document.getElementById('tab_chambre3').style.display=='') document.getElementById('tab_chambre3').style.display='block';
}
}


window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
	
if (d) {d.style.display='block';}

}

function chouf(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=15; i++) {
		if (document.getElementById('annee'+i)) {document.getElementById('annee'+i).style.display='none';}
	}
	
if (d) {d.style.display='block';}

}



function positionne(id) {
	
	var d = document.getElementById(id);
marge=(screen.width-953)/2+'px';
if (d) 
	{
	d.style.right=marge;
	d.style.display='block';
	}

}





function SwapOut(im)
{
	showCode(im);
	hideCode(im+'_on');
}
function SwapOver(im)
{
	hideCode(im);
	showCode(im+'_on');
}



function verifForm(formulaire)
{ 
///////////NOM
if(document.contact.nom.value == "")
 {
alert(' Entrez votre nom svp !!');
document.contact.nom.focus();
return false; 
 }
/////////PRENOM
if(document.contact.prenom.value == "")
 {
alert(' Entrez votre prénom svp !!');
document.contact.prenom.focus();
return false; 
 }
/////////Fonction
if(document.contact.fonction.value == "")
 {
alert(' Entrez votre fonction svp !!');
document.contact.fonction.focus();
return false; 
 }
 /////////societe
if(document.contact.societe.value == "")
 {
alert(' Entrez votre société svp !!');
document.contact.societe.focus();
return false; 
 }

    /////////tel
if(document.contact.tel.value == "")
 {
alert(' Entrez votre téléphone svp !!');
document.contact.tel.focus();
return false; 
 }
/////////////MAIL



	adresse = document.contact.mail.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
		{

}
	else
		{
		alert('Adresse email invalide!!');
        document.contact.mail.focus();
return false;		
}
	
if(document.contact.mail.value == "")
 {
alert(' Entrez votre adresse Email !!');
document.contact.mail.focus();
return false; 
 }
/////////SUJET
if(document.contact.sujet.value == "")
 {
alert(' Choisissez l\'objet de votre message !!');
document.contact.sujet.focus();
return false; 
}
 /////////message
if(document.contact.message.value == "")
 {
alert(' Saisissez votre message !!');
document.contact.message.focus();
return false; 
 }
if(document.contact.code.value == "")
 {
alert(' Recopiez le code svp  !!');
document.contact.code.focus();
return false; 
 }

else
return true;
}


function verifCand(formulaire)
{
	 ///////////NOM
if(document.contact.nom.value == "")
 {
alert(' Entrez votre nom svp !!');
document.contact.nom.focus();
return false; 
 }
/////////PRENOM
if(document.contact.prenom.value == "")
 {
alert(' Entrez votre prénom svp !!');
document.contact.prenom.focus();
return false; 
 }

/////////////MAIL



	adresse = document.contact.mail.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
		{

}
	else
		{
		alert('Adresse email invalide!!');
        document.contact.mail.focus();
return false;		
}
	
if(document.contact.mail.value == "")
 {
alert(' Entrez votre adresse Email svp  !!');
document.contact.mail.focus();
return false; 
 }
/////////tel
if(document.contact.tel.value == "")
 {
alert(' Entrez votre Numéro de téléphone svp  !!');
document.contact.tel.focus();
return false; 
 }
 /////////lettre
//if(document.contact.lettre.value == "")
// {
//alert(' Inserez votre lettre d\'accompagnement svp  !!');
//document.contact.lettre.focus();
//return false; 
// }
  /////////cv
//if(document.contact.cv.value == "")
// {
//alert(' Inserez votre CV svp  !!');
//document.contact.cv.focus();
//return false; 
// }
 /////////code
if(document.contact.code.value == "")
 {
alert(' Recopiez le code svp  !!');
document.contact.code.focus();
return false; 
 }

else
return true;
}
