<!--
  function openURL(form){
  
  	var URL = form.goURL.options[form.goURL.selectedIndex].value;
          top.location.href = URL;
  
  }
  
  function submitForm(myform)
  {
     myform.submit();
  }  
    
  /* 
     this function is used on the cart page to autoselect the giftnote when 
     a user selects the gift wrap option
   */
  function autoSelectGiftNote() {
    
    if (document.cartform.wrap.checked &&
        !document.cartform.giftnote.checked) {
       
      document.cartform.giftnote.click();
    }  
  }  
  
 /**
  * <p>This function is used to limit the number of characters entered into a form
  * field.  Created for the gift note textarea
  **/
  function textLimit(field, maxlen) {
     if (field.value.length > maxlen) {
       field.value = field.value.substring(0, maxlen);
     }
  }  
    
  /**
  * The email campaign popup.  First check the form fields to 
  * make sure we can submit.
  */ 
  function emailSignup(URL, theForm) {  
    // need to make sure the required fields are not null
    openWindow = true;
    
    // check to see if we have an email address at all
    addressEntered = theForm.emailAddress.value;
    if (trim(addressEntered) == "") {
      openWindow = false;
    }
    
    //if email id is not valid dont open the window
    if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(addressEntered))){
      openWindow = false;
    }
  
    // don't open window if we had a form error
    if (openWindow) {
      newwindow=open(URL,"","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=480,height=500");
    }
  }
    
  /* The product details popup */
  function detailsPopup(URL) {
    newwindow=open(URL,"details","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=450,height=525");
    newwindow.focus();
  }
  
  /* The notify me when in-stock popup */
  function notifyMePopup(URL) {
    newwindow=open(URL,"notifyMe","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=480,height=530");
    newwindow.focus();
  }
  
  /* The notify me when in-stock popup */
  function emailFriendPopup(URL) {
    newwindow=open(URL,"emailFriend","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=yes,width=480,height=570");
    newwindow.focus();
  }
  
  function trim(inputString) {
     // Removes leading and trailing spaces from the passed string. Also removes
     // consecutive spaces and replaces it with one space. If something besides
     // a string is passed in (null, custom object, etc.) then return the input.
     if (typeof inputString != "string") { return inputString; }
     var retValue = inputString;
     var ch = retValue.substring(0, 1);
     while (ch == " ") { // Check for spaces at the beginning of the string
        retValue = retValue.substring(1, retValue.length);
        ch = retValue.substring(0, 1);
     }
     ch = retValue.substring(retValue.length-1, retValue.length);
     while (ch == " ") { // Check for spaces at the end of the string
        retValue = retValue.substring(0, retValue.length-1);
        ch = retValue.substring(retValue.length-1, retValue.length);
     }
     while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
        retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
     }
     return retValue; // Return the trimmed string back to the user
  } // Ends the "trim" function

 function killEnter(evt) {
   if(evt.keyCode == 13 || evt.which == 13) {
     return false;
   }
  return true;
}

  function changeEmailPreferenceTab(pLabelTab) {

    if ("emailPreferences_tab_subscribe" == pLabelTab.id) {
      pLabelTab.innerHTML = '<div><img title="Subscribe" alt="Subscribe" name="image_tab_subscribe" src="/llbean/templates/_current/images/tab_subscribe_on.gif"/></div>';
    
      var updateTab = document.getElementById("emailPreferences_tab_update");
      updateTab.innerHTML = '<div><img title="Update Email" alt="Update Email" name="image_tab_update" src="/llbean/templates/_current/images/tab_update_off.gif"/></div>';
    
      var unsubscribeTab = document.getElementById("emailPreferences_tab_unsubscribe");
      unsubscribeTab.innerHTML = '<div><img title="Unsubscribe" alt="Unsubscribe" name="image_tab_unsubscribe" src="/llbean/templates/_current/images/tab_unsub_off.gif"/></div>';
    
      var contentTabSubscribe = document.getElementById(pLabelTab.id +'_content');
      
      if (navigator.userAgent.indexOf('MSIE') > 0) {
        contentTabSubscribe.className = "emailPreferences_largeTabContent_shown";
      
        var contentTabUpdate = document.getElementById('emailPreferences_tab_update_content');
        contentTabUpdate.className = "emailPreferences_largeTabContent_hide";
  
        var contentTabUnsub = document.getElementById('emailPreferences_tab_unsubscribe_content');
        contentTabUnsub.className = "emailPreferences_largeTabContent_hide";
      } else {
        contentTabSubscribe.setAttribute("class","emailPreferences_largeTabContent_shown");
    
        var contentTabUpdate = document.getElementById('emailPreferences_tab_update_content');
        contentTabUpdate.setAttribute("class","emailPreferences_largeTabContent_hide");
    
        var contentTabUnsub = document.getElementById('emailPreferences_tab_unsubscribe_content');
        contentTabUnsub.setAttribute("class","emailPreferences_largeTabContent_hide");
      }
    
    } else if ("emailPreferences_tab_update" == pLabelTab.id) {
      pLabelTab.innerHTML = '<div><img title="Update Email" alt="Update Email" name="image_tab_update" src="/llbean/templates/_current/images/tab_update_on.gif"/></div>';
    
      var subscribeTab = document.getElementById("emailPreferences_tab_subscribe");
      subscribeTab.innerHTML = '<div><img title="Subscribe" alt="Subscribe" name="image_tab_subscribe" src="/llbean/templates/_current/images/tab_subscribe_off.gif"/></div>';
    
      var unsubscribeTab = document.getElementById("emailPreferences_tab_unsubscribe");
      unsubscribeTab.innerHTML = '<div><img title="Unsubscribe" alt="Change Frequency/Unsubscribe" name="image_tab_unsubscribe" src="/llbean/templates/_current/images/tab_unsub_off.gif"/></div>';
    
      var contentTabUpdate = document.getElementById(pLabelTab.id +'_content');
    
      if (navigator.userAgent.indexOf('MSIE') > 0) {
        contentTabUpdate.className = "emailPreferences_largeTabContent_shown";
        var contentTabSubscribe = document.getElementById('emailPreferences_tab_subscribe_content');
        contentTabSubscribe.className = "emailPreferences_largeTabContent_hide";
    
        var contentTabUnsub = document.getElementById('emailPreferences_tab_unsubscribe_content');
        contentTabUnsub.className = "emailPreferences_largeTabContent_hide";

      } else {
        contentTabUpdate.setAttribute("class","emailPreferences_largeTabContent_shown");

        var contentTabSubscribe = document.getElementById('emailPreferences_tab_subscribe_content');
        contentTabSubscribe.setAttribute("class","emailPreferences_largeTabContent_hide");
        
        var contentTabUnsub = document.getElementById('emailPreferences_tab_unsubscribe_content');
        contentTabUnsub.setAttribute("class","emailPreferences_largeTabContent_hide");
      }
    
    } else if ("emailPreferences_tab_unsubscribe" == pLabelTab.id) {
      pLabelTab.innerHTML = '<div><img title="Unsubscribe" alt="Unsubscribe" name="image_tab_unsubscribe" src="/llbean/templates/_current/images/tab_unsub_on.gif"/></div>';
    
      var subscribeTab = document.getElementById("emailPreferences_tab_subscribe");
      subscribeTab.innerHTML = '<div><img title="Subscribe" alt="Subscribe" name="image_tab_subscribe" src="/llbean/templates/_current/images/tab_subscribe_off.gif"/></div>';
    
      var updateTab = document.getElementById("emailPreferences_tab_update");
      updateTab.innerHTML = '<div><img title="Update Email" alt="Update Email" name="image_tab_update" src="/llbean/templates/_current/images/tab_update_off.gif"/></div>';
      var contentTabUnsub = document.getElementById(pLabelTab.id +'_content');
   
      if (navigator.userAgent.indexOf('MSIE') > 0) {
        
        contentTabUnsub.className = "emailPreferences_largeTabContent_shown";
      
        var contentTabSubscribe = document.getElementById('emailPreferences_tab_subscribe_content');
        contentTabSubscribe.className = "emailPreferences_largeTabContent_hide";
      
        var contentTabUpdate = document.getElementById('emailPreferences_tab_update_content');
        contentTabUpdate.className = "emailPreferences_largeTabContent_hide";
    
    } else {
      
      contentTabUnsub.setAttribute("class","emailPreferences_largeTabContent_shown");
    
      var contentTabSubscribe = document.getElementById('emailPreferences_tab_subscribe_content');
      contentTabSubscribe.setAttribute("class","emailPreferences_largeTabContent_hide");
    
      var contentTabUpdate = document.getElementById('emailPreferences_tab_update_content');
      contentTabUpdate.setAttribute("class","emailPreferences_largeTabContent_hide");
    }
   }
    
  }
-->
