/*------------------------------------------------------------------------------ These are common functions built on top of the League Athletic site. The purpose it to make navigation easier and provide a common set tools to make the user's experience easier These functions are not supported by League Athletics. Any changes to the under lying sturture by LA will require these functions to be updated. use at your own maintenance risk. -------------------------------------------------------------------------------*/ //----------------------------------------------------------------------- // these variables and functions are specific to the team bulletin page //----------------------------------------------------------------------- var sWHYCurrentSeason = "3807"; //2009-2010 var sHockeyDTeamID = "96568"; var sMidgetTeamID ="96578"; var sGoaliesTeamID="96580"; var sMiteATeamID="96579"; var sMiteBTeamID ="96573"; var sSquirtATeamID ="96576"; var sSquirtBTeamID ="96569"; var sSquirtB1TeamID ="96581"; var sPeeWeeATeamID ="96570"; var sPeeWeeBTeamID ="96574"; var sBantamATeamID ="96577"; var sBAntamBTeamID ="96571"; var sLTSTeamID ="96575"; var sMIdgetSplitv ="96572"; //----------------------------------------------------------------------- // form variable required for post to the team bulletin page //----------------------------------------------------------------------- var sLeagueATeamFormName ="Teams"; var sLeagueASeasonFieldName ="Seasons"; var sLeagueATeamFieldName = "cmbTeam"; var sLeagueATeamChangedFieldName ="TeamChanged"; //----------------------------------------------------------------------- // functions used to set and post to the appropriate team bulletin page //----------------------------------------------------------------------- function setWYHTeam(sTeam){ document.forms[sLeagueATeamFormName].elements[sLeagueATeamFieldName].value =sTeam; } function setWYHSeason(sSeason){ document.forms[sLeagueATeamFormName].elements[sLeagueATeamFieldName].value =sSeason; } //individual team bulletin scripts (add them as you go along) function viewHockeyDNews() { // set the season setWYHSeason(sWHYCurrentSeason); // set the team id setWYHTeam(sHockeyDTeamID); // not sure how League A is using 'Seasons2065'. guessing it is an identifier for WHYA. setCookie("Seasons2065", document.forms[sLeagueATeamFormName].elements[sLeagueASeasonFieldName].value, 60) document.forms["Teams"].submit(); } function viewWYHAMidgetNews() { // set the season setWYHSeason(sWHYCurrentSeason); // set the team id setWYHTeam(sMidgetTeamID); // not sure how League A is using 'Seasons2065'. guessing it is an identifier for WHYA. setCookie("Seasons2065", document.forms[sLeagueATeamFormName].elements[sLeagueASeasonFieldName].value, 60) document.forms["Teams"].submit(); } function viewWYHAMiteANews() { // set the season setWYHSeason(sWHYCurrentSeason); // set the team id setWYHTeam(sMiteATeamID); // not sure how League A is using 'Seasons2065'. guessing it is an identifier for WHYA. setCookie("Seasons2065", document.forms[sLeagueATeamFormName].elements[sLeagueASeasonFieldName].value, 60) document.forms["Teams"].submit(); } //----------------------------------------------------------------------- // generic pop up controls //----------------------------------------------------------------------- var gConstPopUpSmall = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=425,height=350'; var gConstPopUpMedium = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=525,height=450'; var gConstPopUpLarge = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=825,height=550'; var gGoogleMapVilla= "http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Grand+Oak+Villa&sll=36.456636,-95.712891&sspn=53.194088,134.912109&ie=UTF8&hq=&hnear=550+Sylvan+Lake+Rd,+Oakville,+Litchfield,+Connecticut+06779&z=16&iwloc=A&cid=10720442577687766476"; var gGoogleNorwichIce="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=norwich+ice+rink,+norwich,ct&sll=37.0625,-95.677068&sspn=33.489543,55.458984&ie=UTF8&hq=norwich+ice+rink,&hnear=Norwich,+CT&ll=41.514105,-72.102928&spn=0.061827,0.108318&z=13&iwloc=A"; var gGoogleBoltonIce ="http://maps.google.com/maps?q=145+Hop+River+Road,+Bolton,+CT&ie=UTF8&hq=&hnear=145+Hop+River+Rd,+Bolton,+Tolland,+Connecticut+06043&z=16"; var gNewingtonIce ="http://www.newingtonarena.com/New%20Site/Directions/Directions.htm"; var gGoogleMapMilfordIce = "http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=milford+ice+pavilion,+milford+ct&sll=37.0625,-95.677068&sspn=55.192325,135.087891&ie=UTF8&cd=1&hq=milford+ice+pavilion,&hnear=Milford,+CT&z=14&iwloc=A"; var gGoogleMapVernonW = "http://maps.google.com/maps?saddr=06795&daddr=30+Weibel+Ave,Saratoga+Springs,NY+12866"; var gGoogleMapChoate ="http://maps.google.com/maps?saddr=06795&daddr=Christian+Street,Wallingford,CT+06492"; var gGoogleMapEnfield = "http://maps.google.com/maps?saddr=06795&daddr=1+Prior+Road,Enfield+,CT+06082"; function gPopUpHelp(target, size, sInternal){ var sLink =""; var sSize = gConstPopUpMedium; if (arguments.length == 0) return; if (arguments.length == 3){ if (size == gConstPopUpSmall || size == gConstPopUpMedium || size == gConstPopUpLarge) { sSize = size; } } if(target != ""){ if (sInternal=="true") { sLink = "http://LeagueAthletics.com/" + target; }else{ sLink = target; } var helpwin = window.open(sLink, "WYHAInfo", sSize); helpwin.focus(); } } var wyha_currentImage = 1; function wyhaChangeHomePageMidgetImage(direction) { var maxImage = 6; var minImage = 1; var sPicDivId = ""; var sSeniorPic = "seniorPic"; var sSeniorStat = "seniorStats"; if (direction=="next"){ if (wyha_currentImage==maxImage){ wyha_currentImage = minImage; }else{ wyha_currentImage++; } }else{ if (wyha_currentImage==minImage){ wyha_currentImage = maxImage; }else{ wyha_currentImage--; } } sCurrImageDiv = sSeniorPic + wyha_currentImage; for (var x = 1; x<=maxImage ;x++) { sPicDivId = sSeniorPic + x; sStatDivId = sSeniorStat + x; sDisplay = (sCurrImageDiv == sPicDivId) ? 'block' : 'none'; document.getElementById(sPicDivId).style.display=sDisplay; document.getElementById(sStatDivId).style.display=sDisplay; } } var wyha_MiteCurrentImage = 1; function wyhaChangeMiteAChampsImage(direction) { var maxImage = 4; var minImage = 1; var sPicDivId = ""; var sMiteAPic = "mitesAPic"; if (direction=="next"){ if (wyha_MiteCurrentImage==maxImage){ wyha_MiteCurrentImage = minImage; }else{ wyha_MiteCurrentImage++; } }else{ if (wyha_MiteCurrentImage==minImage){ wyha_MiteCurrentImage = maxImage; }else{ wyha_MiteCurrentImage--; } } sCurrImageDiv = sMiteAPic + wyha_MiteCurrentImage; for (var x = 1; x<=maxImage ;x++) { sPicDivId = sMiteAPic + x; sDisplay = (sCurrImageDiv == sPicDivId) ? 'block' : 'none'; document.getElementById(sPicDivId).style.display=sDisplay; } } function wyhaChangeSummary(displaySection){ if (displaySection.lenth <2 || displaySection =='null'){ return; } var SummarySections = new Array(); SummarySections[0] ="wyha_hd_summary"; SummarySections[1] ="wyha_lts_summary"; SummarySections[2] ="wyha_md_summary"; SummarySections[3] ="wyha_pa_summary"; /* SummarySections[0] ="wyha_lts_summary"; SummarySections[1] ="wyha_md_summary"; SummarySections[2] ="wyha_pa_summary"; */ for (var x = 0; x<=SummarySections.length-1 ;x++) { if (String(SummarySections[x]).indexOf("_" + displaySection + "_")>=0){ sDisplay = 'block'; }else{ sDisplay = 'none'; } document.getElementById(SummarySections[x]).style.display=sDisplay; } } function wyhaChangeCHCtabs(displaySection){ if (displaySection.lenth <2 || displaySection =='null'){ return; } var TabSections = new Array(); TabSections[0] ="wyha_chc_main_mites_tab"; TabSections[1] ="wyha_chc_main_squirts_tab"; TabSections[2] ="wyha_chc_main_peewee_tab"; TabSections[3] ="wyha_chc_main_bantam_tab"; TabSections[4] ="wyha_chc_main_hd_tab"; TabSections[5] ="wyha_chc_main_all_tab"; for (var x = 0; x<=TabSections.length-1 ;x++) { if (String(TabSections[x]).indexOf("_" + displaySection + "_")>=0){ sClass = 'whya_chc_team_selected'; }else{ sClass = 'whya_chc_team_not_selected'; } setClass(TabSections[x], sClass); } } function wyhaChangeCHCschedule(displaySection){ if (displaySection.lenth <2 || displaySection =='null'){ return; } /* var SummarySections = new Array(); SummarySections[0] ="wyha_mites_schedule"; SummarySections[1] ="wyha_squirts_schedule"; SummarySections[2] ="wyha_peewee_schedule"; SummarySections[3] ="wyha_bantam_schedule"; SummarySections[4] ="wyha_hd_schedule"; SummarySections[5] ="wyha_all_schedule"; SummarySections[6] ="wyha_midget_schedule"; */ var SummarySections = new Array(); SummarySections[0] ="wyha_mites_schedule"; SummarySections[1] ="wyha_squirts_schedule"; SummarySections[2] ="wyha_peewee_schedule"; SummarySections[3] ="wyha_bantam_schedule"; SummarySections[4] ="wyha_hd_schedule"; SummarySections[5] ="wyha_all_schedule"; SummarySections[6] ="wyha_midget_schedule"; try{ for (var x = 0; x<=SummarySections.length-1 ;x++) { if (String(SummarySections[x]).indexOf("_" + displaySection + "_")>=0){ sDisplay = 'block'; }else{ sDisplay = 'none'; } document.getElementById(SummarySections[x]).style.display=sDisplay; } }catch(e){ } } function wyhaChangeCHCselection(displaySection){ if (displaySection.lenth <2 || displaySection =='null'){ return; } wyhaChangeCHCschedule(displaySection); wyhaChangeCHCtabs(displaySection); } function wyhaChangeMain(displaySection){ var sValidSections = "chc|md"; var mainSections = new Array(); mainSections[0] ="wyha_chc_main"; mainSections[1] ="wyha_md_main"; if (String(sValidSections.indexOf(displaySection)>=0)){ for (var x = 0; x<=mainSections.length-1 ;x++) { if (String(mainSections[x]).indexOf("_" + displaySection + "_")>=0){ sDisplay = 'block'; }else{ sDisplay = 'none'; } document.getElementById(mainSections[x]).style.display=sDisplay; } } } function wyhaChangeAll(displaySection){ var sValidMainSections = "chc|md"; var sValidSummSections = "chc|md|hd"; var sMainDefault ="chc"; if (sValidSummSections.indexOf(displaySection)>=0){ wyhaChangeSummary(displaySection); } if (sValidMainSections.indexOf(displaySection)>=0){ wyhaChangeMain(displaySection); }else{ wyhaChangeMain(sMainDefault); } } function setClass(objectID,newClass) { // league atheletics appears to be stripping out embedded class definitions // until I figure out a way around it exit out of here becuase the classes are stripped out and you'll get a null object reference return; //var object = document.getElementById(objectID); //object.className = newClass; } function wyhaChangeSchedule(schedule){ if (schedule.lenth <2 || schedule =='null'){ return; } var sDisplay = 'block'; var ScheduleIDs = new Array(); ScheduleIDs[0] ="wyha_midgets_schedule"; ScheduleIDs[1] ="wyha_peeweeA_schedule"; ScheduleIDs[2] ="wyha_peeweeB_schedule"; ScheduleIDs[3] ="wyha_batamA_schedule"; ScheduleIDs[4] ="wyha_batamB_schedule"; ScheduleIDs[5] ="wyha_squirtA_schedule"; ScheduleIDs[6] ="wyha_squirtB_schedule"; ScheduleIDs[7] ="wyha_mites_schedule"; ScheduleIDs[8] ="wyha_watertown_schedule"; ScheduleIDs[9] ="wyha_whalers_schedule"; ScheduleIDs[10] ="wyha_polarbears_schedule"; ScheduleIDs[11] ="wyha_wallingford_schedule"; ScheduleIDs[12] ="wyha_echo_schedule"; ScheduleIDs[13] ="wyha_western_schedule"; ScheduleIDs[14] ="wyha_northwestern_schedule"; ScheduleIDs[15] ="wyha_central_schedule"; ScheduleIDs[16] ="wyha_falcons_schedule"; ScheduleIDs[17] ="wyha_easthaven_schedule"; ScheduleIDs[18] ="wyha_bridgeport_schedule"; ScheduleIDs[19] ="wyha_tuesday_schedule"; ScheduleIDs[20] ="wyha_wednesday_schedule"; ScheduleIDs[21] ="wyha_friday_schedule"; ScheduleIDs[22] ="wyha_saturday_schedule"; ScheduleIDs[23] ="wyha_sunday_schedule"; for (var x = 0; x<=ScheduleIDs.length-1 ;x++) { if (String(ScheduleIDs[x])== schedule){ sDisplay = 'block'; }else{ sDisplay = 'none'; } document.getElementById(ScheduleIDs[x]).style.display=sDisplay; } }