//
// 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

/* *******************************
* Show Submenu
*  **************************** */
function showSub(sub_in){
	var this_sub;
	var v_obj;
	//alert("showing " + sub_in);

	if(sub_in != "subNewz"){
		setDisplay("subNewz", "none");
	}
	if(sub_in != "subMuzik"){
		setDisplay("subMuzik", "none");
	}
	if(sub_in != "subBio"){
		setDisplay("subBio", "none");
	}
	if(sub_in != "subTourz"){
		setDisplay("subTourz", "none");
	}
	if(sub_in != "subStore"){
		setDisplay("subStore", "none");
	}
	if(sub_in != "subPowWow"){
		setDisplay("subPowWow", "none");
	}
	if(sub_in != "subIndiez"){
		setDisplay("subIndiez", "none");
	}
	if(sub_in != "subLinkz"){
		setDisplay("subLinkz", "none");
	}

	setDisplay(sub_in, "");
} // showSub

/* *******************************
* 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

/* *******************************
* Browser Page
*  **************************** */
function browser_page(dest_in) {
	var v_host
	v_host = "http://" + window.location.hostname

	if (version == "e4") {
		if (dest_in == "general_info") {
			return v_host + "/general/general_info.html";
		} else if (dest_in == "what_we_are_about") {
			return v_host + "/what_we_are_about.html";
		}
	} else {
		if (dest_in == "general_info") {
			return v_host + "/general/general_info_alt.html";
		} else if (dest_in == "what_we_are_about") {
			return v_host + "/what_we_are_about_alt.html";
		}
	}
} // browser_page

