
  // Text and image content Copyright (C) 2008, 2009, 2010, 2011 Blue Art Box, LLC dba Eye Can Art. All Rights Reserved. -->
  // Original HTML, CSS and javascript Copyright (C) 2011 John LeFevre. All Rights Reserved. -->

  var magic1="frnznfam11";
  var magic1enabled = true;
  var magic2="makeart11";
  var magic2enabled = true;
  
  function check_coupon(form) 
  {
	  var userCouponOriginal = form.coupon_text.value;
	  var userCouponCompare = userCouponOriginal.toLowerCase();

          if (magic1enabled && userCouponCompare == magic1)
          {
                  window.alert("Welcome family and friends! Your coupon " + userCouponOriginal + " gets a 20% price reduction!");
          }
          else if (magic2enabled && userCouponCompare == magic2)
          {
                  window.alert("Your coupon " + userCouponOriginal + " gets a 10% price reduction!");
          }
          else
          {
                  window.alert("Your discount code is invalid.");
          }
          set_discount(form);
  }
  
  function set_discount(form) 
  {
	  var userCouponOriginal = form.coupon_text.value;
	  var userCouponCompare = userCouponOriginal.toLowerCase();

          if (magic1enabled && userCouponCompare == magic1)
          {
                  form.discount_amount.value = "";
                  form.discount_amount2.value = "";
                  form.discount_rate.value = "20";
                  form.discount_rate2.value = "20";
                  form.on1.value = "Coupon Entered";
                  form.os1.value = userCouponOriginal;
          }
          else if (magic2enabled && userCouponCompare == magic2)
          {
                  form.discount_amount.value = "";
                  form.discount_amount2.value = "";
                  form.discount_rate.value = "10";
                  form.discount_rate2.value = "10";
                  form.on1.value = "Coupon Entered";
                  form.os1.value = userCouponOriginal;
          }
          else
          {
                  form.discount_amount.value = "";
                  form.discount_amount2.value = "";
                  form.discount_rate.value = "";
                  form.discount_rate2.value = "";
                  form.on1.value = "";
                  form.os1.value = "";
          }
  }

  var popupWindow = null;

  function centeredPopup(url, title, w, h, scrollable)
  {
    leftPos = (screen.width) ? (screen.width-w)/2 : 0;
    topPos = (screen.height) ? (screen.height-h)/2 : 0;
    settings = 'height=' + h + ',width=' + w + ',top=' + topPos + ',left=' + leftPos + ',scrollbars=' + scrollable + ',resizable';
    popupWindow = window.open(url, title, settings)
  }

  function sold_out(form) 
  {
          window.alert("Sorry, " + form.item_name.value + " is currently sold out.");
  }
 



