
var http_moteur = getHTTPObject();
var http1 = getHTTPObject();
var bool_moteur_1=1;
var bool_moteur_2=0;
var bool_moteur_3=0;
var bool_moteur_4=0;



function selectfamil(Langue,URL) {
				if(Langue.options[Langue.selectedIndex].value=="") {
						 alert('Veuillez sélectionner une gamme d\'articles dans le menu.');
				}
				else {
						parent.location.href =URL+"?Nom_Loueur="+Langue.options[Langue.selectedIndex].value;
Langue.selectedIndex=0;
				}
		}


function ong_home(id){
	for(i=1;i<=4;i++){
		if(i==id){
			gId('div_ong_home_'+i).style.backgroundImage="url(design/slide/onglets/"+i+"_on.png)";	
			gId('R_B_'+i).style.display='';	
		}else{
			gId('div_ong_home_'+i).style.backgroundImage="url(design/slide/onglets/"+i+"_off.png)";	
			gId('R_B_'+i).style.display='none';
		}
	}
	actu(id+1);

window.setTimeout("chargement_moteur_home("+id+")",1000);	
}

function chargement_moteur_home(id){

getHTTPObject();
	if(id==2 && bool_moteur_2==0){
		url="offre2.asp";

		http_moteur.open("GET", url, true);
		http_moteur.onreadystatechange = handleHttpResponsehttpMoteur2;
		http_moteur.send(null);	
	}
	if(id==3 && bool_moteur_3==0){

		url="offre3.asp";
		http_moteur.open("GET", url, true);
		http_moteur.onreadystatechange = handleHttpResponsehttpMoteur3;
		http_moteur.send(null);	

	}
		if(id==4 && bool_moteur_4==0){
		url="offre4.asp";
		http_moteur.open("GET", url, true);
		http_moteur.onreadystatechange = handleHttpResponsehttpMoteur4;
		http_moteur.send(null);	

	}


}

function handleHttpResponsehttpMoteur2(){
	if (http_moteur.readyState == 4) {
		results = http_moteur.responseText;
		gId('div_Moteur2').innerHTML=results;

		bool_moteur_2=1;
		format_moteur_hotel_home=1;
	}
}

function handleHttpResponsehttpMoteur3(){
	if (http_moteur.readyState == 4) {
		results = http_moteur.responseText;
		gId('div_Moteur3').innerHTML=results;

		bool_moteur_3=1;
		format_moteur_voiture_home=1;
	}
}

function handleHttpResponsehttpMoteur4(){
	if (http_moteur.readyState == 4) {
		results = http_moteur.responseText;
		gId('div_Moteur4').innerHTML=results;
		bool_moteur_4=1;
		format_moteur_voiture_home=1;
	}
}

var id_actu_cur=1;
var nb_actu_max=9;
function actu(id){
	id_actu_cur=id;
	move_flash(calcul_mvt_actu(id_actu_cur));
	clearInterval(flashs_automatique);
}

function move_flash(largeur) {
	$('#slideflash_liste').stop().animate({marginLeft:largeur},"slow", myCallBackMvt);
}

function myCallBackMvt(){
	if(id_actu_cur==nb_actu_max){
		gId("slideflash_liste").style.marginLeft=0+"px";
		id_actu_cur=1;
	}
}
		
function auto_move_flash() {
	id_actu_cur++;
	if(id_actu_cur>nb_actu_max){
		id_actu_cur=1;
	}
	move_flash(calcul_mvt_actu(id_actu_cur));
}	

function calcul_mvt_actu(id){
	var marg=-760*(id_actu_cur-1);		
	return marg;	
}	
	
flashs_automatique = setInterval("auto_move_flash()",9000);




function handleHttpResponseTheme(){
	if (http1.readyState == 4) {
		results = http1.responseText;		
		document.location.href=results;	
	}
}


  function checkCapacity(Category,MsgCapInv)
{
	Capacity=Number(document.Wiz.Adult.value) + Number(document.Wiz.Child.value) ;

if (Capacity >12) 
	{	var message=MsgCapInv;
		alert(message);
		switch(Category)
		{	case 'Adult':
				document.Wiz.Adult.value=2;
				break;	
			case 'Child':
				break;
		}
		document.Wiz.pparamequipage.value=Capacity;			
	}
	else
	{	document.Wiz.pparamequipage.value=Capacity;
	}
}
