function hide(IDName) {
document.getElementById(IDName).style.display = "none";
}
function show(IDName) {
document.getElementById(IDName).style.display = "block";
}

function check(quiz, question, selected) {
		
	var graded = "graded" + question;
	var feedback = "feedback" + question;
	var answer = "";
	var correctFeedback = "";
	var cqanswer = new Array();
	if (quiz == "cq")
	{
		cqanswer[1] = "d";
		cqanswer[2] = "a";
		cqanswer[3] = "a";
	} else {
		cqanswer[1] = "b";
		cqanswer[2] = "a";
		cqanswer[3] = "a";
		cqanswer[4] = "d";
		cqanswer[5] = "a";
	}
	answer = quiz + question + cqanswer[question];
	//alert("The answer is " + answer);
	selection = quiz + question + selected;
	//alert("You selected " + selection);
	if(answer == selection)
	{
		correctFeedback = "THAT IS CORRECT! "
	} else {
		correctFeedback = "THAT IS INCORRECT! "
	}
	document.getElementById(graded).innerHTML = correctFeedback;
	document.getElementById(answer).style.fontWeight = "bold";
	document.getElementById(feedback).style.display = "block";
}

	var activitiesArray = new Array();
	activitiesArray[0] = "";
	activitiesArray[1] = "Cheer";
	activitiesArray[2] = "Dance";
	activitiesArray[3] = "Swimming";
	activitiesArray[4] = "Gymnastics";
	activitiesArray[5] = "Softball";
	activitiesArray[6] = "Soccer";
	activitiesArray[7] = "Basketball";
	activitiesArray[8] = "Volleyball";

function yaSwitch(activity, currentSection)
{
	textToShow = "ya" + currentSection + activity + "Text";
	imageToShow = "ya" + currentSection + activity + "Image";
	
	var tempActivity;
	for(x=0;x<9;x++) {
		tempActivity = activitiesArray[x];
		document.getElementById("yaHelp" + tempActivity + "Text").style.left = "-1000px";
		document.getElementById("yaKnow" + tempActivity + "Text").style.left = "-1000px";
		if(tempActivity != "")
		{
			document.getElementById("ya" + tempActivity + "Link").className = "off";
			document.getElementById("yaHelp" + tempActivity + "Image").style.left = "-1000px";
			document.getElementById("yaKnow" + tempActivity + "Image").style.left = "-1000px";
		}
	}

	// Show activity
	//alert("Text Box is " + textToShow);
	document.getElementById(textToShow).style.left = "7px";
	if(activity != '')
	{
		//alert("Image is " + imageToShow);
		document.getElementById(imageToShow).style.left = "151px";
		document.getElementById(imageToShow).style.top = "0";
		document.getElementById("ya" + activity + "Link").className = "on";
	} 
	
}

function yaSwitchSections(section)
{
	var divName = "ya" + section + "Tab";
	document.getElementById("yaHelpTab").className = "off";
	document.getElementById("yaKnowTab").className = "off";
	document.getElementById(divName).className = "on";
	yaSwitch('',section);
	var linkName;
	for(x=1;x<9;x++) {
		linkName = "ya" + activitiesArray[x] + "Link";
		//alert("Link name is " + linkName);
		document.getElementById(linkName).innerHTML = "<a href=\"javascript:yaSwitch('" + activitiesArray[x] + "','" + section +"');\"><span><h2>" + activitiesArray[x] + "</h2></span></a>";
	}

}


// Patanol.com Form Validation
function validateForm(theForm)
{
    if (theForm.FirstName.value == "") 
		{
	    	alert("Please provide your first name.");
    		theForm.FirstName.focus();
        	return false; 
		} 
    if (theForm.LastName.value == "")  
		{
	    	alert("Please provide your last name.");
    		theForm.LastName.focus();
        	return false; 
		} 
		if (theForm.Email.value == "" )
					{
						if (strMessage != null)
							{
								strMessage += "Please enter your email address.";
							}
						else
							{
								var strMessage = "Please enter your email address.";
							}
						alert(strMessage);
						theForm.Email.focus();
						return false; 
					}
				// check validity of email
				var validEmail = checkEmail(theForm.Email);
				
				if (!validEmail)
				{
					alert("Please enter a valid email address.");
					theForm.Email.focus();
					return false;
				} 				
    if (theForm.Address1.value == "")  
		{
	    	alert("Please provide your address.");
    		theForm.Address1.focus();
        	return false; 
		} 
    if (theForm.City.value == "")  
		{
	    	alert("Please provide your city.");
    		theForm.City.focus();
        	return false; 
		} 
 
	if (theForm.Zip.value == "") 
		{
	    	alert("Please provide your ZIP Code.");
    		theForm.Zip.focus();
			return (false);
		}
	if ((theForm.Zip.value.length!=5) && (theForm.Zip.value.length!=10))
		{
	    	alert("Please provide a valid ZIP Code.");
    		theForm.Zip.focus();
			return (false);
		}
	RefString="1234567890-";
	for (Count=0; Count < theForm.Zip.value.length; Count++)  
		{
			TempChar= theForm.Zip.value.substring (Count, Count+1);
			if (RefString.indexOf (TempChar, 0)==-1) 
				{
	    			alert("Please provide a valid ZIP Code.");
    				theForm.Zip.focus();
					return false; 
				}
		}
			
	
				
				
					
			
    theForm.submit();
} 
function checkEmail(email)  		
			{
				var goodEmail = email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
				if (goodEmail)
			    {
					 return true;
				} 
				else
				{
					return false;
				}		
			}
function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];}}
}

function NewWindow(dest, windowName, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizable=yes,toolbars=no,location=no'
win = window.open(dest, windowName, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function CenteredWindow(dest, windowName, w, h, scroll,resize,tool,loc) {
	var	winl = ((screen.width - w) / 2) - 10;
	var	wint = ((screen.height - h) / 2) - 25;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize+',toolbars='+tool+',location='+loc+'';
win = window.open(dest, windowName, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }}