/*601537950*/

var defaultText		= "";
var prgmInfo_ref	= " &nbsp;&nbsp;<a href=\"./program_info.asp\"><b>Program</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"./equipment_info.asp\"><b>Equipment</b></a>&nbsp;&nbsp;";
var findX_ref		= " &nbsp;&nbsp;X = Your Sport [Click and find your sport for optimal sports training periods]";

var testimonials_ref	=
"<span>" +
"<table cellpadding=\"0\" " +
"style=\"" +
"background-Color:#123477;" +
"width:520px;" +
"height:22px;" +
"border-Style:solid;" +
"border-Top-Style:none;" +
"border-color:#BFBFBF;" +
"border-Width:1px;" +
"font-size: 12px;" +
"font-weight : normal;" +
"text-decoration: none;" +
"position:relative;" +
"left:255px;" +
"\" id=\"subMenu\">" +
"<tr>" +

"<td align=\"center\">" +
"<a href=\"testimonial_professional.asp\"><b>Professional</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;" +
"<a href=\"testimonial_other.asp\"><b>Maximum Perform-X Athletes</b></a>&nbsp;&nbsp;|&nbsp;&nbsp;" +
"<a href=\"testimonial_parent.asp\"><b>Maximum Perform-X Parents</b></a></td>" +

"</tr>" +
"</table>" +
"</span>";

var faq_ref		= " &nbsp;&nbsp;Frequently Asked Questions [Click for more details]";
var contact_ref		= " &nbsp;&nbsp;About Us [Click for more details]";
var research_ref	= " &nbsp;&nbsp;Research [Click for more details]";
var sponsors_ref	= " &nbsp;&nbsp;Sponsors [Click for more details]";


function menuColor(_obj, _color)
{
	_obj.style.backgroundColor = _color;
}

function menuBlack(_obj)
{
	if (_obj.id == ("programTD"))
	{
		_obj.style.backgroundColor = "123477";
	}
	else
	{
		_obj.style.backgroundColor = "black";
	}
}

function menuColor(_obj)
{
	_obj.style.backgroundColor = "#6C7F9C";
}

function linkOver(_obj)
{
	//changeBodyText(_obj.id);

	if (_obj.id == "prgmInfo_ref")
	{
		changeBodyTextProgram(prgmInfo_ref);
	}
	else if (_obj.id == "findX_ref")
	{
		changeBodyText(findX_ref);
	}
	else if (_obj.id == "testimonials_ref")
	{
		changeBodyText(testimonials_ref);
	}
	else if (_obj.id == "faq_ref")
	{
		changeBodyText(faq_ref);
	}
	else if (_obj.id == "contact_ref")
	{
		changeBodyText(contact_ref);
	}
	else if (_obj.id == "research_ref")
	{
		changeBodyText(research_ref);
	}
	else if (_obj.id == "sponsors_ref")
	{
		changeBodyText(sponsors_ref);
	}
}

function changeBodyText(_text)
{
	if (document.all.intro != null)
	{
		document.all.intro.innerHTML = _text;
		document.all.intro.style.backgroundColor = "#737373";
		document.all.intro.style.width = "0";
		document.all.intro.style.borderStyle = "none";
	}
}

function changeBodyTextProgram(_text)
{
	if (document.all.intro != null)
	{
		document.all.intro.innerHTML = _text;
		document.all.intro.style.backgroundColor = "#123477";
		document.all.intro.style.width = "150px";
		document.all.intro.style.borderStyle = "solid";
		document.all.intro.style.borderTopStyle = "none";
		document.all.intro.style.borderWidth = "1";
	}
}

function setDefaultText()
{
	changeBodyText(defaultText);
}



var m_arrSportText = new Array(0);
var months = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");


function SportClass(_name, _startMonthIn, _finMonthIn, _startMonthOut, _finMonthOut)
{
	this.name = _name;
	this.startMonthIn = 0 + _startMonthIn;
	this.finMonthIn = 0 + _finMonthIn;
	this.startMonthOut = 0 + _startMonthOut;
	this.finMonthOut = 0 + _finMonthOut;
}

function createTableElement(_strSportName, _ins, _inf, _outs, _outf)
{
	var tempArr = new Array(m_arrSportText.length + 1);

	for (i = 0; i < m_arrSportText.length; i++)
	{
		tempArr[i] = m_arrSportText[i];
	}

	tempArr[tempArr.length - 1] = new SportClass(_strSportName, _ins, _inf, _outs, _outf);

	m_arrSportText = new Array(tempArr.length);

	for (i = 0; i < m_arrSportText.length; i++)
	{
		m_arrSportText[i] = tempArr[i];
	}

	firstLetterCap = "";

	firstLetterCap = _strSportName.charAt(0).toUpperCase() + _strSportName.substring(1, _strSportName.length);

	var HTMLText = "" +
		"<td class=\"calendarListSport\">" +
		"<span " +
		"id=\"" + _strSportName + "Span\" " +
		"onmouseover=\"this.style.cursor=\'hand\';highlight(\'" + _strSportName + "\')\">" +
		firstLetterCap + "</span></td> ";

	for (j = 0; j < months.length; j++)
	{
		HTMLText = HTMLText + "<td class=\"calendarList\" id=\"" + _strSportName + months[j] + "\">&nbsp;</td> ";
	}

	document.write(HTMLText);
}

function highlight(_sport)
{
	resetCalColors();

	for (i = 0; i < m_arrSportText.length; i++)
	{
		if (_sport == m_arrSportText[i].name)
		{

			startMonthIn = m_arrSportText[i].startMonthIn;
			finMonthIn = m_arrSportText[i].finMonthIn;
			startMonthOut = m_arrSportText[i].startMonthOut;
			finMonthOut = m_arrSportText[i].finMonthOut;
			for (j = 0; j < 12; j++)
			{
				// in season months
				if (startMonthIn < finMonthIn)
				{
					if (j >= startMonthIn && j <= finMonthIn)
					{
						document.all.namedItem(_sport + months[j]).style.backgroundColor="red";
					}
				}
				else
				{
					if (j <= (finMonthIn) || j >= startMonthIn)
					{
						document.all.namedItem(_sport + months[j]).style.backgroundColor="red";
					}
				}

				// out of season months
				if (startMonthOut < finMonthOut)
				{
					if (j >= startMonthOut && j <= finMonthOut)
					{
						document.all.namedItem(_sport + months[j]).style.backgroundColor="orange";
					}
				}
				else
				{
					if (j <= (finMonthOut) || j >= startMonthOut)
					{
						document.all.namedItem(_sport + months[j]).style.backgroundColor="orange";
					}
				}
			}

		break;
		}
	}
}

function resetCalColors()
{
	//alert(document.all.namedItem("hockey"+"Jan").style.backgroundColor);
	for (i = 0; i < 12; i++)
	{
		for (j = 0; j < m_arrSportText.length; j++)
		{
			if (document.all.namedItem(m_arrSportText[j].name + months[i]).style.backgroundColor != "gray")
			{
				document.all.namedItem(m_arrSportText[j].name + months[i]).style.backgroundColor="gray";
			}
		}
	}
}

function showHideMonths()
{

	var showAllText = "Show All Programs";
	var hideAllText = "Hide All Programs";

	if (document.all.showHideAll.getAdjacentText("afterBegin") == showAllText)
	{
                document.all.showHideAll.innerHTML = hideAllText;
                showAllCalMonths();
	}
	else
	{
                document.all.showHideAll.innerHTML = showAllText;
                resetCalColors();
	}
}

function showAllCalMonths()
{

	for (i = 0; i < m_arrSportText.length; i++)
	{

		startMonthIn = m_arrSportText[i].startMonthIn;
		finMonthIn = m_arrSportText[i].finMonthIn;
		startMonthOut = m_arrSportText[i].startMonthOut;
		finMonthOut = m_arrSportText[i].finMonthOut;
		for (j = 0; j < 12; j++)
		{
			// in season months
			if (startMonthIn < finMonthIn)
			{
				if (j >= startMonthIn && j <= finMonthIn)
				{
					document.all.namedItem(m_arrSportText[i].name + months[j]).style.backgroundColor="red";
				}
			}
			else
			{
				if (j <= (finMonthIn) || j >= startMonthIn)
				{
					document.all.namedItem(m_arrSportText[i].name + months[j]).style.backgroundColor="red";
				}
			}

			// out of season months
			if (startMonthOut < finMonthOut)
			{
				if (j >= startMonthOut && j <= finMonthOut)
				{
					document.all.namedItem(m_arrSportText[i].name + months[j]).style.backgroundColor="orange";
				}
			}
			else
			{
				if (j <= (finMonthOut) || j >= startMonthOut)
				{
					document.all.namedItem(m_arrSportText[i].name + months[j]).style.backgroundColor="orange";
				}
			}
		}
	}
}

function setCalendarColor()
{
	//alert(new Date().getMonth());
	var month = new Date().getMonth();

	if (month < 3)
	{
		document.all.spring.style.backgroundColor = "#6C7F9C";
	}
	else if (month < 6)
	{
		document.all.summer.style.backgroundColor = "#6C7F9C";
	}
	else if (month < 9)
	{
		document.all.fall.style.backgroundColor = "#6C7F9C";
	}
	else
	{
		document.all.winter.style.backgroundColor = "#6C7F9C";
	}
}


/*************************************
 *  This notice may not be removed   *
 * http://www.geocities.com/vbarsan/ *
*************************************/

//-- Begin Scroller's Parameters and message -->
//scroller width: change to your own;
var wwidth=450;

//scroller height: change to your own;
var wheight=20;

//background color: change to your own;
var wbcolor="#000000";

//scroller's speed: change to your own;
var sspeed=5;
var restart=sspeed;
var rspeed=sspeed;

//text: change to your own
var wwholemessage = "";

function setScrollText(_strVal)
{
	wwholemessage = _strVal;
}
//-- end Parameters and message-->

//-- begin: Scroller's Algorithm -->
var sizeupw=0;
var operbr=navigator.userAgent.toLowerCase().indexOf('opera');

function goup()
{
	if(sspeed!=rspeed*8)
	{
		sspeed=sspeed*2;
		restart=sspeed;
	}
}

function godown()
{
	if(sspeed>rspeed)
	{
		sspeed=sspeed/2;
		restart=sspeed;
	}
}

function startw()
{
	if(document.all)
		iemarqueew(wslider);

	else if(document.getElementById)
		ns6marqueew(document.getElementById('wslider'));

	else if(document.layers)
		ns4marqueew(document.wslider1.document.wslider2);
}

function iemarqueew(whichdiv)
{
	iedivw=eval(whichdiv);
	iedivw.style.pixelLeft=wwidth;
	iedivw.innerHTML='<nobr>'+wwholemessage+'</nobr>';
	sizeupw=iedivw.offsetWidth;

	if(operbr!=-1)
	{
		operaslider.innerHTML='<nobr>'+wwholemessage+'</nobr>';
		sizeupw=operaslider.offsetWidth;
	}

	ieslidew();
}

function ieslidew()
{
	if(iedivw.style.pixelLeft>=sizeupw*(-1))
	{
		iedivw.style.pixelLeft-=sspeed;
		setTimeout("ieslidew()",100);
	}

	else
	{
		iedivw.style.pixelLeft=wwidth;
		ieslidew();
	}
}

function ns4marqueew(whichlayer)
{
	ns4layerw=eval(whichlayer);
	ns4layerw.left=wwidth;
	ns4layerw.document.write('<nobr>'+wwholemessage+'</nobr>');
	ns4layerw.document.close();
	sizeupw=ns4layerw.document.width;
	ns4slidew();
}

function ns4slidew()
{
	if(ns4layerw.left>=sizeupw*(-1))
	{
		ns4layerw.left-=sspeed;
		setTimeout("ns4slidew()",100);
	}

	else
	{
		ns4layerw.left=wwidth;
		ns4slidew();
	}
}

function ns6marqueew(whichdiv)
{
	ns6divw=eval(whichdiv);
	ns6divw.style.left=wwidth;
	ns6divw.innerHTML='<nobr>'+wwholemessage+'</nobr>';
	sizeupw=ns6divw.offsetWidth;
	ns6slidew();
}

function ns6slidew()
{
	if(parseInt(ns6divw.style.left)>=sizeupw*(-1))
	{
		ns6divw.style.left=parseInt(ns6divw.style.left)-sspeed;
		setTimeout("ns6slidew()",100);
	}

	else
	{
		ns6divw.style.left=wwidth;
		ns6slidew();
	}
}
//-- end Algorithm -->



// on submit contact info validation
var m_bSubmit = true;

function onSubmit()
{
	//alert(m_bSubmit);
	return m_bSubmit;
}


function checkValues()
{

	var optionsArray = document.inputForm.state.options;
	var stateValue;
	var missingValue = "";
	for (j = 0; j < optionsArray.length; j++)
	{
		if (optionsArray[j].selected)
		{
			if (optionsArray[j].value == "STATE")
			{
				stateValue = "STATE";
			}
			break;
		}
	}

	if (document.inputForm.firstname.value == "")
	{
		missingValue += "\n    First Name";
		m_bSubmit = false;
	}

	if (document.inputForm.lastname.value == "")
	{
		missingValue += "\n    Last Name";
		m_bSubmit = false;
	}

	if (document.inputForm.dobMonth.value == "" || document.inputForm.dobMonth.value.length != 2)
	{
		missingValue += "\n    DOB Month";
		m_bSubmit = false;
	}

	if (document.inputForm.dobDay.value == "" || document.inputForm.dobDay.value.length != 2)
	{
		missingValue += "\n    DOB Day";
		m_bSubmit = false;
	}

	if (document.inputForm.dobYear.value == "" || document.inputForm.dobYear.value.length != 4)
	{
		missingValue += "\n    DOB Year";
		m_bSubmit = false;
	}

	if (document.inputForm.address.value == "")
	{
		missingValue += "\n    Street Address";
		m_bSubmit = false;
	}

	if (document.inputForm.city.value == "")
	{
		missingValue += "\n    City";
		m_bSubmit = false;
	}

	if (document.inputForm.zip.value == "")
	{
		missingValue += "\n    Zip Code";
		m_bSubmit = false;
	}

	if (stateValue == "")
	{
		missingValue += "\n    State";
		m_bSubmit = false;
	}

	if (document.inputForm.phone.value == "")
	{
		missingValue += "\n    Phone Number";
		m_bSubmit = false;
	}

	if ((document.inputForm.email.value == "" ||
			 document.inputForm.email.value == null) ||
		(document.inputForm.email.value.indexOf('@') == -1 ||
			 document.inputForm.email.value.indexOf('.') == -1 ||
			 document.inputForm.email.value.indexOf(' ') != -1))
	{
		missingValue += "\n    Valid E-Mail Address ";
		m_bSubmit = false;
	}

	if (document.inputForm.psport.value == "")
	{
		missingValue += "\n    Primary Sport";
		m_bSubmit = false;
	}

	if (missingValue.length == 0)
	{
		m_bSubmit = true;
	}

	else if (missingValue.length > 0)
	{
		alert("You Must Enter or Select the following:" + missingValue);
	}
	//m_bSubmit = false;
}