function ValidateForm(prod_type){

//determine type of product for length validation

//anklet
if (prod_type == "anklet"){
	var low = 7;
	var high = 11.5;
}
//necklace
if (prod_type == "necklace"){
	var low = 12
	var high = 20;
}
//braclet
if (prod_type == "bracelet"){
	var low = 0;
	var high = 6.5;
}

// Alert message declaration
	var message="";

// Make Sure product is selected
	if (top.frames.product_form.document.picker.prod_code.value == ""){

		message = "Please Pick A Product on the Left";

		DisplayMess(message);

		return ('fail');

	}//End Code if


// Display Alert that Length is out of bounds
	if(top.frames.product_form.document.picker.itemlength.value < low || top.frames.product_form.document.picker.itemlength.value > high || top.frames.product_form.document.picker.itemlength.value == ""){

			message = "Please Enter A Length Between " + low + " Inches and " + high + " Inches";

		// Reset Field
		top.frames.product_form.document.picker.itemlength.value = "";

		DisplayMess(message);

		return ('fail');

	}//End If
	
	else {
		
		// submit form
		top.frames.product_form.document.picker.submit();
	}//end else



}//End ValidateForm

//Display Message function
function DisplayMess(message){

alert (message);

}//End DiplayMess Function


