// JavaScript Document

<!--BEGIN: CLEAR FORM FIELD-->
	function clickClear(thisField, defaultText) 
	{
		if (thisField.value == defaultText) 
		{
			thisField.value = "";
		}
	}

	function clickRecall(thisField, defaultText) 
	{
		if (thisField.value == "") 
		{
			thisField.value = defaultText;
		}
	}
<!--END: CLEAR FORM FIELD-->


<!--BEGIN: SWITCH TARGETED CLASS-->
	function switchClass(id, newClass) 
	{ 
		if (document.getElementById) 
		{
			document.getElementById(id).className = newClass;
	    }
	}
<!--END: SWITCH TARGETED CLASS-->


<!--BEGIN: SWITCH TARGETED CLASS RANGE-->
	function switchClasses(elementsToSwitch)
	{
		for(var elementId in elementsToSwitch)
		{
			switchClass(elementId, elementsToSwitch[elementId]);
		}
	}
<!--END: SWITCH TARGETED CLASS RANGE-->


<!--BEGIN: TOGGLE CLASS RANGE-->
	function showSingleChild(parentElementId, childToShowId, className)
	{
	    var parent = document.getElementById(parentElementId);
	    for(var childNodeIndex in parent.childNodes)
	    {
	        var childNode = parent.childNodes[childNodeIndex];
	        if(childNode.nodeType==1)
	        {
	            if (childNode.id == childToShowId)
	            {
	                childNode.className=className;
	            }
	            else
	            {
	                childNode.className="hide";
	            }
	        }
	    }
	}
<!--END: TOGGLE CLASS RANGE-->


<!--BEGIN: EVALUATE TARGETED CLASS-->
	function evalClass(id, newClass) { 
		
		//Check the state of the row being hovered over.
		if (document.getElementById(id).className == "rowHoverDark") 
		{
			document.getElementById(id).className = "rowDark";
		}
		else if (document.getElementById(id).className == "rowHoverLight") 
		{
			document.getElementById(id).className = "rowLight";
		}
		else 
		{
			//DO NOTHING
		}
	}
<!--END: EVALUATE TARGETED CLASS-->

<!--BEGIN: IMAGE LOADER-->

var theImages = new Array()

//Random-loading images
theImages[0] = 'images/imageHome_01.jpg' // replace with names of images
theImages[1] = 'images/imageHome_02.jpg'
theImages[2] = 'images/imageHome_03.jpg'
theImages[3] = 'images/imageHome_04.jpg'
theImages[4] = 'images/imageHome_06.jpg'
theImages[5] = 'images/imageHome_07.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
if(whichImage==0){
document.write('<img src="'+theImages[whichImage]+'" border="0" width="916" height="435">');
}
else if(whichImage==1){
document.write('<img src="'+theImages[whichImage]+'" border="0" width="916" height="435">');
}
else if(whichImage==2){
document.write('<img src="'+theImages[whichImage]+'" border="0" width="916" height="435">');
}
else if(whichImage==3){
document.write('<img src="'+theImages[whichImage]+'" border="0" width="916" height="435">');
}
else if(whichImage==4){
document.write('<img src="'+theImages[whichImage]+'" border="0" width="916" height="435">');
}
else if(whichImage==5){
document.write('<img src="'+theImages[whichImage]+'" border="0" width="916" height="435">');
}

}

<!--END: IMAGE LOADER-->