<!--
//*** rollover functions start ***//

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function loadupImages() {
	if (document.images) {
		over_home_butn_1 = newImage('graphics/home_butn_1r.gif');

		preloadFlag = true;
	}
}

//*** rollover functions end ***//

//*** collapsing menu functions starts rev2/3/2005 ***//
// 

var menus = new Array();

window.onunload = SetReturnCookie;
function SetReturnCookie()
{
  if (ReadCookie("ReturnVisit") != "true") {
    SaveCookie("ReturnVisit", "true", "Thu, 01-Jan-10 00:00:01 GMT", "/");
  }
}

//********* Collapsable Menu Set ************//

function CollapsableMenuSet()
{
  this.openPanel = null;
}

//********* Collapsable Menu Panel **********//

function CollapsableMenuPanel(panelID, menuSet, titleID, closeTitleHTML, openTitleHTML, saveState, defaultOpen)
{
  // Object Methods
  this.TogglePanel = TogglePanel;
  this.OpenPanel = OpenPanel;
  this.ClosePanel = ClosePanel;
  this._SetState = _SetState;
  this._GetState = _GetState;
  
  // Set up menu panel
  this.panelID = panelID;
  this.objTitle = document.getElementById(titleID);
  this.objPane = document.getElementById(panelID);
  if (this.objTitle)
  {
    if (closeTitleHTML != null && openTitleHTML != null)
    {
      this.closeTitleHTML = closeTitleHTML;
      this.openTitleHTML = openTitleHTML;
    }
  }
  // Set add menu to menu set
  this.menuSet = menuSet;
  menus[menus.length] = this;
  
  // Set saveState
  if (saveState != null)
  {
    this.saveState = saveState;
  }
  else
  {
    this.saveState = true;
  }
  // Set defaultOpen
  if (defaultOpen != null)
  {
    this.defaultOpen = defaultOpen;
  }
  else
  {
    this.defaultOpen = false;
  }
  
  // Get State
  if (ReadCookie("ReturnVisit") == "true" && this.saveState) {
    this._GetState();
  }
  else
  {
    if (this.defaultOpen)
    {
      this.OpenPanel();
    }
    else
    {
      this.ClosePanel();
    }
  }
}

//
// Toggle, open and close methods
//

function TogglePanel()
{
  if (this.objPane.style.display == "none")
  {
    this.OpenPanel();
  }
  else
  {
    this.ClosePanel();
  }
}

function OpenPanel()
{
  // Check if this menu is in a set of menus that only opens one at a time
  if (this.menuSet)
  {
    if (this.menuSet.openPanel != null && this.menuSet.openPanel != this)
    {
      this.menuSet.openPanel.ClosePanel();
    }
    this.menuSet.openPanel = this;
  }
  // Sets text in title, opens menu, & saves the state
  if (this.openTitleHTML)
  {
    this.objTitle.innerHTML = this.openTitleHTML;
  }
  this.objPane.style.display = "block";
  this._SetState();
}

function ClosePanel()
{
  // Check if menu is in a set of menus that only opens one at a time
  if (this.menuSet)
  {
    if (this.menuSet.openPanel == this)
    {
      this.menuSet.openPanel = null;
    }
  }
  // Sets text in title, closes menu, & saves the state
  if (this.closeTitleHTML)
  {
    this.objTitle.innerHTML = this.closeTitleHTML;
  }
  this.objPane.style.display = "none";
  this._SetState();
}

//
// Functions to save panel state across pages
//
function _SetState()
{
  if (this.saveState)
  {
    if (this.objPane.style.display == "block")
    {
      SaveCookie(this.panelID, "open", "Thu, 01-Jan-10 00:00:01 GMT", "/");
    }
    else
    {
      DeleteCookie(this.panelID);
    }
  }
}

function _GetState()
{
  if (this.saveState)
  {
    var state = ReadCookie(this.panelID);

    if (state == "open")
    {
      this.OpenPanel();
    }
    else
    {
      this.ClosePanel();
    }
  }
}


//
// Cookie Functions
//

function SaveCookie(cookieName, cookieValue, expireDate, path)
{
  var cookieString = "";
  if (cookieName)
  {
    cookieString = cookieName + "=" + cookieValue + "; ";
    if (expireDate)
    {
      cookieString = cookieString + "expires=" + expireDate + "; ";
    }
    if (path)
    {
      cookieString = cookieString + "path=" + path + "; ";
    }
    document.cookie = cookieString;
  }
}

function DeleteCookie(cookieName)
{
  var cookieString = "";
  if (cookieName)
  {
    document.cookie = cookieName + "= ; expires= Thu, 01-Jan-70 00:00:01 GMT;path=/;";
  }
}

function ReadCookie(cookieName)
{
    // Get strings
    var dc = document.cookie;
    var prefix = cookieName + "=";

    // Beginning of cookie substring
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
      begin = dc.indexOf(prefix);
      if (begin != 0) return null;
    }
    else
    {
      begin += 2;
    }

    // End of cookie substring
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
      end = dc.length;
    }

    return unescape(dc.substring(begin + prefix.length, end));
}
//**end collapsable menu functions - rev 2/3/2005**//

-->
