//<SCRIPT LANGUAGE="JavaScript">
// Copyright © 2005 Strictly Soccer, All Rights Reserved 

// Globals
szCurrentPage = "";
g_oAnim = null;

////////////////////////////////////////////////////////////////////////////////
// SetRolloverButtonState: Set the state for each rollover action
////////////////////////////////////////////////////////////////////////////////
function btnItem
(
	name
) 
{
	this.over		= new Image();
	this.over.src	= "images\\" + name + "_over.jpg";
	this.out		= new Image();
	this.out.src    = "images\\" + name + "_out.jpg";
	this.select     = new Image();
	this.select.src = "images\\" + name + "_select.jpg";
}

////////////////////////////////////////////////////////////////////////////////
// CreateRolloverButton: Load buttons into memory
////////////////////////////////////////////////////////////////////////////////
function CreateRolloverButton 
(
	name
) 
{
	btnItem[name] = new btnItem(name);
}

////////////////////////////////////////////////////////////////////////////////
// navButtonOver: Turn image on
////////////////////////////////////////////////////////////////////////////////
function navButtonOver 
(
	imgName
) 
{
	if ( (null != btnItem[imgName.name]) && (document.images) ) 
		document[imgName.name].src = btnItem[imgName.name].over.src;
}

////////////////////////////////////////////////////////////////////////////////
// navButtonOut: Turn image off
////////////////////////////////////////////////////////////////////////////////
function navButtonOut 
(
	imgName
)
{
	if ( (null != btnItem[imgName.name]) && (document.images) ) 
		document[imgName.name].src = btnItem[imgName.name].out.src;
	
	if (imgName.name == szCurrentPage)
	{
		if ( (null != btnItem[imgName.name]) && (document.images) ) 
			document[imgName.name].src = btnItem[imgName.name].select.src;
	}
}

////////////////////////////////////////////////////////////////////////////////
// Navigate to corresponding button page
////////////////////////////////////////////////////////////////////////////////
function ShowPage
(
	imgName,
	bNavigate
)
{
	// Deselect all other pages
	parent.LeftNav.document["Home"].src = parent.LeftNav.btnItem["Home"].out.src;
	parent.LeftNav.document["Programs"].src = parent.LeftNav.btnItem["Programs"].out.src;
	parent.LeftNav.document["CoachesCorner"].src = parent.LeftNav.btnItem["CoachesCorner"].out.src;
	parent.LeftNav.document["Directions"].src = parent.LeftNav.btnItem["Directions"].out.src;
	parent.LeftNav.document["Apparel"].src = parent.LeftNav.btnItem["Apparel"].out.src;
	parent.LeftNav.document["AboutUs"].src = parent.LeftNav.btnItem["AboutUs"].out.src;

	// Select the current page
	if (bNavigate != false)
	{
		if ( (null != parent.LeftNav.btnItem[imgName]) && (parent.LeftNav.document.images) ) 
			parent.LeftNav.document[imgName].src = parent.LeftNav.btnItem[imgName].select.src;
	}

	// Set the current page
	szCurrentPage = imgName;
}

////////////////////////////////////////////////////////////////////////////////
// Animation_Start: Start SoccerBall Animation 
////////////////////////////////////////////////////////////////////////////////
function Animation_Start
(
	oAnim
)
{
	if (oAnim)
	{
		// Set initial position
		oAnim.style.top  = -75;
		oAnim.style.left = 500;
		oAnim.style.visibility = "visible";
		
		// Create global reference to animation object
		g_oAnim = oAnim;
		
		// Start timer for animation movement
		window.tmr = window.setInterval('Animation_MoveDown()', 100);
	}
}

////////////////////////////////////////////////////////////////////////////////
// Animation_MoveDown: Move Animation Downward
////////////////////////////////////////////////////////////////////////////////
function Animation_MoveDown()
{
	// Set initial position
	var szCurPos = g_oAnim.style.top;
	szCurPos     = szCurPos.substring(0,szCurPos.length-2)-0;
	g_oAnim.style.top = szCurPos + 30;
	
	// Check to see if the bottom of the page has been reached
	if ( (szCurPos+5) > parent.Main.document.body.clientHeight)
	{
		// Kill the downward timer
		window.clearInterval(window.tmr);
		g_oAnim.style.visibility = "hidden";
		g_oAnim.style.top  = -75;
	}
}

//</SCRIPT>
