var searches=new Array();
function SearchData()
{
	this.key="";
	this.locations=new Array();
	this.hotels=new Array();
	this.AddHotelData=function AddHotelData(HtmlHotelName,HotelName,HotelCode)
	{
		var hotel=new Array();
		hotel["HtmlHotelName"]=HtmlHotelName;
		hotel["HotelName"]=HotelName;
		hotel["HotelCode"]=HotelCode;
		this.hotels.push(hotel);
	}
	this.AddLocationData=function AddLocationData(HtmlCity,Country,City,State,DestinationId)
	{
		var location=new Array();
		location["HtmlCity"]=HtmlCity;
		location["Country"]=Country;
		location["City"]=City;
		location["State"]=State;
		location["DestinationId"]=DestinationId;
		this.locations.push(location);
	}
	return this;
}
function GetSearchData(Key)
{
	for(var i=0;i<searches.length;i++)
	{
		if(searches[i].key==Key)
		{
			return searches[i];
		}
	}
	return 0;
}
function LoadSearchData(searchData)
{
	var Shtml="<div style=\"display: block;\" class=\"yui-ac-content\"><div style=\"display: none;\" class=\"yui-ac-hd\"></div><div class=\"yui-ac-bd\"><ul>";
	if(searchData.locations.length>0)
	{
		Shtml+="<li style=\"display: list-item; background: #777777; color: #ffffff; font-weight: bold; text-align: left;\" ><h4>Cities Advice</h4></li>";
		for(var i=0;i<searchData.locations.length;i++)
		{
			Shtml+="<li onmouseout=\"javascript:changeBgJob(this,0,0);\" onmouseover=\"javascript:changeBgJob(this,1,0);\" class=\"\" style=\"display: list-item;\" onClick=\"javascript:$('#target_name').val('"+searchData.locations[i]["Country"]+", "+searchData.locations[i]["City"]+" "+searchData.locations[i]["State"]+"'); $('#target_name_id').val('"+searchData.locations[i]["DestinationId"]+"'); $('#company-ac').html('');\" ><h4>"+searchData.locations[i]["HtmlCity"]+", "+searchData.locations[i]["Country"]+" "+searchData.locations[i]["State"]+"</h4></li>";
		}
	}
	if(searchData.hotels.length>0)
	{
		Shtml+="<li style=\"display: list-item; background: #777777; color: #ffffff; font-weight: bold; text-align: left;\" ><h4>Hotels Advice</h4></li>";
		for(var i=0;i<searchData.hotels.length;i++)
		{
			Shtml+="<li onmouseout=\"javascript:changeBgJob(this,0,0);\" onmouseover=\"javascript:changeBgJob(this,1,0);\" class=\"\" style=\"display: list-item;\" onClick=\"javascript:$('#target_name').val('"+searchData.hotels[i]["HotelName"]+"'); $('#target_hotelname_id').val('"+searchData.hotels[i]["HotelCode"]+"'); $('#company-ac').html('');\" ><h4>"+searchData.hotels[i]["HtmlHotelName"]+"</h4></li>";
		}
	}
	Shtml+="</ul></div><div style=\"display: none;\" class=\"yui-ac-ft\"></div></div>";
	$("#company-ac").html(Shtml);
	$("#loader").css("visibility", "hidden");
}
