// popup window
function MM_openBrWindow(theURL,winName,features)
{
  window.open(theURL,winName,features);
}

// search reset
function searchreset(){
		document.form.reset();
		var x = document.form.elements;
		var etype;

		for (i=0; i < x.length; i++)
		{
			etype = x[i].type;
			if (etype.search(/select/i) >= 0 && x[i].name != 'category_id')
			{
				if (x[i].name == 'model_id')
				{
					oldLength = x[i].length;
					for (k = oldLength; k >= 1; k--)
					{
						x[i].options[k] = null;
						x[i].size = 1;
					}
				}
				else
				{
					x[i].selectedIndex = 0;
				}
			}
			if (x[i].type == 'text')
			{
				x[i].value = '';
			}
		}
	}

// function search
function search(){
var val=form.category_id.options[form.category_id.options.selectedIndex].value;
var val2=form.make_id.options[form.make_id.options.selectedIndex].value;
var val3=form.model_id.options[form.model_id.options.selectedIndex].value;
var val4=form.state_id.options[form.state_id.options.selectedIndex].value;

			document.form.action = 'index.php' +'?selectcat=' +val +'&selectmake=' +val2 +'&selectmodel=' +val3 +'&selectstate=' +val4;
			document.form.submit();
		}
