
function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function change(imageName, newSRC) {
	if (document.images) {
		document[imageName].src = newSRC;
		}
	}

function doImagePreload() {
	preloadImages('/graphics/nav/news.gif','/graphics/nav/bands.gif','/graphics/nav/tours.gif','/graphics/nav/press.gif','/graphics/nav/media.gif','/graphics/nav/releases.gif','/graphics/nav/store.gif','/graphics/nav/board.gif','/graphics/nav/contact.gif','/graphics/nav/hover/news.gif','/graphics/nav/hover/bands.gif','/graphics/nav/hover/tours.gif','/graphics/nav/hover/press.gif','/graphics/nav/hover/media.gif','/graphics/nav/hover/releases.gif','/graphics/nav/hover/store.gif','/graphics/nav/hover/board.gif','/graphics/nav/hover/contact.gif','/graphics/dblnt.gif','/graphics/dblnt_hover.gif');
	}

if (document.images) {
	preload_image_object = new Image();
	image_url = new Array();
	image_url[0] = "/graphics/nav/news.gif";
	image_url[1] = "/graphics/nav/bands.gif";
	image_url[2] = "/graphics/nav/tours.gif";
	image_url[3] = "/graphics/nav/press.gif";
	image_url[4] = "/graphics/nav/media.gif";
	image_url[5] = "/graphics/nav/releases.gif";
	image_url[6] = "/graphics/nav/store.gif";
	image_url[7] = "/graphics/nav/board.gif";
	image_url[8] = "/graphics/nav/contact.gif";
	image_url[9] = "/graphics/nav/hover/news.gif";
	image_url[10] = "/graphics/nav/hover/bands.gif";
	image_url[11] = "/graphics/nav/hover/tours.gif";
	image_url[12] = "/graphics/nav/hover/press.gif";
	image_url[13] = "/graphics/nav/hover/media.gif";
	image_url[14] = "/graphics/nav/hover/releases.gif";
	image_url[15] = "/graphics/nav/hover/store.gif";
	image_url[16] = "/graphics/nav/hover/board.gif";
	image_url[17] = "/graphics/nav/hover/contact.gif";
	image_url[18] = "/graphics/dblnt.gif";
	image_url[19] = "/graphics/dblnt_hover.gif";
	
	var i = 0;
	for(i=0; i<=17; i++) 
		preload_image_object.src = image_url[i];
	}





// F. Permadi 2005.
// Highlights table row
// Copyright (C) F. Permadi
// This code is provided "as is" and without warranty of any kind.  Use at your own risk.



// These variables are for saving the original background colors
var savedStates=new Array();
var savedStateCount=0;

/////////////////////////////////////////////////////
// This function takes an element as a parameter and 
//   returns an object which contain the saved state
//   of the element's background color.
/////////////////////////////////////////////////////
function saveBackgroundStyle(myElement)
{
  saved=new Object();
  saved.element=myElement;
  saved.className=myElement.className;
  saved.backgroundColor=myElement.style["backgroundColor"];
  return saved;   
}

/////////////////////////////////////////////////////
// This function takes an element as a parameter and 
//   returns an object which contain the saved state
//   of the element's background color.
/////////////////////////////////////////////////////
function restoreBackgroundStyle(savedState)
{
  savedState.element.style["backgroundColor"]=savedState.backgroundColor;
  savedState.element.style["color"]='#000000';
  
  
	if(   savedState.element.childNodes[0].childNodes[0] ) {
	  if( savedState.element.childNodes[0].childNodes[0].tagName == 'A' ) {
		  savedState.element.childNodes[0].childNodes[0].className = 'normalLink';
	  }
	}

if (savedState.className)
  {
    savedState.element.className=savedState.className;    
  }
}

/////////////////////////////////////////////////////
// This function is used by highlightTableRow() to find table cells (TD) node
/////////////////////////////////////////////////////
function findNode(startingNode, tagName)
{
  // on Firefox, the TD node might not be the firstChild node of the TR node
  myElement=startingNode;
  var i=0;
  while (myElement && (!myElement.tagName || (myElement.tagName && myElement.tagName!=tagName)))
  {
    myElement=startingNode.childNodes[i];
    i++;
  }  
  if (myElement && myElement.tagName && myElement.tagName==tagName)
  {
    return myElement;
  }
  // on IE, the TD node might be the firstChild node of the TR node  
  else if (startingNode.firstChild)
    return findNode(startingNode.firstChild, tagName);
  return 0;
}

/////////////////////////////////////////////////////
// Highlight table row.
// newElement could be any element nested inside the table
// highlightColor is the color of the highlight
/////////////////////////////////////////////////////
function highlightTableRow(myElement, highlightColor)
{
  var i=0;
  // Restore color of the previously highlighted row
  for (i; i<savedStateCount; i++)
  {
    restoreBackgroundStyle(savedStates[i]);          
  }
  savedStateCount=0;

  // To get the node to the row (ie: the <TR> element), 
  // we need to traverse the parent nodes until we get a row element (TR)
  // Netscape has a weird node (if the mouse is over a text object, then there's no tagName
  while (myElement && ((myElement.tagName && myElement.tagName!="TR") || !myElement.tagName))
  {
    myElement=myElement.parentNode;
  }

  // If you don't want a particular row to be highlighted, set it's id to "header"
  // If you don't want a particular row to be highlighted, set it's id to "header"
  if (!myElement || (myElement && myElement.id && myElement.id=="header") )
    return;
		  
  // Highlight every cell on the row
  if (myElement)
  {
    var tableRow=myElement;
    
    // Save the backgroundColor style OR the style class of the row (if defined)
    if (tableRow)
    {
	  savedStates[savedStateCount]=saveBackgroundStyle(tableRow);
      savedStateCount++;
    }

    // myElement is a <TR>, then find the first TD
    var tableCell=findNode(myElement, "TD");    

    var i=0;
    // Loop through every sibling (a sibling of a cell should be a cell)
    // We then highlight every siblings
    while (tableCell)
    {
      // Make sure it's actually a cell (a TD)
      if (tableCell.tagName=="TD")
      {
        // If no style has been assigned, assign it, otherwise Netscape will 
        // behave weird.
        if (!tableCell.style)
        {
          tableCell.style={};
        }
        else
        {
          savedStates[savedStateCount]=saveBackgroundStyle(tableCell);        
          savedStateCount++;
        }
        // Assign the highlight color
        tableCell.style["backgroundColor"]=highlightColor;

        // Optional: alter cursor
        tableCell.style.cursor='default';
        i++;
      }
      // Go to the next cell in the row
      tableCell=tableCell.nextSibling;
    }
  }
}

/////////////////////////////////////////////////////
// This function is to be assigned to a <table> mouse event handler.
// If the element that fired the event is within a table row,
//   this function will highlight the row.
/////////////////////////////////////////////////////
function trackTableHighlight(mEvent, highlightColor)
{
  if (!mEvent)
    mEvent=window.event;
		
  // Internet Explorer
  if (mEvent.srcElement)
  {
    highlightTableRow( mEvent.srcElement, highlightColor);
  }
  // Netscape and Firefox
  else if (mEvent.target)
  {
    highlightTableRow( mEvent.target, highlightColor);		
  }
}

/////////////////////////////////////////////////////
// Highlight table row.
// newElement could be any element nested inside the table
// highlightColor is the color of the highlight
/////////////////////////////////////////////////////
function highlightTableRowVersionA(myElement, highlightColor)
{
  var i=0;
  // Restore color of the previously highlighted row
  for (i; i<savedStateCount; i++)
  {
    restoreBackgroundStyle(savedStates[i]);          
  }
  savedStateCount=0;

  // If you don't want a particular row to be highlighted, set it's id to "header"
  if (!myElement || (myElement && myElement.id && myElement.id=="header") )
    return;
		  
  // Highlight every cell on the row
  if (myElement)
  {
    var tableRow=myElement;
    
    // Save the backgroundColor style OR the style class of the row (if defined)
    if (tableRow)
    {
	  savedStates[savedStateCount]=saveBackgroundStyle(tableRow);
      savedStateCount++;
    }

    // myElement is a <TR>, then find the first TD
    var tableCell=findNode(myElement, "TD");    

    var i=0;
    // Loop through every sibling (a sibling of a cell should be a cell)
    // We then highlight every siblings
    while (tableCell)
    {
      // Make sure it's actually a cell (a TD)
      if (tableCell.tagName=="TD")
      {
        // If no style has been assigned, assign it, otherwise Netscape will 
        // behave weird.
        if (!tableCell.style)
        {
          tableCell.style={};
        }
        else
        {
          savedStates[savedStateCount]=saveBackgroundStyle(tableCell);        
          savedStateCount++;
        }
        // Assign the highlight color
        tableCell.style["backgroundColor"]=highlightColor;
        tableCell.style["color"]='#ffffff';

		if( tableCell.childNodes[0].childNodes[0] != null ) {
			if( tableCell.childNodes[0].childNodes[0].tagName == 'A' ) {
				tableCell.childNodes[0].childNodes[0].className = 'resultsLink';
			}
		}

        // Optional: alter cursor
        tableCell.style.cursor='default';
        i++;
      }
      // Go to the next cell in the row
      tableCell=tableCell.nextSibling;
    }
  }
}
