// SHOW & HIDE LAYERS

/*
  This code is from Dynamic Web Coding 
  at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  Permission granted to use this code 
  as long as this entire notice is included.
*/

// resize fix for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

// get reference to nested layer for ns4
// from old dhtmllib.js by Mike Hall of www.brainjar.com
function getLyrRef(lyr,doc) {
	if (document.layers) {
		var theLyr;
		for (var i=0; i<doc.layers.length; i++) {
	  	theLyr = doc.layers[i];
			if (theLyr.name == lyr) return theLyr;
			else if (theLyr.document.layers.length > 0) 
	    	if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
					return theLyr;
	  }
		return null;
  }
}
 
// PLAYER WINDOW

var theHeight;
var theWidth;
var theTop;
var theLeft;
var features;

function winOpen1(url,name) {
		if (screen.width<=640){
		  	theWidth=600;
  		} else {
  		theWidth=.8*screen.width;
  		}
//	theHeight=.73*theWidth;
	theHeight=.615*theWidth + 65;
	theTop=(screen.height/2)-(theHeight/2);
	theLeft=(screen.width/2)-(theWidth/2);  	
	features='height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft+',resizable';
	window.open(url,name,features);
}

function winOpen2(url,name,w,h,f) {
	theTop=(screen.height/2)-(h/2);
	theLeft=(screen.width/2)-(w/2);  	
	features='height='+h+',width='+w+',top='+theTop+',left='+theLeft+','+f;
	window.open(url,name,features);
}	

// ROLLOVER

enter_on=new Image;
enter_on.src="images/enter-on.jpg";
enter_off=new Image;
enter_off.src="images/enter-off.jpg";

function rollIn(imgName, picName){
   document[imgName].src=eval(picName + "on.src");
}

function rollOut(imgName, picName){
   document[imgName].src=eval(picName + "off.src");
}

// SWAPOLA

function toggle(which) {
	with ((window.menu)||(window.start)) {

//	with (document) {


		var	x = getElementsByTagName('div') ;
		var	y = new Array(2) ;
		var	z ;
		var	j = x.length ;
		for (var i=0; i < j; i++) {
			z = x[i].id ;
			with (x[i].id) {
				if (length > 3) {
					y[0] = slice(length-2) ;
					y[1] = slice(length-3) ;
					with (x[i]) {
						if (y[0] == 'on') {
							(z == which+'on') ? style.display = 'block' : style.display = 'none' ;
						} else { 
							if (y[1] == 'off') {
								style.display = 'block';
								(z == which+'off') ? style.display = 'none' : style.display = 'block' ;
}	}	}	}	}	}	}	}

function useless() {
/*
   document.getElementById('introon').style.display = 'none';
   document.getElementById('targeton').style.display = 'none';
   document.getElementById('rationaleon').style.display = 'none';
   document.getElementById('objectiveson').style.display = 'none';
   document.getElementById('facultyon').style.display = 'none';
   document.getElementById('ceon').style.display = 'none';
   document.getElementById('proddisclosureon').style.display = 'none';
   document.getElementById('disclaimeron').style.display = 'none';
   document.getElementById('helpon').style.display = 'none';
   document.getElementById('privacyon').style.display = 'none';
   document.getElementById('referenceson').style.display = 'none';

   document.getElementById('introoff').style.display = 'block';
   document.getElementById('targetoff').style.display = 'block';
   document.getElementById('rationaleoff').style.display = 'block';
   document.getElementById('objectivesoff').style.display = 'block';
   document.getElementById('facultyoff').style.display = 'block';
   document.getElementById('ceoff').style.display = 'block';
   document.getElementById('proddisclosureoff').style.display = 'block';
   document.getElementById('disclaimeroff').style.display = 'block';
   document.getElementById('helpoff').style.display = 'block';
   document.getElementById('privacyoff').style.display = 'block';
   document.getElementById('referencesoff').style.display = 'block';
   document.getElementById(which+'off').style.display = 'none';
   document.getElementById(which+'on').style.display = 'block';
*/

}
