<!--
function MM_preloadImages() 
{ 
  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() 
{ 
  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)
{ 
  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() 
{ 
  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 MM_reloadPage(init)
{ 
  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();
}

function MM_showHideLayers()
{
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function prixv(nbtravellers,day,month,year,champ,mois0,jour0,an0,mois1,jour1,an1,prix1)
{
	var prixfinal;
	var year  = year.value;
	var month = month.value;
	var day   = day.value;
	
	if (day<10) day=0+''+day;
	if (month<10) month=0+''+month;
	dayselect=year+'/'+month+'/'+day;
	
	if (jour0<10) jour0=0+''+jour0;
	if (jour1<10) jour1=0+''+jour1;
	if (mois0<10) mois0=0+''+mois0;
	if (mois1<10) mois1=0+''+mois1;
	day1=an0+'/'+mois0+'/'+jour0;
	day2=an1+'/'+mois1+'/'+jour1;
	
	prixfinal='Not available';
	if (dayselect>=day1 && dayselect<=day2) prixfinal = prix1;
	
	document.getElementById(champ).value        = prixfinal*nbtravellers;
	document.getElementById('prixvoyage').value = prixfinal;
}

function singles(nbvoy,suppl,total,champ,champ2,nbsingles)
{
	if (!isNaN(document.getElementById(champ2).value))
	{
		suppl=nbsingles*suppl;
		T=parseInt(total)+parseInt(suppl);
	
		if (!isNaN(total) && nbsingles!=0)
		document.getElementById(champ).innerHTML=' + <span class="arial14bleu"><strong>'+ suppl +' </strong> ('+ nbsingles +' singles) </span> = <span class="arial14bleu"><strong> '+T+' </strong></span>';
		else
		document.getElementById(champ).innerHTML=' ';
   }
   else 
   {
	   document.getElementById(champ).innerHTML=' ';
	   document.getElementById(champ2).value='Not available';
   }
}


// Fonction permettant de calculer le prix single en Guided group
function single(nbvoy,suppl,total,champ,nbsingles)
{
	suppl = suppl*nbsingles;
	T=total*nbvoy+suppl;
	
	if ((!isNaN(total))&&nbsingles!=0)
		document.getElementById(champ).innerHTML=' + <span class="arial14bleu"><strong>'+ suppl +' </strong> ('+nbsingles+' singles) </span> = <span class="arial14bleu"><strong> '+T+' </strong></span>';
	else
		document.getElementById(champ).innerHTML=' ';
}


// Fonction permettant en fonction d'une date d'entrée et un nombre de jours, de calculer une date fin
function datefin(jour,mois,annee,nbjours,aff)
{
	var jour  = jour.value;
	var mois  = mois.value;
	var annee = annee.value;
	var jourfin;
	var moisfin;
	var anneefin;
	var vara=0;
	var varm=0;

	if ((mois==12) || (mois==1) || (mois==3)||(mois== 5)||(mois==7)||(mois==8)||(mois==10))
		if (parseInt(jour)+parseInt(nbjours)>31)
			{
			jourfin=parseInt(nbjours)-31+parseInt(jour);
			varm=1;
			}
		else
			jourfin=parseInt(nbjours)+parseInt(jour);

	else if ((mois==4) ||(mois==6) || (mois==8)||(mois==9)||(mois==11))
		if (parseInt(jour)+parseInt(nbjours)>30)
			{
			jourfin=parseInt(nbjours)-30+parseInt(jour);
			varm=1;
			}
		else
			jourfin=parseInt(nbjours)+parseInt(jour);
			
	else if (mois==2)
		if (parseInt(jour)+parseInt(nbjours)>28)
			{
			jourfin=parseInt(nbjours)-28+parseInt(jour);
			varm=1;
			}
			else
			jourfin=parseInt(nbjours)+parseInt(jour);

	moisfin = parseInt(mois)+varm;

	if (moisfin>12)
		{
		vara=1;
		moisfin=1;
		}

	anneefin=parseInt(annee)+vara;

	if (jourfin&&moisfin&&anneefin)
		document.getElementById(aff).value = jourfin+" / "+moisfin+" / "+anneefin;

}//datefin()

// Fonction qui permet de desactiver ou reactiver le bouton send en resa, en fonction des cases cochées
function changement()
{
	   if (document.getElementById('cb').checked == true && document.getElementById('accepte_single').checked == true && document.getElementById('chambres_ok').value == 1 && document.getElementById('places_ok').value == 1) // && (document.getElementById('day').checked == true||document.getElementById('evening').checked == true||document.getElementById('mail').checked == true))
		  document.getElementById('soumettre').disabled=false;
	   else
		  document.getElementById('soumettre').disabled=true;
}//changement()


function change(moi,champ)
{
	   if (document.getElementById(moi).value == '-1')
		  document.getElementById(champ).disabled=true;
	   else
		  document.getElementById(champ).disabled=false;
}//change()

function validation_dates(f,nbpassagers){
   var i;
   var nom, prenom, datenaissance;
   if (f.prixT1.value == 'Not available')
  	{
	alert ('Une des dates n\'est pas disponible !!!');
	return false;
	}
  else if (f.prixT1.value != '')
	{
		for (i=1;i<=nbpassagers;i++)
		{
		nom           = document.getElementById('nom'+i).value;
		prenom        = document.getElementById('prenom'+i).value;
		datenaissance = document.getElementById('datenaissance'+i).value;
		
		if (nom=='' || prenom=='' ||  datenaissance=='')
			{ 
				alert('Les informations d\'un des passagers ne sont pas remplies ! Passager '+i);
				return false;
			}
		}
	return true;
	}
  else 
	{
	alert ('Au moins une date doit etre sélectionnée !');
	return false;
	}
	
}

function validation(f) 
{
  if (f.bon_password.value != f.ancien_pwd.value)
  	{
	alert('Ancien mot de passe non valide !');
	return false;
	}
  else
  	{
	  if (f.nouveau_pwd.value == '' || f.nouveau_pwd2.value == '') {
		alert('Tous les champs ne sont pas remplis');
		f.nouveau_pwd.focus();
		return false;
		}
	  else if (f.nouveau_pwd.value != f.nouveau_pwd2.value) {
		alert('Ce ne sont pas les mêmes mots de passe!');
		f.nouveau_pwd.focus();
		return false;
		}
	  else if (f.nouveau_pwd.value == f.nouveau_pwd2.value) {
		return true;
		}
	  else 
	    {
		f.nouveau_pwd.focus();
		return false;
		}
	}
}

function verifie_chambres(nbpassagers,langue)
{
	if ((parseInt(document.getElementById('nombre_single').value) 
				+ parseInt(document.getElementById('nombre_double').value)*2 
				+ parseInt(document.getElementById('nombre_twin').value)*2
				+ parseInt(document.getElementById('nombre_twinshare').value))==nbpassagers)
		{
			if (parseInt(langue)==1)
				document.getElementById('chambres').innerHTML=
					'<font color=green> Composition des chambres correcte </font>';
			else
				document.getElementById('chambres').innerHTML=
					'<font color=green> OK </font>';
					
			document.getElementById('chambres_ok').value = 1;
		}
	else
		{
			if (parseInt(langue)==1)
				document.getElementById('chambres').innerHTML=
					'<font color=red>Choisir le type et le nombre de chambres nécessaires </font>';
			else
				document.getElementById('chambres').innerHTML=
					'<font color=red>Please, select all the bedrooms you need !	<br> Else you can\'t confirm your reservation.</font>';
			
			document.getElementById('chambres_ok').value = 0;
		}
}

function choisir_date_hidden(date_selectionnee)
{
	document.getElementById('date1').value = date_selectionnee.options[date_selectionnee.selectedIndex].text;	
	
}

function ChangeRegion(id)
{
	var titre = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr height="25"><td width="15"><img src="../imgs/icons/carre_prov.jpg" width="5" height="5"></td><td class="titre_voyage_produit" valign="top">'+nomR[id]+'</td></tr></table>';
  
	if(pictR[id] == '')
		var txt = titre + '<p align="justify">'+descR[id]+'</p><br/><br/>';
	else
		var txt = titre + '<br/><a href="javascript:" OnClick="window.open(\'afficher_img.php?titre=Region&url='+pictR[id]+'\',\'Region\',config=\'height=0, width=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no\');" style="float: left; width: 163px;"><img src="../photos/public/mini/'+pictR[id]+'" width="157" height="118" border="0"></a>'+descR[id]+'<br/><br/>';
	
	document.getElementById('desc_region').innerHTML = txt;
  
	document.location.replace('#titre');
}



//-->



