// Navigation JavaScript


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


// preloadNavigationImages
function preloadNavigationImages() {
	MM_preloadImages("assets/navigation/tab1_hvr.gif",
					"assets/navigation/tab2_hvr.gif",
					"assets/navigation/tab3_hvr.gif",
					"assets/navigation/tab4_hvr.gif",
					"assets/navigation/tab5_hvr.gif",
					"assets/navigation/tab6_hvr.gif");
}

// preloadButtonImages
function preloadButtonImages() {
	MM_preloadImages("assets/buttons/simple_blue_hvr.gif");
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



imgout=new Image(9,9);
imgin=new Image(9,9);

/////////////////BEGIN USER EDITABLE///////////////////////////////
	imgout.src="assets/icons/instructions_right.gif";
	imgin.src="assets/icons/instructions_down.gif";
///////////////END USER EDITABLE///////////////////////////////////

//this switches expand collapse icons
function filter(imagename,objectsrc){
	if (document.images){
		document.images[imagename].src=eval(objectsrc+".src");
	}
}

//show OR hide funtion depends on if element is shown or hidden
function shoh(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin');			
		} else {
			filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter(("img"+id),'imgin');
			} else {
				filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}


// show/hide table rows
function toggleDetail(id,number) {
	for (i=1;i<=number;i++) {
	  body=document.getElementById(id+i);
	  if (body) {
	  if (body.style.display == 'none') {
		// To make tr tags disappear
		// we set display to none, as usual
		// to make them appear again
		// we set style to block for IE
		// but for firefox we use table-row
		try {
		  body.style.display='table-row';
		} catch(e) {
		  body.style.display = 'block';
		}
	  }
	  else {
		body.style.display = 'none';
	  }
	  }
	}
	}
	
	
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}


/* Created by: Alf Magne Kalleland :: www.dhtmlgoodies.com (C) www.dhtmlgoodies.com, November 2005 */
// highlight currently selected form element

var currentlyActiveInputRef = false;
var currentlyActiveInputClassName = false;

function highlightActiveInput() {
  if(currentlyActiveInputRef) {
    currentlyActiveInputRef.className = currentlyActiveInputClassName;
  }
  currentlyActiveInputClassName = this.className;
  this.className = 'inputHighlighted';
  currentlyActiveInputRef = this;
}

function blurActiveInput() {
  this.className = currentlyActiveInputClassName;
}

function initInputHighlightScript() {
  var tags = ['INPUT','TEXTAREA'];
  for(tagCounter=0;tagCounter<tags.length;tagCounter++){
    var inputs = document.getElementsByTagName(tags[tagCounter]);
    for(var no=0;no<inputs.length;no++){
      if(inputs[no].className && inputs[no].className=='doNotHighlightThisInput')continue;
      if(inputs[no].tagName.toLowerCase()=='textarea' || (inputs[no].tagName.toLowerCase()=='input' && 

inputs[no].type.toLowerCase()=='text' || 'password')){
        inputs[no].onfocus = highlightActiveInput;
        inputs[no].onblur = blurActiveInput;
      }
    }
  }
}





