/* 
JavaScript Library.
by the Edge Design Web Team for Edge

Commented code is for multiple stays, if needed.
*/

var last_image;
var last_name;
var nav_stay = new Array();

function gotoHome() {
  window.close();
}

// Image roll-over
// Use: roll('image_name','roll_over_path'); 
function roll(img_name, roll_to) {
	if (document.images) {
		for (var i=0; i<nav_stay.length; i++) {
			if (img_name == nav_stay[i]) {
				return;
			}
		}

		var obj = eval('document.' + img_name);
		last_image = obj.src;
		last_name = img_name;
		obj.src = roll_to;
	}
}

// Always use with roll()
// Use: roll_restore();
function roll_restore() {
	if (last_image) {
		var flip_back = eval('document.' + last_name);
		flip_back.src = last_image;
	}
}
		
// Forces an image to stay rolled-over
// Use: stay('image_name','roll_over_path);
function stay(img_name, stay_url) {
	if (document.images) {
		nav_stay[counter++] = img_name;
		var tmp = eval('document.' + img_name);
		tmp.src = stay_url;
	}
}

// Preloads images
// Use: preload('path_to_image','path_to_image',...etc);
function preload() {
	if (document.images) {
		var img = preload.arguments;
		var tmp = new Array(img.length);
		for (var i=0; i<tmp.length; i++) {
			tmp[i] = new Image;
			tmp[i].src = img[i];
		}
	}
}
// Automatic redirect from a pull-down
// Use: launch(this)
function launch(current) {
	var index = current.selectedIndex;
	var select_name = current.name;
	var form_name = current.form.name;
	var pull = eval('document.'+form_name+'.'+select_name);
	if (pull.options[index].value != '#') {
		window.location = pull.options[index].value;
		return;
	}
	return;
}

function getValue(elm) {
 var url = window.location + '&';
 var regex = new RegExp ( elm + "=([^&]+)","i" );
 var theValue = regex.exec(url);
 if ( theValue ) {
  var temp = theValue[1].replace( /\+/g, " " );
  theValue[1] = unescape(temp);
  return(theValue[1]);
 }
 else { return(' '); }
}

function openWin(url,width,height,name) {
 if (!width) { width = 425; }
 if (!height) { height = 400; }
 if (!name) { name = 'help'; }
 if ( is_ie5 && is_mac ) {
   width -= 16;
   height -= 16;
 }
 open(url,name,'screenX=50,screenY=50,width='+width+',height='+height).focus();
}
//
// Code for handling CSS across different browsers.
// This code borrows from HP.com SNF2 JS library
//
// PLH - Edge Design
//

// convert all characters to lowercase to simplify testing 
var agt=navigator.userAgent.toLowerCase(); 

// *** BROWSER VERSION *** 
// Note: On IE5, these return 4, so use is_ie5up to detect IE5. 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 

// *** BROWSER TYPE *** 
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
            && (agt.indexOf('webtv')==-1));
var is_nav4up = (is_nav && (is_major >= 4));
var is_nav6 = (is_nav && ( is_major >= 5));
var is_ie   = (agt.indexOf("msie") != -1); 
var is_ie3  = (is_ie && (is_major < 4)); 
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) );
var is_ie4up  = (is_ie  && (is_major >= 4));
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")!=-1) );  
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);  

// *** PLATFORM ***
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1);

// Handle Navigator 4 window resizing
if (is_nav4up) {
   var initWidth, initHeight;
   initWidth = window.innerWidth;
   initHeight = window.innerHeight;
   window.captureEvents(Event.RESIZE);
   window.onresize = handleResize;
}

// Function to handle window resizing on Navigator 4
function handleResize() {
   if (((initWidth != window.innerWidth) || (initHeight != window.innerHeight)) && (typeof disableReload == "undefined")) {
     location.reload();
   }
   return false;
}

// Function to navigate to link from dropdown menu select


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

