// gM main content JS functions
//
function showsub() {
	document.getElementById("content").style.top = "-180px";
	document.getElementById("subnav").style.display = "block";
}
function hidesub() {
	document.getElementById("content").style.top = "-200px";
	document.getElementById("subnav").style.display = "none";
}
function hshowsub() {
	document.getElementById("hspacefix").style.display = "block";
	document.getElementById("subnav").style.display = "block";
}
function hhidesub() {
	document.getElementById("hspacefix").style.display = "none";
	document.getElementById("subnav").style.display = "none";
}

// Bio pic hovers for IE
//
function overg()
{
	document.getElementById("bioimgg").style.background = "url(/images/gM_on.jpg) no-repeat center #000";
}
function overj()
{
	document.getElementById("bioimgj").style.background = "url(/images/jK_on.jpg) no-repeat center #000";
}
function outg()
{
	document.getElementById("bioimgg").style.background = "url(/images/gM_off.jpg) no-repeat center #444";
}
function outj()
{
	document.getElementById("bioimgj").style.background = "url(/images/jK_off.jpg) no-repeat center #444";
}

// AutoScroller to top
//
function backToTop() {
    var x1 = x2 = x3 = 0;
    var y1 = y2 = y3 = 0;

    if (document.documentElement) {
        x1 = document.documentElement.scrollLeft || 0;
        y1 = document.documentElement.scrollTop || 0;
    }

    if (document.body) {
        x2 = document.body.scrollLeft || 0;
        y2 = document.body.scrollTop || 0;
    }

    x3 = window.scrollX || 0;
    y3 = window.scrollY || 0;

    var x = Math.max(x1, Math.max(x2, x3));
    var y = Math.max(y1, Math.max(y2, y3));

    window.scrollTo(Math.floor(x / 1.3), Math.floor(y / 1.3));

    if (x > 0 || y > 0) {
        window.setTimeout("backToTop()", 25);
    }
}

// Javascript getElementsByStyleClass
//
function getElementsByClassName(oElm, strTagName, strClassName){
var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
	    var arrReturnElements = new Array();
	    strClassName = strClassName.replace(/\-/g, "\\-");
	    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	    var oElement;
	    for(var i=0; i<arrElements.length; i++){
	        oElement = arrElements[i];
	        if(oRegExp.test(oElement.className)){
	            arrReturnElements.push(oElement);
	        }
	    }
	    return (arrReturnElements)
	}


// Javascript Open in New Window
//
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

// Javascript Reflection.js
//
function wetfloor() {
	Reflection.add(document.getElementById("hexorb1"), { height: 1/2, opacity: 1/5 });
	Reflection.add(document.getElementById("hexorb2"), { height: 1/2, opacity: 1/5 });
	Reflection.add(document.getElementById("hexorb3"), { height: 1/2, opacity: 1/5 });
	Reflection.add(document.getElementById("rssfooticon"), { height: 1/2, opacity: 1/5 });
}
function hwetfloor() {
	Reflection.add(document.getElementById("rssfooticon"), { height: 1/2, opacity: 1/5 });
	Reflection.add(document.getElementById("thumbgif"), { height: 1/4, opacity: 0.3 });
}