
var sDivName = 'div-destination';

function doCategory(iCatID, iAction, selCat)
{
	sUrl = "get_category.php?state_id=" + iCatID + "&cat_level=" + iAction + '&sel_dest=' + selCat;
	//alert(sUrl);
	getXMLHttp();
	sDivName = "cat_d" + iAction;
	xmlHttp.onreadystatechange = showCategoryDropDown;
	
	xmlHttp.open("GET", sUrl, true);
	xmlHttp.send(null);  
}

function showCategoryDropDown()
{
	sDivName = 'div-destination';
	if(xmlHttp.readyState==4)
	{
		//alert(document.getElementById(sDivName));
		//alert(xmlHttp.responseText);
		document.getElementById(sDivName).innerHTML = xmlHttp.responseText;
		//alert(document.getElementById(sDivName).innerHTML)
	}
	
}

SDivName = '';
function showSearchDropDown()
{
	
	if(xmlHttp.readyState==4)
	{
		//alert(SDivName);
		//alert(document.getElementById(SDivName));
		document.getElementById(SDivName).innerHTML = xmlHttp.responseText;
//		alert(document.getElementById(SDivName).innerHTML)
	}
	
}


var subcat_result;
function destinationType(destination_type, sPath)
{
	///alert(destination_type)
	sUrl = sPath + "get_destination.php?destination=1&destination_type=" + destination_type ;
	getXMLHttp();
	SDivName = "destination_area";
	xmlHttp.onreadystatechange = showSearchDropDown;
	xmlHttp.open("GET", sUrl, true);
	xmlHttp.send(null);  
}

var subcat_result;
function stateDestinationType(state_id, sPath)
{
	sUrl = sPath + "get_destination.php?state=1&state_id=" + state_id ;
	getXMLHttp();
	SDivName = "state_area";
	xmlHttp.onreadystatechange = showSearchDropDown;
	xmlHttp.open("GET", sUrl, true);
	xmlHttp.send(null);  
}