// middle_tabs.js
// 11-28-07
// Coded by SGB as a tab utility

//var focusColor = "#27256c";
//var blurColor = "#716FB9";

// preload the images
var myImages = new Array ("/images/about1_act.gif", "/images/about1_on.gif","/images/content_creation_act.gif", "/images/content_creation_on.gif",  "/images/interactive_video_act.gif", "/images/interactive_video_on.gif", "/images/Distribution_act.gif", "/images/Distribution_on.gif", "/images/Samples_act.gif", "/images/Samples_on.gif","/images/analytic1_act.gif","/images/analytic1_on.gif");
 
var myPreload = new Array ();
 
for (var i = 0; i < myImages.length; i++ )
{

myPreload[ i ]= new Image();
myPreload[ i ].src = myImages[ i ];

}

var activeTabMiddle = "about1";

function midTabMouseOver(elementID)
{
	// turn all the button to the off position
	document.getElementById("about1Button").src = "/images/about1_off.gif";
	document.getElementById("content_creationButton").src = "/images/content_creation_off.gif";
	document.getElementById("interactive_videoButton").src = "/images/interactive_video_off.gif";
	document.getElementById("DistributionButton").src = "/images/Distribution_off.gif";
	document.getElementById("SamplesButton").src = "/images/Samples_off.gif";
	document.getElementById("analytic1Button").src = "/images/analytic1_off.gif";
	
	// switch on the elementID to turn on what should be on
	switch (elementID)
	{
		case "about1Button":
			document.getElementById("about1Button").src = "/images/about1_act.gif";
			break
		case "content_creationButton":
			document.getElementById("content_creationButton").src = "/images/content_creation_act.gif";
			break
		case "interactive_videoButton":
			document.getElementById("interactive_videoButton").src = "/images/interactive_video_act.gif";
			break
		case "DistributionButton":
			document.getElementById("DistributionButton").src = "/images/Distribution_act.gif";
			break
		case "SamplesButton":
			document.getElementById("SamplesButton").src = "/images/Samples_act.gif";
			break
		case "analytic1Button":
			document.getElementById("analytic1Button").src = "/images/analytic1_act.gif";
			break
		default:
			alert("The tab system does not recognize the following element: " + elementID);
	}
	
	// turn the active tab back to on
	document.getElementById(activeTabMiddle + "Button").src = "/images/" + activeTabMiddle + "_on.gif";
}

// Changes the style of current element to focus style
function applyFocus(elementID)
{
	var element = document.getElementById(elementID);
	
	// turn all the tabs invisible
	document.getElementById("about1Tab").style.visibility = "hidden";
	document.getElementById("content_creationTab").style.visibility = "hidden";
	document.getElementById("interactive_videoTab").style.visibility = "hidden";
	document.getElementById("DistributionTab").style.visibility = "hidden";
	document.getElementById("SamplesTab").style.visibility = "hidden";
	document.getElementById("analytic1Tab").style.visibility = "hidden";
	
	// turn all the button to the off position
	document.getElementById("about1Button").src = "/images/about1_off.gif";
	document.getElementById("content_creationButton").src = "/images/content_creation_off.gif";
	document.getElementById("interactive_videoButton").src = "/images/interactive_video_off.gif";
	document.getElementById("DistributionButton").src = "/images/Distribution_off.gif";
	document.getElementById("SamplesButton").src = "/images/Samples_off.gif";
	document.getElementById("analytic1Button").src = "/images/analytic1_off.gif";
	
	// switch on the elementID to turn on what should be on
	switch (elementID)
	{
		case "about1Button":
			document.getElementById("about1Tab").style.visibility = "visible";
			activeTabMiddle = "about1";
			break
		case "content_creationButton":
			document.getElementById("content_creationTab").style.visibility = "visible";
			activeTabMiddle = "content_creation";
			break
		case "interactive_videoButton":
			document.getElementById("interactive_videoTab").style.visibility = "visible";
			activeTabMiddle = "interactive_video";
			break
		case "DistributionButton":
			document.getElementById("DistributionTab").style.visibility = "visible";
			activeTabMiddle = "Distribution";
			break
		case "SamplesButton":
			document.getElementById("SamplesTab").style.visibility = "visible";
			activeTabMiddle = "Samples";
			break
	    case "analytic1Button":
			document.getElementById("analytic1Tab").style.visibility = "visible";
			activeTabMiddle = "analytic1";
			break
		default:
			alert("The tab system does not recognize the following element: " + elementID);
	}
	
	// turn the active tab back to on
	document.getElementById(activeTabMiddle + "Button").src = "/images/" + activeTabMiddle + "_on.gif";
}

// Changes the style of current element to focus style
function blurFocusMid()
{
	// turn all the button to the off position
	document.getElementById("about1Button").src = "/images/about1_act.gif";
	document.getElementById("content_creationButton").src = "/images/content_creation_act.gif";
	document.getElementById("interactive_videoButton").src = "/images/interactive_video_act.gif";
	document.getElementById("DistributionButton").src = "/images/Distribution_act.gif";
	document.getElementById("SamplesButton").src = "/images/Samples_act.gif";
		document.getElementById("analytic1Button").src = "/images/analytic1_act.gif";
	
	// turn the active tab back to on
	document.getElementById(activeTabMiddle + "Button").src = "/images/" + activeTabMiddle + "_on.gif";
}
