// function that checks the text field has something in it and send the search to the correct page
function checkField(field) {
	if (document.layers){
		f = document.layers["header"].document.forms["search"]
	} else{
		f = window.document.search
	}
	
	if (f.keyword.value == "") {
		alert("Please enter a keyword or product number")
	} else {
		var valid = "0123456789";
		var ok = "yes";
		var temp;
		
		//ignore first character and check for cat number
		for (var i=1; i<field.length; i++) {
			temp = field.substring(i, i+1);
			if (valid.indexOf(temp) == "-1") ok = "no";
		}
		
		if (ok == "yes") {
			//is a valid cat no
			top.bottom.location.href = '/shared/productFrame.html?app=drain&page=offers&prd='+f.keyword.value;
		} else {
			//search for keyword value
			top.bottom.location.href = '/shared/productFrame.html?app=drain&page=key&keys="'+f.keyword.value+'"';
		}
	}
}
