//
// Detect browser type and version
//
var browserName = navigator.appName;
var browserVer = parseInt( navigator.appVersion );
var version = "";

if (browserName == "Netscape" && browserVer >= 4 )
	version = "n4"
else if ( browserName == "Netscape" && browserVer >= 3 && browserVer < 4 )
	version = "n3";
else if ( browserName == "Netscape" && browserVer >= 2 && browserVer <3)
	version = "n2";
else if ( browserName == "Microsoft Internet Explorer" && browserVer >= 4 )
	version = "e4";
else if ( browserName == "Microsoft Internet Explorer" && browserVer >= 2 )
	version = "e3";
else
	version = "other";

/* *******************************
* Image Activate
*  **************************** */
function img_act(imgName) {
	if (document.images != null) {
		if ( version == "n3" || version == "e4" || version == "n4" ) {
			imgOn = eval(imgName + "on.src");
			document [imgName].src = imgOn;
		}
	}
} // img_act

/* *******************************
* Image Inactivate
*  **************************** */
function img_inact(imgName) {
	if (document.images != null) {
		imgOn = eval(imgName + "off.src");
		document [imgName].src = imgOn;
	}
} // img_inact

/* *******************************
* Do Resource
*  **************************** */
function doResource(res){
	var rv, rh, vis;

	eval("rv = " + res + "V");
	eval("rh = " + res + "H");
	if(version == "e3" || version == "e4"){
		if(rh.style.display != ""){
			rh.style.display = "";
			rv.style.display = "none";
			vis = "0";
		} else {
			rh.style.display = "none";
			rv.style.display = "";
			vis = "1";
		}
	}
} // doResource

/* *******************************
* Set Display
*  **************************** */
function setDisplay(obj_in, disp_in) {

	//alert("setting " + obj_in + " to " + disp_in);
	var v_obj;
	v_obj = document.getElementById(obj_in);
	v_obj.style.display = disp_in;

} // setDisplay

/* *******************************
* Open Panel
*  **************************** */
function open_panel(location_in, height_in, width_in) {
	var v_height, v_width, v_details;

	if (isNaN(height_in)) {
		v_height = 510;
	} else {
		v_height = height_in;
	}
	if (isNaN(width_in)) {
		v_width = 405
	} else {
		v_width = width_in;
	}
	v_details = "toolbar=no,directories=no,statusbar=no,personalbar=no,menubar=no,scrollbars=yes,resizable=yes,width=" + v_width + ",height=" + v_height;
	window.open(location_in, "win_help", v_details);
} // open_panel

/* *******************************
* Flip Image
*  **************************** */
function flipImage(url_in) {
    if (window.event.srcElement.tagName == "IMG" ) {
        window.event.srcElement.src = url_in;
    }
} // flipImage

/* *******************************
* Write If Explorer 4
*  **************************** */
function write_if_e4(write_string_in) {
	if (version == "e4") {
		document.write(write_string_in);
	} else {
		document.write("&nbsp;");
	}
} // write_if_e4

/* *******************************
* MailPage
*  **************************** */
function mailpage() {
	mail_str = "mailto:?subject=Check out the " + document.title;
	mail_str += "&body=You might be interested in " + document.title;
	mail_str += ". You can view this page at " + location.href + ".";
	location.href = mail_str;
}
