var bbDefaultAddToCartButtonStyling  = "font-family: Tahoma; font-size: 32pt; color: #004488;";
var bbDefaultAddToCartButtonText     = "Add To Cart";
var bbDefaultAddToCartLinkStyling    = "font-size: 18pt; text-align: center; text-decoration: underline;";
var bbDefaultAddToCartLinkText       = "Add To Cart";
var bbDefaultAllowClickAnywhere      = false;
var bbDefaultBoxBorderStyling        = "background-color: #FFFFFF; border: 6px dashed #CC0000; border-collapse: collapse; padding: 20px; text-decoration: none; width: 500px;";
var bbDefaultButtonImageBorder       = "3px solid #B40000";
var bbDefaultButtonImageHeight       = "59px";
var bbDefaultButtonImageURL          = "images/blank-belcher-button.gif";
var bbDefaultButtonImageWidth        = "392px";
var bbDefaultBuyButtonLink           = "#";
var bbDefaultCallToActionText        = "Claim Your Copy Now!"; 
var bbDefaultCallToActionTextStyling = "color: #CC0000; font-family: Verdana,Tahoma,Arial,Helvetica,sans serif; font-size: 28pt; font-weight: bold; margin-bottom: 10px;"; 
var bbDefaultCreditCardImagesALink   = true;
var bbDefaultCreditCardImagesURL     = "images/visa-mc-amex-discover-paypal.gif"; 
var bbDefaultRegularPrice            = "$???";
var bbDefaultRegularPriceLabel       = "Regular Price ";
var bbDefaultRegularPriceStyling     = "font-family: Tahoma; font-size: 18pt; color: #000000; margin-bottom: 10px; text-decoration: none;";
var bbDefaultTodaysPriceLabel        = "Today ";
var bbDefaultTodaysPrice             = "$???";
var bbDefaultWhereLinkGoes           = "";

var browserName                  = navigator.appName;
var browserVersion               = parseFloat(navigator.appVersion);

function dhGetBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                            CallToActionText, CallToActionTextStyling, 
                            AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                            BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                            ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                            CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes)
{
   var belcherButtonCode = "<center>";
   var canClickAnywhere  = ((null != AllowClickAnywhere) && AllowClickAnywhere);
   var whereLinkGoesHTML = ((null != whereLinkGoes) && ("" != whereLinkGoes) ? " target='" + whereLinkGoes + "'" : "");

                                       // Is there a message outside the box??
   if ((null != CallToActionText) && ("" != CallToActionText))
   {
                                       // Yes, display it
      belcherButtonCode += "<div" + 
                           ((null != CallToActionTextStyling) && ("" != CallToActionTextStyling) ? " style='" + CallToActionTextStyling + "'>" : ">") + 
                           CallToActionText + "</div></center>";

   }                                   // if ((null != CallToActionText) && ("" != CallToActionText))

                                       // Opening tag for the box
   belcherButtonCode += "<center><div style='" + 
                        ((null != BoxBorderStyling) && ("" != BoxBorderStyling) ? BoxBorderStyling : bbDefaultBoxBorderStyling) + 
                        "'>";
                                       // Should the entire area be clickable
   if (canClickAnywhere)
   {
                                       // Yes, create the opening tag for the link, essentially 
                                       //      clicking anywhere causes the start of the sales process
      belcherButtonCode += "<a href='" + BuyButtonLink + "' style='text-decoration: none;'" + whereLinkGoesHTML + ">";

   }                                   // if (canClickAnywhere)

                                       // Is there a regular price message??
   if ((null != RegularPriceLabel) && ("" != RegularPriceLabel))
   {
                                       // Yes, display it
      belcherButtonCode += "<center><div" + 
                           ((null != RegularPriceStyling) && ("" != RegularPriceStyling) ? " style='" + RegularPriceStyling + "'>" : ">") + 
                           RegularPriceLabel + " <span style='text-decoration: line-through;'> " + RegularPrice + " </span>" + 
                           ((null != TodaysPriceLabel) && ("" != TodaysPriceLabel) ? TodaysPriceLabel + " " +  TodaysPrice : "") + 
                           "</div></center>";

   }                                   // if ((null != RegularPriceLabel) && ("" != RegularPriceLabel))

   belcherButtonCode += ((! canClickAnywhere) ? 
                         "<a href='" + BuyButtonLink + "' style='text-decoration: none;'" + whereLinkGoesHTML + ">" : 
                         "") + 
                        "<div style='margin-bottom: 10px;'>" + 
                        "<div style='background-image: url("+ ((null != ButtonImageURL) && ("" != ButtonImageURL) ? ButtonImageURL : bbDefaultButtonImageURL) + 
                           "); border: " + ((null != ButtonImageBorder) && ("" != ButtonImageBorder) ? ButtonImageBorder : bbDefaultButtonImageBorder) +  
                           "; height: "   + ((null != ButtonImageHeight) && ("" != ButtonImageHeight) ? ButtonImageHeight : bbDefaultButtonImageHeight) +  
                           "; width: "    + ((null != ButtonImageWidth)  && ("" != ButtonImageWidth)  ? ButtonImageWidth  : bbDefaultButtonImageWidth) +  
                           ";'>" + 
                        ((null != AddToCartButtonStyling) && ("" != AddToCartButtonStyling) ? 
                         "<span style='" + AddToCartButtonStyling + "'>" +  AddToCartButtonText + "</span>" : 
                         AddToCartButtonText) + 
                        "</div></div>" + 
                        ((! canClickAnywhere) ? "</a>" : "");

                                       // Is there an add-to-cart link??
   if ((null != AddToCartLinkText) && ("" != AddToCartLinkText))
   {
                                       // Yes, display it
      belcherButtonCode += ((! canClickAnywhere) ? 
                            "<a href='" + BuyButtonLink + "'" + whereLinkGoesHTML +  
                               ((null != AddToCartLinkStyling) && ("" != AddToCartLinkStyling) ? " style='" + AddToCartLinkStyling + "'>" : ">") : "") + 
                           AddToCartLinkText + 
                           ((! canClickAnywhere) ? "</a>" : "");

   }                                   // if ((null != AddToCartLinkText) && ("" != AddToCartLinkText))

                                       // Are the credit card images supposed to be displayed??
   if ((null != CreditCardImagesURL) && ("" != CreditCardImagesURL) && CreditCardImagesURL)
   {
                                       // Yes, display them
      belcherButtonCode += "<br /><br />" + 
                           ((null != CreditCardImagesALink) && (CreditCardImagesALink) ? "<a href='" + BuyButtonLink + "'>" : "") + 
                           "<center><div><img alt='' border='0' src='" + CreditCardImagesURL + "' /></div></center>" + 
                           ((null != CreditCardImagesALink) && (CreditCardImagesALink) ? "</a>" : "");

   }                                   // if ((null != CreditCardImagesURL) && ("" != CreditCardImagesURL))

                                       // Should the entire area be clickable
   if (canClickAnywhere)
   {
                                       // Yes, create the closing tag for the link, essentially 
                                       //      clicking anywhere causes the start of the sales process
      belcherButtonCode += "</a>";
   }                                   // if ((canClickAnywhere)

   belcherButtonCode += "</div></center>";

   return (belcherButtonCode);

}                                      // function getBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                                       //                           CallToActionText, CallToActionTextStyling, 
                                       //                           AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                                       //                           BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                                       //                           ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                                       //                           CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes)

function dhChangeLayerContents(layerID, layerContents)
{
   var desiredLayer = (document.getElementById ? document.getElementById(layerID) : null);

                                       // Can we find the layer??
   if ((null != desiredLayer) && (null != desiredLayer.innerHTML))
   {
                                       // Yes, change it
      desiredLayer.innerHTML = layerContents;

   }                                   // if ((null != desiredLayer) && (null != desiredLayer.innerHTML))

}                                      // function dhChangeLayerContents(layerID, layerContents);


function dhGetDefaultBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                                   CallToActionText, CallToActionTextStyling, 
                                   AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                                   BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                                   ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                                   CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes)
{
   return (dhGetBelcherButton(((null != BuyButtonLink)           && ("" != BuyButtonLink)           ? BuyButtonLink           : bbDefaultBuyButtonLink), 
                              ((null != RegularPrice)            && ("" != RegularPrice)            ? RegularPrice            : bbDefaultRegularPrice), 
                              ((null != TodaysPrice)             && ("" != TodaysPrice)             ? TodaysPrice             : bbDefaultTodaysPrice), 
                              ((null != RegularPriceLabel)       && ("" != RegularPriceLabel)       ? RegularPriceLabel       : bbDefaultRegularPriceLabel), 
                              ((null != TodaysPriceLabel)        && ("" != TodaysPriceLabel)        ? TodaysPriceLabel        : bbDefaultTodaysPriceLabel), 
                              ((null != CallToActionText)        && ("" != CallToActionText)        ? CallToActionText        : bbDefaultCallToActionText), 
                              ((null != CallToActionTextStyling) && ("" != CallToActionTextStyling) ? CallToActionTextStyling : bbDefaultCallToActionTextStyling),  
                              ((null != AddToCartButtonText)     && ("" != AddToCartButtonText)     ? AddToCartButtonText     : bbDefaultAddToCartButtonText), 
                              ((null != AddToCartButtonStyling)  && ("" != AddToCartButtonStyling)  ? AddToCartButtonStyling  : bbDefaultAddToCartButtonStyling), 
                              ((null != AddToCartLinkText)       && ("" != AddToCartLinkText)       ? AddToCartLinkText       : bbDefaultAddToCartLinkText), 
                              ((null != AddToCartLinkStyling)    && ("" != AddToCartLinkStyling)    ? AddToCartLinkStyling    : bbDefaultAddToCartLinkStyling), 
                              ((null != BoxBorderStyling)        && ("" != BoxBorderStyling)        ? BoxBorderStyling        : bbDefaultBoxBorderStyling), 
                              ((null != AllowClickAnywhere)                                         ? AllowClickAnywhere      : bbDefaultAllowClickAnywhere), 
                              ((null != RegularPriceStyling)     && ("" != RegularPriceStyling)     ? RegularPriceStyling     : bbDefaultRegularPriceStyling), 
                              ((null != ButtonImageURL)          && ("" != ButtonImageURL)          ? ButtonImageURL          : bbDefaultButtonImageURL), 
                              ((null != ButtonImageBorder)       && ("" != ButtonImageBorder)       ? ButtonImageBorder       : bbDefaultButtonImageBorder), 
                              ((null != ButtonImageHeight)       && ("" != ButtonImageHeight)       ? ButtonImageHeight       : bbDefaultButtonImageHeight), 
                              ((null != ButtonImageWidth)        && ("" != ButtonImageWidth)        ? ButtonImageWidth        : bbDefaultButtonImageWidth), 
                              ((null != CreditCardImagesURL)     && ((! CreditCardImagesURL) ||
                                                                    ("" != CreditCardImagesURL))    ? CreditCardImagesURL     : bbDefaultCreditCardImagesURL), 
                              ((null != CreditCardImagesALink)                                      ? CreditCardImagesALink   : bbDefaultCreditCardImagesALink), 
                              ((null != whereLinkGoes)                                              ? whereLinkGoes           : bbDefaultWhereLinkGoes)));

}                                      // function dhGetDefaultBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                                       //                                    CallToActionText, CallToActionTextStyling, 
                                       //                                    AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                                       //                                    BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                                       //                                    ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                                       //                                    CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes)

function dhGetDisplayDate(wantDayName)
{
   var todaysDate = new Date();

   return (((null != wantDayName) && wantDayName ? 
            (new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"))[todaysDate.getDay()] + " " :
            "") + 
           (new Array("January", "February", "March", "April", "May", "June", "July", 
                      "August", "September", "October", "November", "December"))[todaysDate.getMonth()] + " " +
           todaysDate.getDate() + ", " + todaysDate.getFullYear());

}                             // function dhGetDisplayDate()

function dhGetParameters(queryStringParameter)
{
   var URL = window.location.href;

   var regularExpression = "[\\?&]" + queryStringParameter.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]") + "=([^&#]*)";
   var regex             = new RegExp(regularExpression, "i");
   var results           = regex.exec(URL);

   return (results == null ? "" : results[1]);

}                                // function dhGetParameters(queryStringParameter)

function dhHideLayer(layerID)
{
   dhShowHideLayer(layerID, "none");

}                                      // function dhHideLayer(layerID)

function dhShowHideLayer(layerID, displayType)
{
   var desiredLayer = (document.getElementById ? document.getElementById(layerID) : null);

                                       // Can we find the layer??
   if ((desiredLayer != null) && (desiredLayer.style != null) && (desiredLayer.style.display != null))
   {
                                       // Yes, then change the display type
      desiredLayer.style.display = displayType;

   }                                   // if ((desiredLayer != null) && (desiredLayer.style != null) && (desiredLayer.style.display != null))

}                                      // function dhShowHideLayer(layerID, displayType)

function dhShowLayer(layerID)
{
   dhShowHideLayer(layerID, "block");

}                                      // function dhShowLayer(layerID)

function dhToggleLayer(layerID)
{
   var desiredLayer = (document.getElementById ? document.getElementById(layerID) : null);
                                       // Can we find the layer??
   if ((desiredLayer != null) && (desiredLayer.style != null))
   {
                                       // Yes, is the layer shown??
      if ((null == desiredLayer.style.display) || (desiredLayer.style.display == "block"))
      {
         dhHideLayer(layerID);         // Yes, hide it
      }
      else                             // No, show it
      {
         dhShowLayer(layerID);
      }                                // if ((null == desiredLayer.style.display) || (desiredLayer.style.display == "block"))

   }                                   // if ((desiredLayer != null) && (desiredLayer.style != null))

}                                      // function dhToggleLayer(layerID)

function dhWriteBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                              CallToActionText, CallToActionTextStyling, 
                              AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                              BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                              ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                              CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes)
{
   document.write(dhGetBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                                     CallToActionText, CallToActionTextStyling, 
                                     AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                                     BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                                     ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                                     CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes));

}                                      // function dhWriteBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                                       //                               CallToActionText, CallToActionTextStyling, 
                                       //                               AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                                       //                               BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                                       //                               ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                                       //                               CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes)

function dhWriteDefaultBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                                     CallToActionText, CallToActionTextStyling, 
                                     AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                                     BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                                     ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                                     CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes)
{
   document.write(dhGetDefaultBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                                            CallToActionText, CallToActionTextStyling, 
                                            AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                                            BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                                            ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                                            CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes));

}                                      // function dhWriteDefaultBelcherButton(BuyButtonLink, RegularPrice, TodaysPrice, RegularPriceLabel, TodaysPriceLabel, 
                                       //                                      CallToActionText, CallToActionTextStyling, 
                                       //                                      AddToCartButtonText, AddToCartButtonStyling, AddToCartLinkText, AddToCartLinkStyling, 
                                       //                                      BoxBorderStyling, AllowClickAnywhere, RegularPriceStyling, 
                                       //                                      ButtonImageURL, ButtonImageBorder, ButtonImageHeight, ButtonImageWidth, 
                                       //                                      CreditCardImagesURL, CreditCardImagesALink, whereLinkGoes)


