
function submitForm(searchtype){

	var appendURL="product.jsp?search=" + searchtype;
	var flag=false;
	if(searchtype=="function"){
		if(document.getElementById("s_print").checked==true){
			appendURL=appendURL+"&print=yes";
			flag=true;
			}else{
			appendURL=appendURL+"&print=no";
		}
		if(document.getElementById("s_copy").checked==true){
			appendURL=appendURL+"&copy=yes";
			flag=true;
			}else{
			appendURL=appendURL+"&copy=no";
		}
		if(document.getElementById("s_scan").checked==true){
			appendURL=appendURL+"&scan=yes";
			flag=true;
			}else{
			appendURL=appendURL+"&scan=no";
		}
		if(document.getElementById("s_color").checked==true){
			appendURL=appendURL+"&color=yes";
			flag=true;
			}else{
			appendURL=appendURL+"&color=no";
		}
		if(document.getElementById("s_fax").checked==true){
			appendURL=appendURL+"&fax=yes";
			flag=true;
			}else{
			appendURL=appendURL+"&fax=no";
		}
		if(document.getElementById("s_bw").checked==true){
			appendURL=appendURL+"&bw=yes";
			flag=true;
			}else{
			appendURL=appendURL+"&bw=no";
		}
		if(flag){
			document.searchProducts.action=appendURL;
			return true;
			}else{
			alert("Please select at least one search option.");
			return false;
		}
		}else{
	
		for(var i=0;i<document.searchProducts_byspeed.speed.length;i++){
			if(document.searchProducts_byspeed.speed[i].checked){
				flag=true;
				appendURL=appendURL+"&speedCat="+document.searchProducts_byspeed.speed[i].value;
				break;
			}
		}
		if(flag){
			document.searchProducts_byspeed.action=appendURL;
			document.searchProducts_byspeed.submit();
			}else{
			alert("Please select at least one search option.");
			return false;
		}


	}

}
function viewProduct(){

	var appendURL="";

	var productID=document.getElementById("selectmodel").value;

	if(productID!="0"){
		document.searchByModel.action="productDescription.jsp?id=" + productID;
		document.searchByModel.submit();
		}else{
		alert("Please select a product model.");
		return false;
	}
}
