<!--

         window.defaultStatus = "GourmetSleuth.com" ;

     var findWindow = null ;
     var isNS = (navigator.appName=="Netscape") ;
     var myBrowser = (isNS) ? "NS":"IE" ;
     var myCart = "" ;

     var strVer = navigator.appVersion ;
     var strShow = (isNS)?"show":"visible" ;
     var scrWidth = screen.width ;
     var intWidth = 0 ;
     var strWidth = "" ;

      if (!isNS){
          iPos = strVer.indexOf("MSIE") ;
          iPos = iPos+5 ;
          strUserVer = strVer.substr(iPos,1) ;
         }
      else { iPos = strVer.indexOf(".") ;
             iPos = iPos-1 ;
             strUserVer = strVer.substr(iPos,1) ;
           }

      if (strUserVer >= 5){
         var strDocRef = "document.getElementById" ;
         var strHide = "hidden" ;
         var strShow = "visible" ;
         var strStyle = ".style" ;
         }
      else { var strDocRef = (isNS) ? "document.layers" : "document.all" ;
             var strHide   = (isNS) ? "hide" : "hidden" ;
             var strStyle  = (isNS) ? "" : ".style" ; }

// ************************************************************************************************
// Function used throughout GourmetSleuth.com.
// ************************************************************************************************

function addRecip(thisRID){
         var recipSelect = eval("document.GSCART.R_" + thisRID) ;
         var indexRecip = recipSelect.selectedIndex ;

         document.GSCART.KeyVal.value = thisRID ;
         document.GSCART.ItmVal.value = recipSelect[indexRecip].value ;
         document.GSCART.Action.value = "RECIPIENT" ;
         document.GSCART.submit() ;
         }

function buyMore(thisPID, thisQty){
         document.GSCART.KeyVal.value = thisQty ;
         document.GSCART.ItmVal.value = thisPID ;
         document.GSCART.Action.value = "MORE" ;
         document.GSCART.submit() ;
         }

function calcShipping(){
         document.GSCART.Action.value = "SHIP" ;
         document.GSCART.submit() ;
         }

function changeQty(thisTag, thisRID){
         var thisField = eval("document.GSCART." + thisTag) ;
         var thisIdx =  thisField.selectedIndex ;
         thisQty = thisField[thisIdx].value ;

         if (thisQty == 0){ 
             alert("Please select a quantity for this item.") ;
             thisField.focus() ;
             thisField.select() ;
             return ;
            }
         recalcCart("") ;
         }

function clearChoice(thisField){
         var thisPick = eval("document.GSCART." + thisField) ;
         thisPick.value = "" ;
         document.GSCART.ZipCode.value = "" ;
         return ;
         }

function findRecip(findRecip){
         document.GSCART.Action.value = "FIND" ;
         document.GSCART.KeyVal.value = findRecip ;
         document.GSCART.submit() ;
         }

function deleteItem(thisSeq){
         document.GSCART.Delete.value = thisSeq ;
         document.GSCART.Action.value = "DELETE" ;
         document.GSCART.submit() ;
         }

function HideDiv(strDivId){
         var checkStatus = document.GSCART.Checkout ;
         if (checkStatus.value == "False"){ return ; }
         if (strUserVer >= 5){
             strThisRef = strDocRef + '("' + strDivId + '")' ;
            }
         else { strThisRef = strDocRef ; }
         eval(strThisRef + strStyle + '.visibility = "' + strHide + '"') ;
         }

function pickShip(){
         var thisShip = document.GSCART.ShipMode ;

         for (var i = 0; i < thisShip.length; i++){
              var thisMode = thisShip[i] ;

              if (thisMode.checked){
                  HideDiv('coButton') ;

                  var thisCost = eval("document.GSCART.MODE_" + thisMode.value) ;
                  document.GSCART.ShipCost.value = thisCost.value ;
                  document.GSCART.WaitFor.value = "Y" ;
                  document.GSCART.Action.value = "SHIP" ;
                  document.GSCART.submit() ;
                 }
             }
         }

function pickZone(){
         var allZones = document.GSCART.ZONE ;

         for (var i = 0; i < allZones.length; i++){
              var thisZone = allZones[i] ;

              if (thisZone.checked){
                  document.GSCART.KeyVal.value = thisZone.value ;
                  document.GSCART.Action.value = "ZONE" ;
                  document.GSCART.submit() ;
                 }
             }
         }

// ------------------------------------------------------------------------------------------------
// This function handles the "recalculate" button click when the user is on the cart summary page
// and has changed some detail.
// ------------------------------------------------------------------------------------------------

function recalcCart(thisRID){

// ------------------------------------------------------------------------------------------------
// Before we proceed with any further action, check to see if there is an open recipient field. If
// there is - identified by a value in thisRID - check to see the person entered something in the
// field. If not, send them an error message.
// ------------------------------------------------------------------------------------------------

         if (thisRID != ""){
             var thisRecip = eval("document.GSCART.R_" + thisRID) ;

             if (thisRecip.value == ""){
                 alert("Please enter the recipient's name.") ;
                 thisRecip.focus() ;
                 thisRecip.select() ;
                 return ;
                }
             }

         document.GSCART.Action.value = "UPDATE" ;
         document.GSCART.submit() ;
         }

// ================================================================================================
// This function is called from Checkout.asp when the user clicks the "Continue shopping" icon. The
// function is used to sense any changes that might have been applied to the cart summary so that
// the user can be warned to click the recalculate icon.
// ================================================================================================

function senseCart(whereNext, thisRID){
         if (whereNext == ""){ whereNext = "cat_home.asp" ; }
         document.location.href = whereNext ;
         return ;

         var arrNowGift = new Array() ;
         var arrWasGift = new Array() ;

         if (whereNext == ""){ whereNext = "cat_home.asp" ; }

// ------------------------------------------------------------------------------------------------
// Split the "Picked" tag into an array that represents the list of item keys in the cart.
// ------------------------------------------------------------------------------------------------

         wasWrapped = document.GSCART.Wrapped.value ;
         cartPicked = document.GSCART.Picked.value ;

         if (cartPicked == ""){
             document.location.href = whereNext ;
            }

         arrItems = cartPicked.split(",") ;

// ------------------------------------------------------------------------------------------------
// Step through the list of items in the cart and find out of any of them have their gift wrap box
// checked. If they do, assign the corresponding arrNowGift[] array element to true. While we are
// here, we also check to see if they checked the "Remove" box. If they did, we can immediately
// return with a reminder that they need to click the recalculate icon.
// ------------------------------------------------------------------------------------------------

         for (var i = 0; i < arrItems.length; i++){
              thisDrop = eval("document.GSCART.X_" + arrItems[i]) ;

              if (thisDrop.checked){
                  alert("Please click the recalculate button to\nremove any items you have checked.") ;
                  return ;
                 }

              thisGift = eval("document.GSCART.G_" + arrItems[i]) ;
              
              if (thisGift.checked){
                  arrNowGift[i] = "Y" ;
                 }
              else { arrNowGift[i] = "N" ; }

// ------------------------------------------------------------------------------------------------
// In order to compare what the page looked like when it was first launched or last refreshed, we
// set the element to false and then adjust it of we find the element's key value appearing in the
// Wrapped page tag.
// ------------------------------------------------------------------------------------------------

              arrWasGift[i] = "N" ;

              if (wasWrapped.indexOf(arrItems[i]) >= 0){
                  arrWasGift[i] = "Y" ;
                 }
             }

// ------------------------------------------------------------------------------------------------
// Now step through the arrNowGift[] array and compare each element's value with the same in the
// arrWasGift[] array. If any pair of elements fail the equality test, we know something has been
// changed since the page was last displayed.
// ------------------------------------------------------------------------------------------------

         for (var i = 0; i < arrNowGift.length; i++){
              var isChanged = (arrNowGift[i] == arrWasGift[i])? false : true ;
              if (isChanged){
                  alert("You have made some changes to your cart.\nClick recalculate to first save these changes.") ;
                  return ;
                  }
             }

         document.location.href = whereNext ;
         }

function ShowDiv(strDivId){
         var checkStatus = document.GSCART.Checkout ;
         if (checkStatus.value == "False"){ return ; }
         if (strUserVer >= 5){
             strThisRef = strDocRef + '("' + strDivId + '")' ;
            }
         else { strThisRef = strDocRef ; }

         eval(strThisRef + strStyle + '.visibility = "' + strShow + '"') ;
         }

function whereTo(whereNext, thisRID){
         document.GSCART.WhereTo.value = whereNext ;
         recalcCart(thisRID) ;
         }

// -->