var W3CDOM = (document.createElement && document.getElementsByTagName);
var mouseOvers = new Array();
var mouseOuts = new Array();
var totalImages = 0;
var minPageHeight = 600;

// handles button rollovers

function initRollover(navStrName) {
	if (!W3CDOM) return;
	
	var nav = document.getElementById(navStrName);
	var imgs = nav.getElementsByTagName('img');

  for (i=0;i<imgs.length;i++)	{

 		imgs[i].onmouseover = mouseGoesOver;
		imgs[i].onmouseout = mouseGoesOut;
		var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
		mouseOuts[totalImages] = new Image();
		mouseOuts[totalImages].src = imgs[i].src;
		mouseOvers[totalImages] = new Image();
		mouseOvers[totalImages].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "_r" + suffix;
		imgs[i].number = totalImages;
		
		totalImages++;
	}
	
}

function mouseGoesOver(){
	this.src = mouseOvers[this.number].src;
}

function mouseGoesOut(){
	this.src = mouseOuts[this.number].src;
}

// Fixes Page Layout and adjust Footer to be at real bottom of page based
// based on actual content hieght
	
function setPageHeight(divArray, bottomDivStr){
	var W3CDOM = (document.createElement && document.getElementsByTagName);
	if (!W3CDOM) return;
	var elm;
	var divHeight;
	
 for (i=0;i<divArray.length;i++)	{
		elm=document.getElementById(divArray[i]);
		if(elm.offsetHeight){ 
			divHeight=elm.offsetHeight; 					
  	} else if(elm.style.pixelHeight){ 
  	  divHeight=elm.style.pixelHeight;					 
  	} 
  	if (isNaN(divHeight)) {
  		divHeight = 0;
  	} 

		// add buffer for main header area 
 		divHeight = divHeight + 115;
  	// calculate maximum height 
  	minPageHeight=Math.max(minPageHeight,divHeight); 

 }

  	 
 for (x=0;x<divArray.length;x++)	{
		elm=document.getElementById(divArray[x]);
		elm.style.height = minPageHeight + "px";
 }
 elm=document.getElementById(bottomDivStr);	
 elm.style.top = minPageHeight + 70;	
 }
		
	
	
// Fixes Objects for Microsoft "Click to Activate issue"

function activateObjects() {

	if (!W3CDOM) return;
	theObjects = document.getElementsByTagName("object");
	for (var i = 0; i < theObjects.length; i++) {
		theObjects[i].outerHTML = theObjects[i].outerHTML;
	}
}


function setPageHeight_OLD(divArray, bottomDivStr){
	var W3CDOM = (document.createElement && document.getElementsByTagName);
	if (!W3CDOM) return;
	var elm;
	var maxheight = 600;
	
 for (i=0;i<divArray.length;i++)	{

	elm=document.getElementById(divArray[i]);

	if ( (elm.offsetHeight > maxheight) && (elm.offsetHeight > 600) ) {
 		maxheight = elm.offsetHeight + 125;
	}
 }


 for (i=0;i<divArray.length;i++)	{
  var elm = document.getElementById(divArray[i]);
  elm.style.Height = "auto";
 	elm.style.Height = maxheight + "px";
 }
 
 elm=document.getElementById(bottomDivStr);	
 elm.style.top = maxheight;	
 

}
	
function styleTable(id){
		var bgcolor = 'E0E0E0';
		var table = document.getElementById(id).getElementsByTagName("TBODY")[0];
		table.width = '575px' ; // spreads out the table if you want it to
		table.style.borderStyle  = 'solid';
		table.style.borderColor ='#ffffff';
		table.style.fontFamily = 'verdana';
		table.style.fontSize = '10px';
		table.rows[0].bgColor = '280C17' ; 
		table.rows[0].style.color = 'ffffff' ; 

		var count=1;

 		for (i=1; i < table.rows.length; i++) {
			table.rows[i].bgColor = (i % 2 ? '' : bgcolor) ;
			if ((i % 2) == 0) {
		 		for (j=0; j < table.rows[i].cells.length; j++) {
      		table.rows[i].cells[j].style.borderTopColor = '333333' ; 
					table.rows[i].cells[j].style.borderTopStyle  = 'solid';
					table.rows[i].cells[j].style.borderTopWidth  = '1';
      		table.rows[i].cells[j].style.borderBottomColor = '333333' ; 
					table.rows[i].cells[j].style.borderBottomStyle  = 'solid';
					table.rows[i].cells[j].style.borderBottomWidth  = '1';
     		}
      }
		}
		
		table.style.visibility="visible"; 
		
}
