function get_resorts(region_id){
	
	POST("/ajax/get_resorts.php", "region_id="+region_id, stateChanged);
}

function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		document.getElementById("resorts").innerHTML=xmlHttp.responseText 
	} 
}

function GetXmlHttpObject(){
	var xmlHttp=null;

	try{
 		// Firefox, Opera 8.0+, Safari
 		xmlHttp=new XMLHttpRequest();
 	}	

 	catch (e){
 		//Internet Explorer
 		try{
  			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  		}
 
  		catch (e){
  			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  		}
 	}
	return xmlHttp;
}

/*
xmlHttp.readyState
0: Request Not Initialized
1: Request Has Been Setup
2: Request Has Been Sent
3: Request is in Progress
4: Request Complete

XMLHttpRequest.open(sMethod, sUrl [, bAsync] [, sUser] [, sPassword]);

*/

function POST(url, values, state_func){
	
	xmlHttp=GetXmlHttpObject();
	xmlHttp.open("POST", url, true);
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp.onreadystatechange=state_func;
	xmlHttp.send(values);

}