/* BRUNO.JS */


// Image pre-load
if (document.images) {

	wineshopup    = new Image();
    wineshopup.src= "images/Visit-Wine-Shop.gif" ;
    wineshopdown  = new Image() ;
    wineshopdown.src = "images/Visit-Wine-Shop-on.gif" ;
    
}



// Obtained from Dev411.coma
function fontSizer (defaultSize,cookieName) {
  if (!document.getElementById) return;
  var d = document, t = this;
  t.defaultSize = defaultSize;
  t.cookieName = cookieName;
  t.minSize = 0;
  t.maxSize = 6;
  if ((t.defaultSize < t.minSize) && (t.defaultSize > t.maxSize))
    t.defaultSize = 2;
  t.currentSize = t.defaultSize;
  t.sizeNames = new Array('xx-small','x-small','small','medium',
    'large','x-large','xx-large');
  t.tagsToChange =new Array('div','td','th','p','tr');
  t.init = function (item) {
    t.setFontSize(item,getCookie(t.cookieName))
  };
  t.adjust = function (item,adjustment) {
    t.setFontSize(item,Number(t.currentSize)+Number(adjustment))
  };
  t.reset = function (item) {
    t.setFontSize(item,t.defaultSize)
  };
  t.setFontSize = function (item,newSize) {
    var itemElement = null, itemTags, i, j;
    if (isNaN(newSize)) newSize = t.defaultSize
    else if (newSize < t.minSize) newSize = t.minSize
    else if (newSize > t.maxSize) newSize = t.maxSize;
    t.currentSize = newSize;
    setCookie(t.cookieName,newSize);
    if (!(itemElement = d.getElementById(item)))
      itemElement = d.getElementsByTagName(item)[0];
    itemElement.style.fontSize=t.sizeNames[newSize];
    for (i=0;i<t.tagsToChange.length;i++) {
      itemTags = itemElement.getElementsByTagName(t.tagsToChange[i]);
      for (j=0;j<itemTags.length;j++)
        itemTags[j].style.fontSize=t.sizeNames[newSize];
    }
  }
}

//+----------------------------------------------------------------------------
//  Function:       setCookie
//  Author:         Webreference.com
//  Created:        1996
//  Description:    Sets a cookie. 
//                  
//  Arguments:      name - name of the cookie
//                  value - value of the cookie
//                  [expires] - expiration date of the cookie (defaults to end of current session)
//                  [path] - path for which the cookie is valid (defaults to path of calling document)
//                  [domain] - domain for which the cookie is valid (defaults to domain of calling document)
//                  [secure] - Boolean value indicating if the cookie transmission requires
//                             a secure transmission
// 
//  Returns:        none
//+----------------------------------------------------------------------------
//
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


//+----------------------------------------------------------------------------
//  Function:       getCookie
//  Author:         Webreference.com
//  Created:        1996
//  Description:    Retrieves the value of a cookie.
//                  
//  Arguments:      name - name of the desired cookie
//  Returns:        string containing value of specified cookie or null
//                  if cookie does not exist
//+----------------------------------------------------------------------------
//
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


//+----------------------------------------------------------------------------
//  Function:       buttondown
//  Author:         Matt Nolker
//  Description:    Used to display the correct rollover image when the mouse rolls  
//                  over a button.
//  Arguments:      buttonname - name of the button image to get
//  Returns:        none
//+----------------------------------------------------------------------------
//
function buttondown( buttonname )
{
    if (document.images) {
      document.getElementById(buttonname).src = eval( buttonname + "down.src" );
    }
}


//+----------------------------------------------------------------------------
//  Function:       buttonup
//  Author:         Matt Nolker
//  Description:    Used to display the original button image when the mouse rolls  
//                  away from a button.
//  Arguments:      buttonname - name of the button image to get
//  Returns:        none
//+----------------------------------------------------------------------------
//
function buttonup ( buttonname )
{
    if (document.images) {
      document.getElementById(buttonname).src = eval( buttonname + "up.src" );
    }
}

