	function SearchKeys(strPageName)
	{	
		var AdBPrice		= document.MainSearchForm.AdBPrice;		
		var AdEPrice		= document.MainSearchForm.AdEPrice;
		
			if(isNaN(AdBPrice.value))
		{
			alert("من فضلك اكتب ارقام فقط !");
			AdBPrice.value = "";
			AdBPrice.focus();
			return;
		}		
		if(isNaN(AdEPrice.value))
		{
			alert("من فضلك اكتب ارقام فقط !");
			AdEPrice.value = "";
			AdEPrice.focus();
			return;
		}		
		if(parseInt(AdBPrice.value)>parseInt(AdEPrice.value))
		{
			alert("من فضلك ادخل الارقام باسلوب صحيح");
			AdBPrice.focus();
			return;
		}
		with(document.MainSearchForm)
		{
			action = strPageName;
			method = "GET";
			submit();
		}	
	}
	function SearchAds()
	{
		var SearchkeyWord	= document.MainSearchForm.SearchkeyWord;
		var CatID			= document.MainSearchForm.CatID;
		var SubCatID		= document.MainSearchForm.SubCatID;
		var AdCity			= document.MainSearchForm.AdCity;
		var AdBPrice		= document.MainSearchForm.AdBPrice;		
		var AdEPrice		= document.MainSearchForm.AdEPrice;
		var AdType			= document.MainSearchForm.NeedWantHid;		
		
		if(isNaN(AdBPrice.value))
		{
			alert("من فضلك اكتب ارقام فقط !");
			AdBPrice.value = "";
			AdBPrice.focus();
			return;
		}		
		if(isNaN(AdEPrice.value))
		{
			alert("من فضلك اكتب ارقام فقط !");
			AdEPrice.value = "";
			AdEPrice.focus();
			return;
		}		
		if(parseInt(AdBPrice.value)>parseInt(AdEPrice.value))
		{
			alert(parseInt(AdBPrice.value));
			alert(parseInt(AdEPrice.value));
			alert("من فضلك ادخل الارقام باسلوب صحيح");
			AdBPrice.focus();
			return;
		}
				
		var ParamsToSend    = "SearchkeyWord="+escape(SearchkeyWord.value);
			ParamsToSend    = ParamsToSend+"&CatID="+CatID.value;
			ParamsToSend    = ParamsToSend+"&SubCatID="+SubCatID.value;
			ParamsToSend    = ParamsToSend+"&AdCity="+AdCity.value;
			ParamsToSend    = ParamsToSend+"&AdBPrice="+AdBPrice.value;
			ParamsToSend    = ParamsToSend+"&AdEPrice="+AdEPrice.value;
			ParamsToSend    = ParamsToSend+"&AdType="+AdType.value;
			
			//alert(ParamsToSend);
			
			//Mangam.Load('category.asp','jsAjaxObj=Mangam&callBackFn=callBack&divRes=NewCar_right&sortExpr=make&action=showmodels&'+ParamsToSend,'NewCar_right',callBack);
	}
