
function showCategory(categoryID)
{
	if(categoryID ==0)
	{
		getObj("spanCategoryDesc").innerHTML = "All";
	}
	else
	{
		 otherData = "clcaID=" + categoryID ;
	  ajaxCall("", "GetCategoryDesc", "setting",GetCategoryDescCB, "",otherData);
	  return;
	}
}

function GetCategoryDescCB(content, type)
{
  if(type == "string")
  {
     getObj("spanCategoryDesc").innerHTML = content;
  }
  else
  {
    document.getElementById("errorDiv").innerHTML = content;
  }
}

function searchByCategory(categoryID)
{
	getObj("clcaID").value = categoryID;
	showAd();
}

function showAd()
{
	clcaID = getObj("clcaID").value ;
	countryID = getObj("selCountryID").value;
	regionID = getObj("selRegionID").value;
	city = getObj("txtCity").value;
	otherData = "clcaID=" + clcaID + ",countryID=" + countryID + ",regionID=" + regionID + ",city=" + city + ",currentOnly=1" + ",orderBy=CLAD_START_DATE DESC" ;
  ajaxCall("", "getClassifiedsContent", "classifiedAds",getClassifiedsContentCB, "",otherData);
  return;
}

function getClassifiedsContentCB(content, type)
{
	if(type == "string")
	{
		 getObj("divAdContent").innerHTML = content;
	}
	else
	{
		document.getElementById("errorDiv").innerHTML = content;
	}
}

function getRegionList(objCoun)
{
  var otherData = "counID=" + objCoun.value +",selectName=selRegionID" + ",currTab=" + getObj("selRegionID").tabIndex ;
  ajaxCall("", "getRegionSelect", "lookups",getRegionSelectCB, "",otherData)
  return;
}

function getRegionSelectCB(content, type)
{
  if(type == "string")
  {
     document.getElementById("divRegion").innerHTML = content;
     displayElement("divRegion","show");
  }
  else
  {
    document.getElementById("errorDiv").innerHTML = content;
  }
}

