//******************
// Global Variables
//******************


    // These variables indicate the type of DOM, if any, this browser uses.
var BH_isDHTML  = 0;
var BH_isLayers = 0;
var BH_isAll    = 0;
var BH_isID     = 0;
var BH_browserVersion = parseInt(navigator.appVersion);

// Adjust global variable values based on browser type
if (document.getElementById)
{
    BH_isID    = 1;
    BH_isDHTML = 1;
}
else if (document.all)
{
    BH_isAll   = 1;
    BH_isDHTML = 1;
}
else if ((navigator.appName.indexOf('Netscape') != -1) && (BH_browserVersion == 4))
{
    BH_isLayers = 1;
    BH_isDHTML  = 1;
}

// This function takes an object's ID and creates a DOM
// for the browser being used.
function BH_findDOM(objectId,withStyle)
{
    if (withStyle == 1)
    {
        if (BH_isID)
        {
            return(document.getElementById(objectId).style);
        }
        else if (BH_isAll)
        {
            return(document.all[objectId].style);
        }
        else if (BH_isLayers)
        {
            return(document.layers[objectId]);
        }
    }
    else if (BH_isID)
    {
        return(document.getElementById(objectId));
    }
    else if (BH_isAll)
    {
        return(document.all[objectId]);
    }
    else if (BH_isLayers)
    {
        return(document.layers[objectId]);
    }
    
} // BH_findDOM()

// Return specified object's width
function BH_findWidth(objectID)
{
    var dom = BH_findDOM(objectID,0);

    if (dom.offsetWidth)
        return(dom.offsetWidth);

    if (dom.clip.width)
        return(dom.clip.width);

    return(null);

} // BH_findWidth()



//*******************************************************
// This function can be called from any page at the top
// level of the site to allow the user to open the order
// form in a new window.
//*******************************************************
function BH_OpenForm()
{
    var sFeatures;
    var newWindow;

    // Build window feature string
    sFeatures  = "height=400,width=670,innerHeight=400,innerWidth=670";
    sFeatures += ",screenX=100,screenY=50,left=100,top=50";
    sFeatures += ",menubar,resizable,scrollbars,status";
    sFeatures += ",toolbar,dependent";

    // Open the Window and give it the focus.
    newWindow = window.open( "/Orderform.htm", 'OrderForm', sFeatures );
    newWindow.focus();

} // BH_OpenForm()




//*****************************************************************
//* Date Display Function
//*
//* Outputs a string of HTML formatted based on the fmt parameter:
//*
//*   fmt=0:
//*     day-of-week<br>
//*     full-month-name day, 4-digit-year
//*
//*   fmt=1:
//*     full-month-name day, 4-digit-year
//*
//*****************************************************************
function BH_displayToday(fmt)
{
  var Months = new Array("January","February","March","April","May","June",
                         "July","August","September","October","November","December");
  var Days   = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

  var MyDate = new Date();
  var Year   = MyDate.getYear();

  if (Year < 1900)
  {
    Year += 1900;
  }

  if (fmt==1)
  {
    document.write(Days[MyDate.getDay()]+"<br>\n");
  }

  document.write(Months[MyDate.getMonth()]+"&nbsp;"+MyDate.getDate()+",&nbsp;"+Year);

} // BH_displayToday()


