// JavaScript Document

function right(e) {
var skey
if (navigator.appName == 'Netscape') {
skey = e.which; }
else if (navigator.appName == 'Microsoft Internet Explorer') {
skey = event.keyCode;}
if (skey == 13) {
subform(document.form)	;
}
}
document.onkeypress=right;
//if (document.layers) window.captureEvents(Event.MOUSEDOWN);
//if (document.layers) window.captureEvents(Event.MOUSEUP);
//window.onmousedown=right;
//window.onmouseup=right;
// End

function subform(theForm) {
if (theForm.refnum.value == "") {
theForm.action = "/asp/showcatth.asp" }
else {
theForm.action = "/asp/showdetail.asp" }
var checkOK = "0123456789.,";
var checkStr = theForm.price1.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else if (ch != ",")
allNum += ch;
}
if ((!allValid) && (theForm.price1.value != "All Prices"))
{
alert("Please enter only digit characters in the \"Price\" field.");
theForm.price1.focus();
return (false);
}
if ((decPoints > 1) && (theForm.price1.value != "All Prices"))
{
alert("Please enter a valid number in the \"Price\" field.");
theForm.price1.focus();
return (false);
}
var checkOK = "0123456789.,";
var checkStr = theForm.price2.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else if (ch != ",")
allNum += ch;
}
if ((!allValid) && (theForm.price2.value != "All Prices"))
{
alert("Please enter only digit characters in the \"Price\" field.");
theForm.price2.focus();
return (false);
}
if ((decPoints > 1) && (theForm.price2.value != "All Prices"))
{
alert("Please enter a valid number in the \"Price\" field.");
theForm.price2.focus();
return (false);
}
theForm.submit();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

