function ResetCuisineType(ddl_ID) {
	if ($("#" + ddl_ID)[0].selectedIndex > 0)
		$("#" + ddl_ID)[0].selectedIndex = 0;
		
	if ($("input[@name=radSearchType]:checked").val() == "Tube")
		PopulateTube(ddl_ID);
	else
		PopulateArea(ddl_ID);
}

function PopulateTube(ddl_ID) {
	PageMethod("ajaxcalls.aspx"
		, "TubeGetListByCuisineType"
		, ["CuisineType_ID", $("#" + ddl_ID).val()]
		, TubeSuccess
		, GenericFail);
}

function PopulateArea(ddl_ID) {
	PageMethod("ajaxcalls.aspx"
		, "SuburbGetListByCuisineType"
		, ["CuisineType_ID", $("#" + ddl_ID).val()]
		, AreaSuccess
		, GenericFail);
}

function HideAll() {
	$("div#divKeyword").hide();
	$("div#divCuisineType").hide();
	$("div#divTube").hide();
	$("div#divArea").hide();
	$('div#divPopularArea').hide();
	
	$("div#divLoading").show();
}

function SelectTab(id) {
	$('#tab>td').removeClass();
	$('#tab>td:not(#tab'+id+')').addClass('tab_back');
	$('#tab'+id).addClass('tab_front');

	$('#tabContent>div:not(#tabContent'+id+')').hide();
	$('#tabContent'+id).show();

	return false;
}

function PopulatePopularArea(id) {
	PageMethod("ajaxcalls.aspx"
		, "PopularAreaGetTopTenRestaurants"
		, ["PopularArea_ID", $("#"+id).val()]
		, PopularAreaSuccess
		, GenericFail);
}

function PopularAreaSuccess(res) {
    $('div#divPopularArea').html(res.d);
    
    $('div#divPopularArea').show();
    $("div#divLoading").hide();
}