function testify() {
	var rndm = Math.floor(Math.random()*3);
	var tArray = new Array("Lorem ipsum dolor sit amet...|Some Roman Guy",
							"I\'ll be cheering you on!|Graham Hosie",
							"What tree?|Mark Bolan");
	var theTarget = document.getElementById("testify");
	var testimonySplit = tArray[rndm].split("|");
	var theQuote = "<blockquote>" + testimonySplit[0] + "</blockquote><p>- " + testimonySplit[1] + "</p>";
	
	theTarget.innerHTML = theQuote;
}

function spawn(loc) {
	var winName = "metrix";
	var theWidth = screen.width - 32;
	var theHeight = screen.height - 96;
	var top = 16;
	var left = 16;
	var winProps = "top=" + top  + ", left=" + left + ", width=" + theWidth + ", height=" + theHeight + ", toolbar=Yes, location=no, directories=no, menubar=no, scrollbars=yes, status=yes";
	var newWin = window.open(loc, winName, winProps);
	newWin.focus();
}

function toggle(incomingId) {
	theThing = document.getElementById(incomingId);
	theThing.style.display = (theThing.style.display == "block") ? "none" : "block";
}	
function getElementsByClassName(oElm, strTagName, oClassNames) {
    var arrElements = (strTagName == "*" && document.all)? document.all : 
    oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    var arrRegExpClassNames = new Array();
    if(typeof oClassNames == "object"){
        for(var i=0; i<oClassNames.length; i++){
            arrRegExpClassNames.push(new RegExp("(^|\\s)" + 
            oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
        }
    }
    else{
        arrRegExpClassNames.push(new RegExp("(^|\\s)" + 
        oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
    }
    var oElement;
    var bMatchesAll;
    for(var j=0; j<arrElements.length; j++){
        oElement = arrElements[j];
        bMatchesAll = true;
        for(var k=0; k<arrRegExpClassNames.length; k++){
            if(!arrRegExpClassNames[k].test(oElement.className)){
                bMatchesAll = false;
                break;                      
            }
        }
        if(bMatchesAll){
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}

function toggleSection(incomingId) {
	newSection = document.getElementById(incomingId);
	sectionsArray = getElementsByClassName(document, "div", "midBar");
	for (i = 0; i < sectionsArray.length; i++) {
		sectionsArray[i].style.display = "none";
	}
	newSection.style.display = (newSection.style.display == "block") ? "none" : "block";
}

function reveal(incomingId) {
	toggle(incomingId);
	var theBox = document.getElementById(incomingId);
	var top = (window.self.innerHeight - 564) / 2;
	var left = (window.self.innerWidth - 578) / 2;
	theBox.style.top = top + "px";
	theBox.style.left = left + "px";
}