<!--
function checkCartSelection(){
var flag;
var elms=document.getElementsByTagName("input");
var i;

flag=false;

for(i=0;i<elms.length;i++) {
	if (elms[i].name.substr(0, 10) == "vwquantity")
	{
		if (elms[i].value > 0) {
			flag=true;
		}
	}
}

if (!flag){
	alert("Please Select a Product.");
}

return flag;
}

function swapImage(src){
 document.getElementById("currImage").setAttribute("src", src);
 document.getElementById("currImage").setAttribute("alt", "");
}
function changeQty(lineNum, op){            
        var qty = document.getElementById("vwquantity" + lineNum).value;        
        if (!isNaN(qty))
        {
            qty = parseInt(qty);            
            if (!(qty >= 0 && qty < 999))
            {
                qty = 1;                
            } 
            else 
            {
                if (op == "add")
                {
                    qty = qty + 1; 
                }
                else
                {
                    if (qty != 0)
                    {
                        qty = qty - 1;
                    }
                }
            }
        } 
        else
        {
            qty = 0;    
        }   
        document.getElementById("vwquantity" + lineNum).value = qty; 
    }    
	
	    function changeStyle(e, style){        
        e.className = style;        
    }
    function navigate(link){
        top.location.href=link;        
    }
    function clearSearchBox(){
     if (document.getElementById("query").value == "Enter Keyword or Item #")
     {document.getElementById("query").value = "";}
    }


function checkBoxSelection(lineNum){
var chk;
var qty;

chk = document.all("chk" + lineNum);
qty = document.all("vwquantity" + lineNum);

if (chk.checked) {
	qty.value = 1		
} else {
	qty.value = 0
}
}

function qtyUpdate(lineNum){
var chk;
var qty;

chk = document.all("chk" + lineNum);
qty = document.all("vwquantity" + lineNum);

if (qty.value > 0) {
	chk.checked = true;
} else {
	chk.checked = false;
}
}

function onError(error_message)
{  alert(error_message);
    return false;	
}

function checkDigits(s)
{
status = new String;
c = new Boolean(false);

//can not put 3 same char in a row
k=0
for(i=0; i<(s.length - 1); i++) 
{
   if (s.substr(i,1) == s.substr(i+1,1))
	{k=k+1;
	if (k==2)
	{
	status = "dup";
	i = s.length;
	}
	}
   else
	k=0;	
} 
if (!(status.length > 0))
{
//check for sequential numbers, e.g. 12345
if (!isNaN(Number(s)))
	{
	for(i=0; i<(s.length - 1); i++) 
	{
	   a = Number(s.substr(i,1));
	   b = Number(s.substr(i+1,1));

	   if (Math.abs(a - b) == 1)
		status = "seq";		
	   else
		{
		i = s.length;		
		status = "";
		}
	} 
	}
}

//alert(status);

if (status.length > 0)
	return true;
else
	return false;

}

function hasValue(obj, obj_type)
{	if (obj_type == "TEXT" || obj_type == "PASSWORD")
	{	if (obj.value.length == 0) 
      		return false;
    	else 
      		return true;
   	}
    else if (obj_type == "SELECT")
	{	for (i=0; i < obj.length; i++)
	    {	if (obj.options[i].selected)
				return true;
		}
       	return false;	
	}
    else if (obj_type == "SINGLE_VALUE_RADIO" || obj_type == "SINGLE_VALUE_CHECKBOX")
	{	if (obj.checked)
			return true;
		else
       		return false;	
	}
    else if (obj_type == "RADIO" || obj_type == "CHECKBOX")
	{	for (i=0; i < obj.length; i++)
	    {	if (obj[i].checked)
				return true;
		}
       	return false;	
	}
}// end function hasValue()



function checkInteger(object_value)
{	//Returns true if value is a number or is NULL
    //otherwise returns false	
    if (object_value.length == 0)
        return true;

    //Returns true if value is an integer defined as
    //   having an optional leading + or -.
    //   otherwise containing only the characters 0-9.
	var decimal_format = ".";
	var check_char;

    //The first character can be + -  blank or a digit.
	check_char = object_value.indexOf(decimal_format)
    //Was it a decimal?
    if (check_char < 1)
	return checkNumber(object_value);
    else
	return false;
}

function numberRange(object_value, min_value, max_value)
{	// check minimum
    if (min_value != null)
	{	if (object_value < min_value)
			return false;
	}

    // check maximum
    if (max_value != null)
	{	if (object_value > max_value)
			return false;
	}
	
    //All tests passed, so...
    return true;
}

function checkNumber(object_value)
{	//Returns true if value is a number or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return true;

    //Returns true if value is a number defined as
    //   having an optional leading + or -.
    //   having at most 1 decimal point.
    //   otherwise containing only the characters 0-9.
	var start_format = " .+-0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

    //The first character can be + - .  blank or a digit.
	check_char = start_format.indexOf(object_value.charAt(0))
    //Was it a decimal?
	if (check_char == 1)
	    decimal = true;
	else if (check_char < 1)
		return false;
        
	//Remaining characters can be only . or a digit, but only one decimal.
	for (var i = 1; i < object_value.length; i++)
	{	check_char = number_format.indexOf(object_value.charAt(i))
		if (check_char < 0)
			return false;
		else if (check_char == 1)
		{	if (decimal)		// Second decimal.
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{	if (decimal || digits)	
				trailing_blank = true;
        // ignore leading blanks
		}
        else if (trailing_blank)
			return false;
		else
			digits = true;
	}	

    //All tests passed, so...
    return true
}

function checkZip(object_value)
{  if (object_value.length == 0)
      return true;
   if (object_value.length != 5 && object_value.length != 10)
      return false;
	// make sure first 5 digits are a valid integer
	if (object_value.charAt(0) == "-" || object_value.charAt(0) == "+")
        return false;
	if (!checkInteger(object_value.substring(0,5)))
		return false;
	if (object_value.length == 5)
		return true;
	// make sure
	// check if separator is a '-'
	if (object_value.charAt(5) != "-")
        return false;
	// check if last 4 digits are a valid integer
	if (object_value.charAt(6) == "-" || object_value.charAt(6) == "+")
        return false;
	return (checkInteger(object_value.substring(6,10)));
}

function IsUndef(val) 
{	var isValid = false;
 	if (val+"" == "undefined")
 		isValid = true;
	return isValid;
}

function IsNull(val) 
{	var isValid = false;
 	if (val+"" == "null")
 		isValid = true;
	return isValid;
}

function IsAlpha(str)
{	if (str+"" == "undefined" || str+"" == "null" || str+"" == "")	
		return false;
	var isValid = true;
	str += "";
  	for (i = 0; i < str.length; i++) 
	{	if ( !( ((str.charAt(i) >= "a") && (str.charAt(i) <= "z")) ||
      			((str.charAt(i) >= "A") && (str.charAt(i) <= "Z")) ) ) {
         				isValid = false;
         				break;
      			}
   } 
	return isValid;
}

function IsBlank(str)
{	var isValid = false;
 	if ( IsNull(str) || IsUndef(str) || (str+"" == "") )
 		isValid = true;
	return isValid;
}

function IsValidEmail(str) 
{	if (str+"" == "undefined" || str+"" == "null" || str+"" == "")	
		return false;
	var isValid = true;
	str += "";
	namestr = str.substring(0, str.indexOf("@"));
	domainstr = str.substring(str.indexOf("@")+1, str.length);
   	if (IsBlank(str) || (namestr.length == 0) || 
			(domainstr.indexOf(".") <= 0) ||
			(domainstr.indexOf("@") != -1) ||
			!IsAlpha(str.charAt(str.length-1)))
		isValid = false;
   	return isValid;
}

-->