// JavaScript Document
///////////////// Function to get Types ////////////////
var Ajax = new sack();
function getTypes(catid,siteurl)
{
	Ajax.requestFile = siteurl+'views/ajax-server.php?cat_id='+catid;
	Ajax.onCompletion =	dispInfo
	Ajax.runAJAX(); 
}

function dispInfo()
{
eval(Ajax.response);
}
///////////////// Home page search Validatons ///////////////////
function validateAuctions(auctions,lnk)
{
	if(document.getElementById('select_cat').value =='0')
	{
		alert('Please select Type');
		return false;
	}
	if(isNaN(document.auctions.txt_zip.value))
	{
		alert('Please enter the zip code as only Numeric data');
		document.auctions.txt_zip.focus();
		return false;
	}
	if((document.getElementById('txt_zip').value!='') && (document.getElementById('slt_miles').value=='0'))
	{
		alert('Please select the Search Within miles also');
		return false;
	}	
	if((document.getElementById('txt_zip').value!='') && (document.getElementById('slt_miles').value!='0') && (document.getElementById('select_cat').value=='0'))
	{
		alert('Please select the atleast one category');
		return false;
	}

	//alert(document.getElementById('select_cat').value);
	if(document.getElementById('select_cat').value==3)
		document.auctions.action = lnk+'buses-auction';
	else if(document.getElementById('select_cat').value==4)
		document.auctions.action = lnk+'rvs-auction';
	else if(document.getElementById('select_cat').value==5)
		document.auctions.action = lnk+'coaches-auction';
	document.auctions.submit();
	/*Ajax.requestFile='../views/ajax-server.php?cat_id='+3;
	Ajax.onCompletion =	dispInfo
	Ajax.runAJAX(); */

	/*if(SelectValidation(val.select_cat,'Category')=='')
	{
		return false;
	}*/
	/*if(SelectValidation(val.sel_type,'Type')=='')
	{
		return false;
	}*/
/*	if(SelectValidation(val.sel_manufact,'Manufacturer')=='')
	{
		return false;
	}*/
	
	/*if (document.getElementById('txt_zip').value != '')
	{
		if(NumValidation(val.txt_zip,'Zip Code','','num')=='')
		{
			return false;
		}
	}*/
}