//--------------------------------
// Preload images
//--------------------------------

jQuery.preloadImages = function() {
	for(var i = 0; i<arguments.length; i++) {
		jQuery("<img>").attr("src", arguments[i]);
		}
    }

$.preloadImages(
	"../images/bgd-tab-new.jpg",
	"../images/bgd-tab-promo.jpg",
	"../images/bgd-tab-request.jpg",
	"../images/bgd-tab-testim.jpg",
	"../images/bgd-menu.gif"
	);

//--------------------------------
// Prevent flash to load first
//--------------------------------

/* function reWriteFlash() {
	var myHTML = document.getElementById("bgd-flash").innerHTML;
	myHTML = myHTML.replace("<!--","");
	myHTML = myHTML.replace("-->","");
	document.getElementById("bgd-flash").innerHTML = myHTML;
	} */

//--------------------------------
// Fix IE hover state
//--------------------------------

function startList() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}

function clientList() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav-client");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}

//--------------------------------
// Perform functions onload
//--------------------------------

window.onload =  function() {
	// reWriteFlash();
	startList();
	clientList();
	}