var target;
var target2;
var tID;
var tID2;
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function graph_DoFSCommand(command, args) {
	var graphObj = isInternetExplorer ? document.all.graph : document.graph;
	if (command == "banner") {
		setTimeout("document.getElementById('banner').style.overflow = '"+args+"'",1);
	}
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub graph_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call graph_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight)=='number') {
		windowHeight = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function fillWindow() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var pageElement = document.getElementById('main');
			var pageHeight = pageElement.offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight = footerElement.offsetHeight;
			if (windowHeight >= pageHeight + footerHeight) {
				pageElement.style.height = (windowHeight-footerHeight)+'px';
			} else {
				pageElement.style.height = "";
			}
		}
	}
}

window.onload = function() {
	fillWindow();
	if (document.getElementById) {
		var inputs = document.getElementsByTagName("input");
		for (var q=0; q<inputs.length; q++) {
			var e = inputs[q];
			if (e.type == "checkbox" || e.type == "radio") {
				e.style.border = "none";
			} else if (e.type == "button" || e.type == "submit" || e.type == "reset") {
				e.className = "button";
			}
		}
		if (document.getElementById("pollFrame") && document.all) {
			var iframe = document.getElementById("pollFrame");
			var inputs = iframe.document.getElementsByTagName("input");
			for (var q=0; q<inputs.length; q++) {
				var e = inputs[q];
				if (e.type == "checkbox" || e.type == "radio") {
					e.style.border = "none";
				} else if (e.type == "button" || e.type == "submit" || e.type == "reset") {
					e.className = "button";
				}
			}
		}
		volumes = document.getElementById("emVolumes");
		for (var i=0; i<volumes.childNodes.length; i++) {
			node = volumes.childNodes[i];
			if (node.nodeName == "LI") {
				for (var o=0; o<node.childNodes.length; o++) {
					if (node.childNodes[o].nodeName == "OL") {
						for (var c=0; c<node.childNodes[o].childNodes.length; c++) {
							n = node.childNodes[o].childNodes[c];
							if (n.nodeName == "LI") {
								n.onmouseover = function() {
									this.className = "over";
									clearTimeout(tID2);
									with (this.parentNode) {
										for (var d=0; d<childNodes.length; d++) {
											if (childNodes[d].nodeName=="LI" && childNodes[d] != this) {
												childNodes[d].className = "";
											}
										}
									}
								}
								n.onmouseout = function() {
									target2 = this;
									tID2 = setTimeout("target2.className = ''",500);
								}
							}
						}
					}
				}
				node.onmouseover = function() {
					this.className = "over";
					clearTimeout(tID);
					with (this.parentNode) {
						for (var d=0; d<childNodes.length; d++) {
							if (childNodes[d].nodeName=="LI" && childNodes[d] != this) {
								childNodes[d].className = "";
							}
						}
					}
				}
	  			node.onmouseout = function() {
					target = this;
	  				tID = setTimeout("target.className = ''",500);
				}
			}
		}
	}
}
window.onresize=fillWindow;
