//Validates the Advanced Search Fields
function validateAdvSearch()
{
	trimFields();
	if(obj.keywords.value == "")
	{
		alert(JS_NO_KEYWORDS);
		obj.keywords.focus();
		return;
	}
	//self.location = 'adv_search.php?opt=result&search_for='+obj.search_for.options[obj.search_for.selectedIndex].value + '&keywords=' + obj.keywords.value + '&country=' + country + '&category=' + category + '&sub_categories=' + sub_cats + '&biz_type_id=' + bizType + '&market_id=' + market + '&word_opt=' + word_opt;
	obj.action = 'adv_search.php?opt=result';
	obj.submit();

}

//Send a request to the get_subcategories.php page to get the sub categories
function getSubCategories()
{
	//Change the cursor to wait cursor
	//document.body.style.cursor = 'wait';
	//Make a GET request to load sub-categories
	var params = 'opt=asearch&id='+obj.category.options[obj.category.selectedIndex].value;
	ajax.getRequest('/get_subcategories.php', params, fillSubCategories);
}

//Fill the sub_category dropdown box with the sub_categories returned.
function fillSubCategories(retVal)
{
	if(retVal == "")
	{
		document.getElementById("sub_cat_list").style.height = '13px';
		//alert(document.getElementById("sub_cat_list").innerHTML);
		document.getElementById("sub_cat_list").innerHTML = JS_ADV_SEARCH_SUB_CATEGORIES;
	}
	else
	{
		document.getElementById("sub_cat_list").className = 'showdiv';
		document.getElementById("sub_cat_list").innerHTML = retVal;
		document.body.style.cursor = 'default';
	}
}
