// $Id: tabImages.js,v 1.7 2006/11/13 18:52:50 dharris Exp $

// instantiate and load the images for the tab buttons
if (document.images)
{
  var news_off = new Image;
  news_off.src = this.document.contextUri + "/images/banner_tab_news_inactive.gif";
  var news_hov = new Image;
  news_hov.src = this.document.contextUri + "/images/banner_tab_news_hover.gif";
  var mycq_off = new Image;
  mycq_off.src = this.document.contextUri + "/images/banner_tab_mycq_inactive.gif";
  var mycq_hov = new Image;
  mycq_hov.src = this.document.contextUri + "/images/banner_tab_mycq_hover.gif";
  var bill_off = new Image;
  bill_off.src = this.document.contextUri + "/images/banner_tab_bills_inactive.gif";
  var bill_hov = new Image;
  bill_hov.src = this.document.contextUri + "/images/banner_tab_bills_hover.gif";
  var comm_off = new Image;
  comm_off.src = this.document.contextUri + "/images/banner_tab_comm_inactive.gif";
  var comm_hov = new Image;
  comm_hov.src = this.document.contextUri + "/images/banner_tab_comm_hover.gif";
  var memb_off = new Image;
  memb_off.src = this.document.contextUri + "/images/banner_tab_members_inactive.gif";
  var memb_hov = new Image;
  memb_hov.src = this.document.contextUri + "/images/banner_tab_members_hover.gif";
  var sear_off = new Image;
  sear_off.src = this.document.contextUri + "/images/banner_tab_search_inactive.gif";
  var sear_hov = new Image;
  sear_hov.src = this.document.contextUri + "/images/banner_tab_search_hover.gif";
  var tool_off = new Image;
  tool_off.src = this.document.contextUri + "/images/banner_tab_tool_inactive.gif";
  var tool_hov = new Image;
  tool_hov.src = this.document.contextUri + "/images/banner_tab_tool_hover.gif";
}

// sets the image source for the img named 'name' for the 'state' which is
// either over or out.
function chgTabImg(name, state)
{
  if (name == "newstab_img") {
    if (theCurrentTab!="news") {
      if (state == "over")
        document[name].src = news_hov.src;
      else
        document[name].src = news_off.src;
    }
  } else if (name == "mycqtab_img") {
    if (theCurrentTab!="mycq") {
      if (state == "over")
        document[name].src = mycq_hov.src;
      else
        document[name].src = mycq_off.src;
    }
  } else if (name == "billtab_img") {
    if (theCurrentTab!="bills") {
      if (state == "over")
        document[name].src = bill_hov.src;
      else
        document[name].src = bill_off.src;
    }
  } else if (name == "commtab_img") {
    if (theCurrentTab!="committees") {
      if (state == "over")
        document[name].src = comm_hov.src;
      else
        document[name].src = comm_off.src;
    }
  } else if (name == "membtab_img") {
    if (theCurrentTab!="members") {
      if (state == "over")
        document[name].src = memb_hov.src;
      else
        document[name].src = memb_off.src;
    }
  } else if (name == "seartab_img") {
    if (theCurrentTab!="search") {
      if (state == "over")
        document[name].src = sear_hov.src;
      else
        document[name].src = sear_off.src;
    }
  } else if (name == "tooltab_img") {
    if (theCurrentTab!="tool") {
      if (state == "over")
        document[name].src = tool_hov.src;
      else
        document[name].src = tool_off.src;
    }
  }
}

