function Cata(recherche) 
{	
	k = recherche.destination.selectedIndex;
	//alert(k);
	if (k == 0) 
	{
		var contenucata = "<select name='categorie' class='selectbox'><option value='Cat'>Cat</option></select>";
		span = document.getElementById("categorie");
		span.innerHTML=contenucata;	
		return;
	}
	var contenusc = "";
	span = document.getElementById("sous_categorie");
	span.innerHTML=contenusc;
	switch (k) 
		{
			case 1 :
			var maxi = 2;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Excursion";
			txt[1] = "Hébergement";
			vle[0] = "excursion";
			vle[1] = "hebergement"; 
			break;
			
			case 2 : 
			var maxi = 2;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Excursion";
			txt[1] = "Hébergement";
			vle[0] = "excursion";
			vle[1] = "hebergement"; 
			break;
		}
	
	//Pas essentiel à la nouvelle version
	/*var contenucata = "<select name='categorie' onChange=\"SC(this.form);\" class='selectbox'><option value='Cat'>Cat</option>";
	for(z=0; z<maxi; z++)
	{
	contenucata += "<option></option>";
	}
	contenucata += "</select>";
	span = document.getElementById("categorie");
	span.innerHTML=contenucata;	
	
	recherche.categorie.options[0].text="Cat";
	for (k=0;k<maxi;k++) 
	{
		recherche.categorie.options[k+1].text=txt[k];
		recherche.categorie.options[k+1].value=vle[k];
	}*/
}
//
function SC(recherche) 
{	
	k = recherche.categorie.selectedIndex;
	nomCata = recherche.categorie.value;
	destination = recherche.destination.value;
	if(nomCata == "excursion" && destination == "guadeloupe"){
		var url="http://excursion-en-guadeloupe.loca-car.com/recherche.php";
		recherche.redirection.value=url;
	}
	if(nomCata == "excursion" && destination == "martinique"){
		var url="http://excursion-martinique.loca-car.com/recherche.php";
		recherche.redirection.value=url;
	}
	//alert(destination+" "+nomCata);
	//alert(k);
	if (k == 0 || nomCata =="excursion") 
	{
		var contenusc = "";
		span = document.getElementById("sous_categorie");
		span.innerHTML=contenusc;	
		return;
	}
	
	switch (destination) 
		{			
			case "guadeloupe" :
			var maxi = 6;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Gîte";
			vle[0] = "gites";
			txt[1] = "Hôtel";
			vle[1] = "hotel";
			txt[2] = "Appartement";
			vle[2] = "appartement";
			txt[3] = "Bungalow";
			vle[3] = "bungalow";
			txt[4] = "Maison";
			vle[4] = "maison";
			txt[5] = "Villa";
			vle[5] = "villa"; 
			break;
			
			case "martinique" :
			var maxi = 6;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Gîte";
			vle[0] = "gites";
			txt[1] = "Hôtel";
			vle[1] = "hotel";
			txt[2] = "Appartement";
			vle[2] = "appartement";
			txt[3] = "Bungalow";
			vle[3] = "bungalow";
			txt[4] = "Maison";
			vle[4] = "maison";
			txt[5] = "Villa";
			vle[5] = "villa"; 
			break;
		}
	

	var contenusc = "<select name='sous_categorie' onChange=\"actionURL(this.form);\" class='select_v_pos'><option value='Sous catégorie'>Choix</option>";
	for(z=0; z<maxi; z++)
	{
	contenusc += "<option></option>";
	}
	contenusc += "</select>";
	span = document.getElementById("sous_categorie");
	span.innerHTML=contenusc;	
	
		recherche.sous_categorie.options[0].text="Choix";
		for (k=0;k<maxi;k++) 
		{
			recherche.sous_categorie.options[k+1].text=txt[k];
			recherche.sous_categorie.options[k+1].value=vle[k];
		}
}
function actionURL(recherche){
destination = recherche.destination.value;
nomCata = recherche.categorie.value;
nomSC = recherche.sous_categorie.value;
if(nomSC == "gites" || nomSC == "hotel"){
	if(nomSC == "gites" && destination == "martinique"){
		var url="http://"+nomSC+"-en-"+destination+".loca-car.com/recherche.php"
	}
	else{
	var url="http://"+nomSC+"-"+destination+".loca-car.com/recherche.php";
	}
	recherche.redirection.value=url;
}
else{
	var url="http://location-"+nomSC+"-"+destination+".loca-car.com/recherche.php";
	recherche.redirection.value=url;
}

}
function verifform(){
	if(document.forms.recherche.destination.value=="Destination"){
		alert("Vous devez choisir une destination");
		document.forms.recherche.destination.focus();
		return false;
	}
	if(document.forms.recherche.categorie.value=="Cat"){
		alert("Vous devez choisir une catégorie");
		document.forms.recherche.categorie.focus();
		return false;
	}
	if(document.forms.recherche.categorie.value=="hebergement"){
		if(document.forms.recherche.sous_categorie.value=="Sous catégorie"){
			alert("Vous devez choisir une sous catégorie");
			document.forms.recherche.sous_categorie.focus();
			return false;
		}
		else{
			//alert("ok 2");
			return true;
		}
	}
	else{
		//alert("ok 1");
		return true;
	}				
}
function dest_loca_car(){
	destination = document.forms.AVIS.destination.value;
	//alert(destination);
	switch (destination) 
		{			
			case "Guadeloupe" :
			var maxi = 15;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Voiture Sans Permis - Cat-SP";
			vle[0] = "Voiture Sans Permis - Cat&eacute;gorie-SP";
			txt[1] = "R Clio /Citroën C1 /R Twingo - Cat-1A";
			vle[1] = "R Clio /Citro&euml;n C1 /R Twingo - Cat&eacute;gorie-1A";
			txt[2] = "R Twingo - Cat-1B";
			vle[2] = "R Twingo - Cat&eacute;gorie-1B";
			txt[3] = "R Clio /WG Fox /Citroën C1 - Cat-2A";
			vle[3] = "R Clio /WG Fox /Citro&euml;n C1 - Cat&eacute;gorie-2A";
			txt[4] = "R Clio - Cat-3P_D";
			vle[4] = "R Clio - Cat&eacute;gorie-3P_D";
			txt[5] = "Citroën C1 - Cat-2A_5P";
			vle[5] = "Citro&euml;n C1 - Cat&eacute;gorie-2A_5P"; 
			txt[6] = "R Clio /Dacia Logan - Cat-2B";
			vle[6] = "R Clio /Dacia Logan - Cat&eacute;gorie-2B"; 
			txt[7] = "WG Polo /Citroën C3 - Cat-3A";
			vle[7] = "WG Polo /Citro&euml;n C3 - Cat&eacute;gorie-3A"; 
			txt[8] = "R Clio - Cat-5P_D";
			vle[8] = "R Clio - Cat&eacute;gorie-5P_D"; 
			txt[9] = "Dacia Logan Essence (A.C)- Cat-3B";
			vle[9] = "Dacia Logan Essence (A.C)- Cat&eacute;gorie-3B"; 
			txt[10] = "Dacia Logan Diesel - Cat-3C";
			vle[10] = "Dacia Logan Diesel - Cat&eacute;gorie-3C"; 
			txt[11] = "R Megane - Cat-4B";
			vle[11] = "R Megane - Cat&eacute;gorie-4B"; 
			txt[12] = "R Modus /Citroën C4 - Cat-4";
			vle[12] = "R Modus /Citro&euml;n C4 - Cat&eacute;gorie-4"; 
			txt[13] = "R Scenic - Cat-5";
			vle[13] = "R Scenic - Cat&eacute;gorie-5"; 
			txt[14] = "Hyundaï H1 /Citroën Jumpy - Cat-6";
			vle[14] = "Hyunda&iuml; H1 /Citro&euml;n Jumpy - Cat&eacute;gorie-6";
			break;
			
			case "Martinique" :
			var maxi = 6;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Peugeot 206 ou R Clio /3ptes /5pls /Clim - Cat-A";
			vle[0] = "Peugeot 206 ou R Clio /3ptes /5pls /Climatis&eacute; - Cat&eacute;gorie-A";
			txt[1] = "Citroën C3 ou R Clio /5ptes /5pls /Clim - Cat-B";
			vle[1] = "Citro&euml;n C3 ou R Clio /5ptes /5pls /Climatis&eacute; - Cat&eacute;gorie-B";
			txt[2] = "R Symbol /5ptes /5pls /Clim - Cat-C";
			vle[2] = "R Symbol /5ptes /5pls /Climatis&eacute; - Cat&eacute;gorie-C";
			txt[3] = "R Kangoo Familial Diesel /5pls /Clim - Cat-D";
			vle[3] = "R Kangoo Familial Diesel /5pls /Climatis&eacute; - Cat&eacute;gorie-D";
			txt[4] = "Monospace Opel Zafira /5ptes /7pls /Clim - Cat-G";
			vle[4] = "Monospace Opel Zafira /5ptes /7pls /Climatis&eacute; - Cat&eacute;gorie-G";
			txt[5] = "Minibus Hyundaï Diesel /4ptes /9pls /Clim - Cat-F";
			vle[5] = "Minibus Hyunda&iuml; Diesel /4ptes /9pls /Climatis&eacute; - Cat&eacute;gorie-F"; 
			break;
		}
	

	var contenusc = "<select id='select' class='select_v_pos' name='vehicule'><option value=''>Choisissez votre voiture</option>";
	for(z=0; z<maxi; z++){
		contenusc += "<option></option>";
	}
	contenusc += "</select>";
	span = document.getElementById("vehicule_destination");
	span.innerHTML=contenusc;	
	
	document.forms.AVIS.vehicule.options[0].text="Choisissez votre voiture";
	for (k=0;k<maxi;k++){
		document.forms.AVIS.vehicule.options[k+1].text=txt[k];
		document.forms.AVIS.vehicule.options[k+1].value=vle[k];
	}
}

function change_port_dep(){
	destination = document.forms.bill_bat.depart.value;
	//alert(destination);
	switch (destination) 
		{			
			case "Guadeloupe" :
			var maxi = 3;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Pointe-à-Pitre";
			vle[0] = "Pointe-&agrave;-Pitre";
			txt[1] = "Saint-François";
			vle[1] = "Saint-Fran&ccedil;ois";
			txt[2] = "Trois-Rivières";
			vle[2] = "Trois-Rivi&egrave;res";
			break;
			
			case "Marie-Galante" :
			var maxi = 2;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Grand-Bourg";
			vle[0] = "Grand-Bourg";
			txt[1] = "Saint-Louis";
			vle[1] = "Saint-Louis";
			break;
			
			case "Les Saintes" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Terre-de-Haut";
			vle[0] = "Terre-de-Haut";
			break;
			
			case "Martinique" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Fort-de-France";
			vle[0] = "Fort-de-France";
			break;
			
			case "La Dominique" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Roseau";
			vle[0] = "Roseau";
			break;
			
			case "La Desirade" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "La Désirade";
			vle[0] = "La D&eacute;sirade";
			break;
			
			case "Sainte-Lucie" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Sainte-Lucie";
			vle[0] = "Sainte-Lucie";
			break;
		}
	

	var contenusc = "<select name='port_dep'><option value=''>Votre port</option>";
	for(z=0; z<maxi; z++){
		contenusc += "<option></option>";
	}
	contenusc += "</select>";
	span = document.getElementById("port_destination1");
	span.innerHTML=contenusc;	
	
	document.forms.bill_bat.port_dep.options[0].text="Votre port";
	for (k=0;k<maxi;k++){
		document.forms.bill_bat.port_dep.options[k+1].text=txt[k];
		document.forms.bill_bat.port_dep.options[k+1].value=vle[k];
	}
}
function change_port_arr(){
	destination = document.forms.bill_bat.destination.value;
	//alert(destination);
	switch (destination) 
		{			
			case "Guadeloupe" :
			var maxi = 3;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Pointe-à-Pitre";
			vle[0] = "Pointe-&agrave;-Pitre";
			txt[1] = "Saint-François";
			vle[1] = "Saint-Fran&ccedil;ois";
			txt[2] = "Trois-Rivières";
			vle[2] = "Trois-Rivi&egrave;res";
			break;
			
			case "Marie-Galante" :
			var maxi = 2;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Grand-Bourg";
			vle[0] = "Grand-Bourg";
			txt[1] = "Saint-Louis";
			vle[1] = "Saint-Louis";
			break;
			
			case "Les Saintes" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Terre-de-Haut";
			vle[0] = "Terre-de-Haut";
			break;
			
			case "Martinique" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Fort-de-France";
			vle[0] = "Fort-de-France";
			break;
			
			case "La Dominique" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Roseau";
			vle[0] = "Roseau";
			break;
			
			case "La Desirade" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "La Désirade";
			vle[0] = "La D&eacute;sirade";
			break;
			
			case "Sainte-Lucie" :
			var maxi = 1;
			var txt = new Array (maxi);
			var vle = new Array (maxi);
			txt[0] = "Sainte-Lucie";
			vle[0] = "Sainte-Lucie";
			break;
		}
	

	var contenusc = "<select name='port_arr'><option value=''>Votre port</option>";
	for(z=0; z<maxi; z++){
		contenusc += "<option></option>";
	}
	contenusc += "</select>";
	span = document.getElementById("port_destination2");
	span.innerHTML=contenusc;	
	
	document.forms.bill_bat.port_arr.options[0].text="Votre port";
	for (k=0;k<maxi;k++){
		document.forms.bill_bat.port_arr.options[k+1].text=txt[k];
		document.forms.bill_bat.port_arr.options[k+1].value=vle[k];
	}
}