// THIS CODE was mutated, modified, and re-done by the K10k/virusone » semi-bald posse
// THIS CODE has parts based on the excellent work by Dan Steinman
// THIS CODE was done in 1997-2001

// ----------------------------------------------------------------------

// check client browser & platform
// call browserNaming(); whenever you need to use the browser version
//
// original code from http://developer.apple.com/internet/_javascript/

	var its;
	var browserName;
	var browserNameLong;
	var browserNew;
	var preloadFlag = false;
	var Macintosh = navigator.userAgent.indexOf('Mac')>0;

	function its() {
		var n = navigator;
		var ua = ' ' + n.userAgent.toLowerCase();
		var pl = n.platform.toLowerCase();
		var an = n.appName.toLowerCase();

		// browser version
		this.version = n.appVersion;
		this.nn = ua.indexOf('mozilla') > 0;

		// 'compatible' versions of mozilla aren't navigator
		if(ua.indexOf('compatible') > 0) {
			this.nn = false;
		}
		
		this.opera = ua.indexOf('opera') > 0;
		this.ie = ua.indexOf('msie') > 0;
		this.major = parseInt( this.version );
		this.minor = parseFloat( this.version );

		// platform
		this.mac = ua.indexOf('mac') > 0;
		this.win = ua.indexOf('win') > 0;

		// workaround for IE5 which reports itself as version 4.0
		if(this.ie) {
			if(ua.indexOf("msie 5") > 1) {
			var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
			this.major = parseFloat(navigator.appVersion.substr(msieIndex,3));
			}
		}

		return this;
	}

	function browserNaming() {
		its = new its();
		
		// is it a DOM-enabled browser?
		if (!document.getElementById) {
			browserNew = false;
		}
		else {
			browserNew = true;
		}

		// need the name, too
		if (its.opera) {
			browserName = "Opera";
		}
		else if (its.ie) {
			browserName = "IE";
		}
		else {
			browserName = "NS";
		}

		// and the number
		browserNameLong = browserName + its.major;
	
	}
	
	// we might as well pick up the variables here


// creating the mouseovers
// you need the preload function as well, but that should be placed straight on the page
// call it like this : window.onload = preloadMe;

//	function preloadMe() {
//		createObject('cellularmanoff','images/specfeature_celluar_off.gif');
//		createObject('cellularmanon','images/specfeature_celluar_on.gif');
//		etc
//		preloadFlag = true;
//	}

	function createObject(imgName,imgSrc) {
		if (browserNew && (browserName == "NS")) {
		// a DOM-compatible browser
		// which is probably NS6/mozilla (the other code works better in IE/Opera)
			var tempImg = document.createElement("img");
			tempImg.src = imgSrc;
			tempImg.id = imgName;
			tempImg.style.visibility = 'hidden';
			tempImg.style.position = 'absolute';
			tempImg.style.top = 0;
			document.body.appendChild(tempImg);
		}
		else {
		// a non-DOM-compatible browser
		// and IE/Opera
			eval(imgName+' = new Image()');
			eval(imgName+'.src = "'+imgSrc+'"');
		}
	}

// doing the actual mouseover

	function changeImage(layer,imgName,imgObj) {
		if (preloadFlag) {
			if (browserNew && (browserName == "NS")) {
			// a DOM-compatible browser
			// which is probably NS6/mozilla (the other code works better in IE/Opera)
				thisImage = document.getElementById(imgName);
				newImage = document.getElementById(imgObj);
				newSrc = newImage.getAttribute("src");
				thisImage.setAttribute("src",newSrc);
			}
			else {
			// a non-DOM-compatible browser
			// and IE/Opera
				if ((browserName == "NS") && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
				else document.images[imgName].src = eval(imgObj+".src")
			}
		}
	}

// the modified popup window function
// if you have a statusbar on a window, IE4 on the macintosh makes the window 17 pixels too small
// this popup function solves that problem

	function spawn(desktopURL,windowName,width,height) {
 		if (Macintosh) {
 			if (browserNameLong == "IE4") {
				newheight = parseInt(height + 17);
			}
			else if (browserNameLong == "IE4.5") {
				newheight = parseInt(height + 17);
			}
			else {
				newheight = height;
			}
 		}
 		else { newheight = height; }	
 		window.open(desktopURL, windowName, "toolbar=no,location=no,status=yes,menubar=no,scrollbars=auto,width="+width+",height="+newheight+",resizable=no" );
	}

// the modified popup window function
// if you have a statusbar on a window, IE4 on the macintosh makes the window 17 pixels too small
// this popup function solves that problem

	function spawn2(desktopURL,windowName,width,height) {
 		if (Macintosh) {
 			if (browserNameLong == "IE4") {
				newheight = parseInt(height + 17);
			}
			else if (browserNameLong == "IE4.5") {
				newheight = parseInt(height + 17);
			}
			else {
				newheight = height;
			}
 		}
 		else { newheight = height; }	
 		window.open(desktopURL, windowName, "toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=auto,width="+width+",height="+newheight+",resizable=yes" );
	}
	
// the modified popup window function
// if you have a statusbar on a window, IE4 on the macintosh makes the window 17 pixels too small
// this popup function solves that problem

	function printwindow(desktopURL,windowName,width,height) {
 		if (Macintosh) {
 			if (browserNameLong == "IE4") {
				newheight = parseInt(height + 17);
			}
			else if (browserNameLong == "IE4.5") {
				newheight = parseInt(height + 17);
			}
			else {
				newheight = height;
			}
 		}
 		else { newheight = height; }	
 		window.open(desktopURL, windowName, "toolbar=no,location=no,status=yes,menubar=yes,scrollbars=no,width="+width+",height="+newheight+",resizable=no" );
	}


// DOM / GET PROPERTY
// original code from http://www.alistapart.com/
//
// NOTES:	given an id and a property (as strings), return the given property of that id.
// WORKS:	ie5+, ns6+, opera5+

	function getIdProperty(id,property) {
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
				if (styleObject[property]) {
					return styleObject[ property ];
				}
			}
		return (styleObject != null) ?
		styleObject[property] :
		null;
	}


// DOM / SET PROPERTY
// original code from http://www.alistapart.com/
//
// NOTES:	given an id and a property (as strings), set the given property of that id to the value provided.
// WORKS:	ie5+, ns6+, opera5+

	function setIdProperty(id,property,value) {
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
			styleObject[ property ] = value;
		}
	}


	
// removes the link border in IE and NS6
// original code by evil@chelu.ro. thanks, chris!

	function unblur() {
		this.blur();
	}

	function getLinksToBlur() {
		if (!document.getElementById) return
		links = document.getElementsByTagName("a");
		for(i=0; i<links.length; i++) {
			links[i].onfocus = unblur
		}
	}
	

	function hide(id) {
		if (browserNew) {
			setIdProperty(id,"visibility","hidden");
		}
		else {
			if (browserName == "NS") { document.layers[id].visibility = "hide"; }
			else { document.all[id].style.visibility = "hidden"; }
		}
	}

	function show(id) {
		if (browserNew) {
			setIdProperty(id,"visibility","visible");
		}
		else {
			if (browserName == "NS") { document.layers[id].visibility = "show"; }
			else { document.all[id].style.visibility = "visible"; }
		}
	}
    
function doHop(pagename) {
    var pageValue = document.hopper.hop.options[document.hopper.hop.selectedIndex].value;
    document.location = pagename + "?currPage=" + pageValue;
}

function goBack(formID, action) {
    
    document.forms[formID].op.value = "edit";
    document.forms[formID].action = action;
    document.forms[formID].submit();
}

//creates a jump-menu
//original code by ??, mods by greg@417north.com	

	function buildArray() {
				
	  	var a = buildArray.arguments;
	  	for (i=0; i<a.length; i++) {
			this[i] = a[i];
	  	}
	  	this.length = a.length;
	}
	
	function go(which, num, win) {
	    n = which.selectedIndex;
	    if (n != 0) {
		  var url = eval("urls" + num + "[n]")
		  if (win) {
		    openWindow(url);
		 } else {
		    location.href = url;
		 }
	   }  
	}
				