function editobj(obj) {
     // check if cookies are disabled
     // check IE4+ & NS6+ first
     var cookieEnabled=(navigator.cookieEnabled)? true : false

     //if not IE4+ nor NS6+
     if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ 
       document.cookie="testcookie"
       cookieEnabled=(document.cookie.indexOf("testcookie")!=-1)? true : false
     }

     if (!cookieEnabled) {        //if cookies are disabled on client's browser
       alert("Because you have your browser's cookies disabled you will be unable to order online as our website uses cookies to track the items in your basket.  Please contact us at 360-989-0960 to place a phone order or temporarily enable cookies to place an online order.  We apologize for the inconvenience.");
       return false 
     }
  
     // check if a <select> tag is present
     var seltag = document.getElementsByTagName("select");
     var selname ="";
     var action = "";
     var prompt = "";
     id = "selectbox";
     cnt= 0;
     for (var i = 0; i < seltag.length; i++) {    
         selname = seltag[i].getAttribute("name"); 
         if(selname.substring(0,18) == "Product_Attributes") {  //ignore other <select tags
            cnt = cnt + 1; 
            action = document.getElementById(id+cnt).value;
            action = (action.substring(0,6)).toUpperCase();
            if (action == "SELECT")
            {
               prompt = document.getElementById('attributeprompt'+cnt).innerHTML;
               prompt = prompt.replace(/:/g,".");
              alert (prompt);
              return false;
            }
         } 
     }
  // edit for xlerator recessed kit
   var item_code = obj.Product_Code.value;
   var idx = item_code.indexOf("EXRECESSEDKIT");
   var is_OK = true;
   if(idx != -1) {
      is_OK = confirm("The purchase of this Xlerator Recessed Kit requires that a matching Xlerator hand dryer be purchased. \nClick OK to purchase, else Cancel."); 
   } 
    if (!is_OK) { 
      return false; 
    }
 
  // edit the quantity entered
       var prodcode = obj.Product_Code.value;
	// get the quantity entered on the screen
	var qty = obj.Quantity.value;
        // call edit function
        var result = editqty(qty,prodcode);
        // return result of edit
        if (! result)  {		// edits OK?
        // found edit error, so select & focus on error
	   obj.Quantity.select();
	   obj.Quantity.focus();
	   return result;
	}

	var min_qty = obj.Min_Qty.value;
        min_qty = parseInt(min_qty);  
	if (qty < min_qty) {
           alert("Sorry but a minimum quantity of " + min_qty + " must be purchased.");
	   obj.Quantity.select();
	   obj.Quantity.focus();
	   obj.Quantity.value = min_qty;
	   return false;
        }
        return true;

}
function ConfirmQty(obj) {
        var desc = obj.Product_Code.value;
        var response = editresp(desc);
        if (response == 'Y')
           return true;
        if (response == 'N')
           return false;
        obj.Quantity.value = response;
        return true; 
}

