
function AfficheLocation()
{   
	
	if(window.document.getElementById('id_tarif').value == "0")
	var idres = $F('type_location');
	else
	var idres = document.getElementById('id_tarif').value;
	
	if(idres != "#")
	{
		var url = '/Ajax/requette_ajax.php';
		var pars = 'idres=' + idres + '&action=affiche_location' + '&langue=' + document.getElementById('langue').value;
		
		var myAjax = new Ajax.Request(
				url,
				{
					method : 'get',
					parameters: pars,
					onComplete: showResponse_AfficheLocation
				});

	}
	else
	{
		return false;
	}
}

function showResponse_AfficheLocation(myAjax)
{	
	$('type_location2').innerHTML = myAjax.responseText;
	Effect.BlindDown('type_location2',{delay:0, duration:1});
		
}

function AfficheDateArrivee()
{
	
	var idtarif = $F('location_ok');
	
	if(document.getElementById('id_tarif').value == "0")
	var idres = $F('type_location');
	else
	var idres = document.getElementById('id_tarif').value;

	
	if(idtarif != "")
	{   
			
		var url = '/Ajax/requette_ajax.php';
		var pars = 'idres=' + idres + '&idtarif=' + idtarif + '&action=affiche_date_arrivee' + '&langue=' + document.getElementById('langue').value;
		
		var myAjax = new Ajax.Request(
				url,
				{
					method : 'get',
					parameters: pars,
					onComplete: showResponse_AfficheDateArrivee
					
				});

	}
	else
	{
		return false;
	}
	window.focus();
	
}

function showResponse_AfficheDateArrivee(myAjax)
{	
	$('arrivee_depart').innerHTML = myAjax.responseText;
	Effect.BlindDown('arrivee_depart',{delay:0, duration:1});
			
	AfficheDateDepart();
}

function AfficheDateDepart()
{
	
	var jour = $F('arriveejour');
	var mois = $F('arriveemois');
	var annee = $F('arriveeannee');
	
	if(document.getElementById('id_tarif').value == "0")
	var idres = $F('type_location');
	else
	var idres = document.getElementById('id_tarif').value;
			
		var url = '/Ajax/requette_ajax.php';
		var pars = 'idres=' + idres + '&jour=' + jour + '&mois=' + mois +'&annee=' + annee +'&action=affiche_date_depart' + '&langue=' + document.getElementById('langue').value;
		
		var myAjax = new Ajax.Request(
				url,
				{
					method : 'get',
					parameters: pars,
					onComplete: showResponse_AfficheDateDepart
				});

	
	
}

function showResponse_AfficheDateDepart(myAjax)
{	
	$('depart_arrivee').innerHTML = myAjax.responseText;
	Effect.BlindDown('depart_arrivee',{delay:0, duration:1});
		
}


function MM_validateForm() 
{
if ( (window.document.FrontPage_Form1.nomprenom.value=="") || (window.document.FrontPage_Form1.location_ok.value=="") || (window.document.FrontPage_Form1.email.value=="") || (window.document.FrontPage_Form1.telephone.value==""))
	{
		if (window.document.FrontPage_Form1.langue.value=="fr")
		{
		alert("Les champs nom prénom, téléphone, email et type de location sont obligatoires !");
		}
		if (window.document.FrontPage_Form1.langue.value=="en")
		{
		alert("Name Firstname, Phone, E-mail and accomodation are compulsory !");
		}
		if (window.document.FrontPage_Form1.langue.value=="it")
		{
		alert("Nome Cognome, Telephono, E-mail e Allogio sono obbigatori !");
		}
		if (window.document.FrontPage_Form1.langue.value=="de")
		{
		alert("Name Vorname, Tel, E-mail und Unterkunft obligatorisch !");
		}
		return false;
	}
	else 
	{
		return true;
	}


}
