// Javascript page

/* Begin Copyright 
*
* Confidential 
*
* OCO Source Materials 
*
* Product: 
*
* The Source code for this program is not published or otherwise
* divested of its trade secrets, irrespective of what has been
* deposited with the U.S. Copyright Office. 
*
* Copyright SAS/OH 2004 
*
* End Copyright 
*/

// CIR JavaScript specific functions
var Home="Rink General Information and Events";
var JuniorASchedule="AJHL Jr. A Senators Home Schedule";
var JuniorBSchedule="Empire Jr. B Senators Home Schedule";
var JuniorCSchedule="CHA Jr. C Senators Home Schedule";
var YouthSchoolSpringLeague="2010 Youth Hockey League Schedule";
var YouthSchoolSummerLeague="2010 Mite/Youth/High School Hockey League Schedule";
var HighSchoolSummerLeague="2010 High School Hockey League Schedule";
var MondayLeague="2010-2011 Monday Night Hockey League Schedule";
var TuesdayLeague="2010-2011 Tuesday Night Hockey League Schedule <a class='navLinks' href='cirTuesdayLeaguePhotosPage.jsp' target=_blank>(Click here to view Photos)</a>";
var TuesdayLeaguePhotos="2010-2011 Tuesday Night Hockey League Photos";
var WednesdayLeague="2010-2011 Wednesday Night Hockey League Schedule";
var WednesdaySummerLeague="2010 Wednesday Night Summer Hockey League Schedule";
var ThursdayLeague="2010-2011 Rivermede Thursday Night Hockey League Schedule";
var SaturdayLeague="2010-2011 Saturday Night Hockey League Schedule";
var SundayLeague="2010-20010 Sunday Night B Hockey League Schedule";
var SundayWednesdayLeague="2010-2011 Sunday Night A Hockey League Schedule";
var MondaySummerLeague="2010 Monday Night Summer Hockey League Schedule";
var FaceOffBarGrill="Face-Off Bar & Grill";
var OpenHockey="Open Hockey Schedule";
var OpenSkating="Public Skating Schedule";
var ContactInfo="Contact Information and Directions";
var STHAFebTournament="STHA February Tournament";
var AdvertisingInfo="Advertising Information";
var FaceOff = "Face-Off Bar and Grill";
var AvailableIce="Available Ice Time Information";

function updateDivContent(selection) { 
    var title = "<span class='descriptionRed'><b>";
    if (selection == "MondayLeague") {
    		title = title + MondayLeague;
    } else if (selection == "TuesdayLeague") {
    		title = title + TuesdayLeague;
    } else if (selection == "TuesdayLeaguePhotos") {
    		title = title + TuesdayLeaguePhotos;
    } else if (selection == "MondaySummerLeague") {
    		title = title + MondaySummerLeague;
    } else if (selection == "WednesdayLeague") {
    		title = title + WednesdayLeague;
    } else if (selection == "WednesdaySummerLeague") {
    		title = title + WednesdaySummerLeague;
    } else if (selection == "ThursdayLeague") {
    		title = title + ThursdayLeague;
    } else if (selection == "SaturdayLeague") {
    		title = title + SaturdayLeague;
    } else if (selection == "SundayLeague") {
    		title = title + SundayLeague;
    } else if (selection == "SundaySummerLeague") {
    		title = title + SundaySummerLeague;
    } else if (selection == "SundayWednesdayLeague") {
    		title = title + SundayWednesdayLeague;
    } else if (selection == "Home") {
    		title = title + Home;
    } else if (selection == "YouthSchoolSpringLeague") {
    		title = title + YouthSchoolSpringLeague;
    } else if (selection == "YouthSchoolSummerLeague") {
    		title = title + YouthSchoolSummerLeague;
    } else if (selection == "HighSchoolSummerLeague") {
    		title = title + HighSchoolSummerLeague;
    } else if (selection == "JuniorASchedule") {
    		title = title + JuniorASchedule;
    } else if (selection == "JuniorBSchedule") {
    		title = title + JuniorBSchedule;
    } else if (selection == "JuniorCSchedule") {
    		title = title + JuniorCSchedule;
    } else if (selection == "FaceOffBarGrill") {
    		title = title + FaceOffBarGrill;
    } else if (selection == "OpenHockey") {
    		title = title + OpenHockey;
    } else if (selection == "OpenSkating") {
    		title = title + OpenSkating;
    } else if (selection == "AvailableIce") {
    		title = title + AvailableIce;
    } else if (selection == "ContactInfo") {
    		title = title + ContactInfo;
    } else if (selection == "STHAFebTournament") {
    		title = title + STHAFebTournament;
    } else if (selection == "AdvertisingInfo") {
    		title = title + AdvertisingInfo;
    } else if (selection == "faceOff") {
    		title = title + FaceOff;
    }
    title += "</b></span>";
	document.getElementById("titleArea").innerHTML = title;
	document.getElementById("displayArea").innerHTML = document.getElementById(selection).innerHTML;
}

function process(pro,navName) {
   	if (isClicked(navName)) {
		if (document.getElementById(navName)!=null) {
			document.getElementById(navName).style.visibility = "hidden";
		}
   	}
	updateDivContent(pro);
}


// navigation div functions
var aDivsShown = new Array();
function isClicked(divName) {
	var b = false;
	var iFound = -1;
	for (i=aDivsShown.length; --i>=0;) {
		if (divName == aDivsShown[i]) {
		 	b = true;
		 	iFound = i;
		 	break;
		}
	}
	if (b) {
		aDivsShown[iFound] = "";
	} else {
		aDivsShown[aDivsShown.length] = divName;
	}
	return b;
}
function showDiv(divName) {
	var div = document.getElementById(divName);
	if (div!=null) {
		if (!isClicked(divName)) {
			div.style.visibility = "visible";
		} else {
			div.style.visibility = "hidden";
		}
	}
}
function linkToSchedule() {
	showDiv("leagueNav");
	window.scrollTo(0,0);
}