function checkFields(theform) 
{
    if(trimit(theform.Type.value) == "") 
	{
		alert("Please select a search Catagory");
		theform.Type.focus();
		return (false);
	}
}
function showCost()
{
	
	var isShow = document.getElementById("num")
	x = isShow.length
	//alert(isShow.selectedIndex)
	if(isShow.selectedIndex == 0)
	{
		for (i = 1 ; i < x ;i++)
		{
		
		document.getElementById("a" + i).style.visibility = 'hidden';
		document.getElementById("a" + i).style.position = 'absolute';
		
		}
	}
	else
	{
		for (i = 1 ; i < x ;i++)
		{
			if (isShow.selectedIndex == i)
			{
				document.getElementById("a" + i).style.visibility = 'visible';
				document.getElementById("a" + i).style.position = 'relative';
			}
			else
			{	
				document.getElementById("a" + i).style.visibility = 'hidden';
				document.getElementById("a" + i).style.position = 'absolute';
			}
		}
	}
	
	
}

function trimit(input)
{
  var lre = /^\s*/;
  var rre = /\s*$/;
  input = input.replace(lre, "");
  input = input.replace(rre, "");
  return input;
}

