/////////////////////////////PUBS///////////////////////////////////////////////















///////////////////////// PUBS /////////////////////////////////////////////////////////


function change_state_bylist(type)
{
	if(type=="ch") val='1';
	if(type=="gi") val='2';
	if(type=="all") val='12';
	
//alert('1');alert("typ:"+type+'val:'+val);

		var currentLocation =  document.location.href;
		currentLocation = currentLocation.substring(currentLocation.lastIndexOf( "/" )+1,document.location.href.length);
		//alert(currentLocation);
		//currentLocation += '/eng/index.html';
        // windows.location = currentLocation ;
						 
		if(val=='1')
		currentLocation='chambre-hote/'+currentLocation;
		if(val=='2')
		currentLocation='location/'+currentLocation;
		if(val=='12')
		currentLocation='hebergement/'+currentLocation;
		if(val=='0')
		currentLocation='hebergement/'+currentLocation;
			
		
		adatafield = new Array("val");
  		adatavalue= new Array(val);
  		adata = new Array(adatafield,adatavalue);
	
		ObjAJAX = new Ajax();
		ObjAJAX.setParam ({
		url : "prequests/check_gi-or-ch_from_home.php",
		returnFormat : "txt", // OU returnFormat : "xml"
		method : "POST", // OU method : "GET"
		data : adata,
		//data : "mdp="+pass,
		//data : adata,
		//data :({mdp : pass,
		//		}),
		asynchronus : true,
		onComplete : "document.location.href='http://www.planete-nuit.com/"+currentLocation+"?proxdelete=1';"
		
	
		});
		ObjAJAX.execute();


}
