function createRequestObject()
{	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer")
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	else		
		request_o = new XMLHttpRequest();	
	return request_o; //return the object
}
/******************** BEGIN : EXAMPLE Dont Edit ******************************************
var http = createRequestObject(); 
function getStudents()
{	http.open('get', 'ajax_test.php?action=get_student&id=' 
			+ document.frmStudent.course.value);
	http.onreadystatechange = handleStudents; 
	http.send(null);
}
function handleStudents()
{	if(http.readyState == 4)
	{	var response = http.responseText;		
		document.getElementById('student_list').innerHTML = response;
	}
}
/******************** END : EXAMPLE Dont Edit ******************************************/
var http = createRequestObject(); 
			//************************ BEGIN : StateOptions *********************************
function getStateOpts()
{	ClearDiv('show_package');//defined in scripts.js	
	http.open('get', 'ajax_test.php?action=getStateOpts&id='+ document.form1.zone.value);
	http.onreadystatechange = handlegetStateOpts; 
	http.send(null);
}
function getStateOpts1()
{	 		
	http.open('get', 'ajax_test.php?action=getStateOpts1&id='+ document.form1.zone.value);
	http.onreadystatechange = handlegetStateOpts; 
	http.send(null);
}
function handlegetStateOpts()
{	if(http.readyState == 4)
	{	var response = http.responseText;		
		document.getElementById('list_states').innerHTML = response;
	}
}
			//************************ BEGIN : StateOptions *********************************


//************************ BEGIN : StateOptions *********************************
function getTourPackage()
{	http.open('get', 'ajax_test.php?action=show_package&state='+ document.form1.state.value);
	http.onreadystatechange = handlegetTourPackage; 
	http.send(null);
}
/*function getPackageByCategory(type)
{	http.open('get', 'ajax_test.php?action=show_package&type='+type);
	http.onreadystatechange = handlegetTourPackage; 
	http.send(null);
}*/
function handlegetTourPackage()
{	if(http.readyState == 4)
	{	var response = http.responseText;		
		document.getElementById('show_package').innerHTML = response;
	}
}
//************************ BEGIN : StateOptions *********************************		
		
		
function getDestinations()
{	args	=	"";
	for(i=0;i<document.form1.state.length;i++)		
	{	if(document.form1.state[i].selected)
			args	=	args + "|"+document.form1.state[i].value;
	}
	http.open('get', 'ajax_test.php?action=show_dest&state='+ args);
	http.onreadystatechange = handlegetDestinations; 
	http.send(null);
}
function handlegetDestinations()
{	if(http.readyState == 4)
	{	var response = http.responseText;		
		document.getElementById('div_destinations').innerHTML = response;
	}
}

//********************************** Search [to get location select]***************************/		
function getLocation()
{	http.open('get', 'php/ajax_test.php?action=getLocation&stateid='+ document.frmTourFinder.stateid.value);
	http.onreadystatechange = handlegetLocation; 
	http.send(null);
}
function handlegetLocation()
{	
	if(http.readyState == 4)
	{	var response = http.responseText;		
		document.getElementById('show_location').innerHTML = response;
	}
}		
		
		
//**********************************END ***** Search [to get location select]***************************/