// System 1 - 2 State Image Buttons
// preload navbar graphics
if (document.images) {
	img1on = new Image(); img1on.src = "images/nav01-over.gif"
	img2on = new Image(); img2on.src = "images/nav02-over.gif"
	img3on = new Image(); img3on.src = "images/nav03-over.gif"
	img4on = new Image(); img4on.src = "images/nav04-over.gif"
	img5on = new Image(); img5on.src = "images/nav05-over.gif"
	img6on = new Image(); img6on.src = "images/nav06-over.gif"
	img7on = new Image(); img7on.src = "images/nav07-over.gif"
	img8on = new Image(); img8on.src = "images/nav08-over.gif"

	img1off = new Image(); img1off.src = "images/nav01.gif"
	img2off = new Image(); img2off.src = "images/nav02.gif"
	img3off = new Image(); img3off.src = "images/nav03.gif"
	img4off = new Image(); img4off.src = "images/nav04.gif"
	img5off = new Image(); img5off.src = "images/nav05.gif"
	img6off = new Image(); img6off.src = "images/nav06.gif"
	img7off = new Image(); img7off.src = "images/nav07.gif"
	img8off = new Image(); img8off.src = "images/nav08.gif"

}

currentStepText="";
currentImageName="";
currentImageID="";

// Function to 'activate' mouse rollover images
// Usage: onMouseOver="imgOn('img1');
function imgOn(imgName) {
	if (document.images) {
		//alert(imgName)
		document[imgName].src = eval(imgName + "on.src");
	}
}

// Function to 'deactivate' mouse rollover images
// Usage: onMouseOut="imgOff('img1');
function imgOff(imgName) {
	if (document.images) {
		//alert(imgName)
		document[imgName].src = eval(imgName + "off.src");
	}
}

// Update left nav frame on main page load
function loadNav(navPage) {
	parent.frames.nav2.location.replace(navPage);
}


// System 2 - 3 State Image Buttons
// preload navbar graphics
if (document.images) {
	navhome=new Image(); navhome.src="images/nav_home.gif"
	navhomeOver=new Image(); navhomeOver.src="images/nav_home_on.gif"
	navhomeStep=new Image(); navhomeStep.src="images/nav_home_step.gif"
}

// RollOver Function
// Usage: onMouseOver=mIn('navhome','navhomeOver');
function mIn(imageID,imageName) {
	document.images[imageID].src = eval(imageName + ".src");
}
// RollOut Function
// Usage: onMouseOut=mOut('navhome','navhome');
function mOut(imageID,imageName) {
	if  ((currentImageID != "") && (currentImageName != "") && (currentImageID == imageID)){
		document.images[currentImageID].src = eval(currentImageName + ".src");
		//document.images[imageID].src = eval(imageName + ".src");
	} else {
		document.images[imageID].src = eval(imageName + ".src");
	}
}

// Nav Description Rollover
// Usage: change('Return to Home');
function change(which){
	if(which==0){
		document.all.navDescription.innerHTML = ""
		if (currentStepText != ""){
			document.all.navDescription.innerHTML = currentStepText
		}
	} else {
		document.all.navDescription.innerHTML = which
	}
}

// Show User Progress
// Usage: userProgress('navhome', 'navhomeOver', 'Current Step: Select Topic');
function userProgress(imageID,imageName,stepText){
	currentStepText = stepText
	currentImageName = imageName
	currentImageID = imageID
	document.images[imageID].src = eval(imageName + ".src");
	document.all.navDescription.innerHTML = currentStepText;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2)
		eval(args[i]+".location='"+args[i+1]+"'");
}

function printPage() { print(document); }
