function showIndoor() { swapCurrentFirstLayer("indoor_btn"); var target = document.getElementById('page_title'); target.innerHTML = 'Performance Lists / Indoor / Qualifying'; target = document.getElementById('tab_content'); var arrow = document.getElementById('indoor_btns'); target.innerHTML = arrow.innerHTML; showIndoorQual(); } function showIndoorQual() { swapCurrentFirstLayer("indoor_btn"); var target = document.getElementById('page_title'); target.innerHTML = 'Performance Lists / Indoor / Qualifying'; target = document.getElementById('tab_content'); var arrow = document.getElementById('indoor_btns'); target.innerHTML = arrow.innerHTML; ids = ['49_0', '50_0' , '51_0', '48_0', '53_0']; for(var x = 0; x < ids.length; x++) { arrow = document.getElementById(ids[x]); target.innerHTML = target.innerHTML + arrow.innerHTML; } swapCurrentSecondLayer("qual_btn_In"); } function showOutdoor() { swapCurrentFirstLayer("outdoor_btn"); var target = document.getElementById('page_title'); target.innerHTML = 'Performance Lists / Outdoor '; target = document.getElementById('tab_content'); var arrow = document.getElementById('outdoor_btns'); target.innerHTML = arrow.innerHTML; showOutdoorQual(); } function showOutdoorQual() { swapCurrentFirstLayer("outdoor_btn"); var target = document.getElementById('page_title'); target.innerHTML = 'Performance Lists / Outdoor / Qualifying'; var target = document.getElementById('tab_content'); var arrow = document.getElementById('outdoor_btns'); target.innerHTML = arrow.innerHTML; ids = ['1425_1', '1426_1', '49_1', '50_1' , '51_1', '48_1', '53_1']; for(var x = 0; x < ids.length; x++) { arrow = document.getElementById(ids[x]); target.innerHTML = target.innerHTML + arrow.innerHTML; } swapCurrentSecondLayer("qual_btn_Out"); } var map; function callback(cb) { map = cb; } function swimStart(callback,error) { swapCurrentFirstLayer("swimming_btn"); var target = document.getElementById('page_title'); target.innerHTML = 'Performance Lists / Swimming'; var target = document.getElementById('tab_content'); target.innerHTML = "
"; callback(); } function showSwimming() { swimStart(function(){ //success function var iter = 0, arrow, target = document.getElementById('tab_content'); while(1) { try{ arrow = document.getElementById('swimming_'+iter); target.innerHTML = target.innerHTML + arrow.innerHTML; iter++; } catch(err) { break; } } }, function(){ //error function alert("a problem occurred"); }); } function hsStart(callback, error) { swapCurrentFirstLayer("hs_btn"); var target = document.getElementById('page_title'); target.innerHTML = 'Performance Lists / High School'; var target = document.getElementById('tab_content'); target.innerHTML = "
"; callback(); } function showHS() { hsStart(function(){ //success function var iter = 0, arrow, target = document.getElementById('tab_content'); while(1) { try{ arrow = document.getElementById('hs_'+iter); target.innerHTML = target.innerHTML + arrow.innerHTML; iter++; } catch(err) { break; } } }, function(){ //error function alert("a problem occurred"); }); } function showDiv(buttons, tag, current) { var target = document.getElementById('page_title'); target.innerHTML = 'Performance Lists / ' + capFirst(buttons) + ' / ' + tag; target = document.getElementById('tab_content'); var arrow = document.getElementById(buttons + '_btns'); target.innerHTML = arrow.innerHTML; if (tag == "Div I" && buttons == "outdoor") { ids = ['62_1', '61_1', '1462_1', '60_1', '56_1', '59_1', '1463_1', '63_1', '64_1', '65_1', '66_1', '1427_1', '68_1', '67_1', '69_1', '1433_1', '55_1', '79_1', '256_1', '70_1', '71_1', '83_1', '57_1', '1377_1', '73_1', '254_1', '94_1', '74_1', '78_1', '72_1', '80_1', '47_1', '76_1', '98_1', '75_1', '77_1', '81_1']; } else if (tag == "Div II" && buttons == "outdoor") { ids = ['1427_1', '1430_1', '1394_1', '1382_1', '1383_1', '1384_1', '1461_1', '1386_1', '1385_1', '1392_1', '256_1', '1387_1', '254_1', '1388_1', '1389_1', '1453_1', '1458_1', '252_1', '1390_1', '1393_1', '1391_1', '1465_1']; } else if (tag == "Div III" && buttons == "outdoor") { ids = ['1427_1', '1395_1', '1430_1', '1396_1', '1398_1', '1397_1', '1367_1', '1435_1', '255_1', '253_1', '1399_1', '1373_1', '1400_1', '1401_1', '1402_1', '1403_1', '1404_1', '256_1', '1405_1', '1406_1', '1407_1', '1408_1', '254_1', '16_1', '1409_1', '1410_1', '1411_1', '1412_1', '1413_1', '1421_1', '1414_1', '1415_1', '1416_1', '1356_1', '1436_1', '1438_1', '1454_1', '1417_1', '1418_1', '1420_1', '1419_1']; } else if (tag == "NAIA" && buttons == "outdoor") { ids = ['1470_1', '1439_1', '1434_1', '1423_1', '1440_1', '1424_1', '1437_1', '1446_1', '1456_1']; } else if (tag == "Junior Colleges" && buttons == "outdoor") { ids = ['jcollege_1','33_1','144_1', '145_1', '34_1', '24_1','258_1', '21_1', '25_1', '26_1', '28_1', '27_1', '22_1', '29_1', '30_1', '23_1', '31_1', '32_1']; } else if (tag == "Div I" && buttons == "indoor") { ids = ['62_0', '61_0', '1462_0', '60_0', '56_0', '59_0', '1463_0', '63_0', '64_0', '65_0', '66_0', '1427_0', '68_0', '67_0', '69_0', '1433_0', '55_0', '79_0', '256_0', '70_0', '71_0', '83_0', '57_0', '1377_0', '73_0', '254_0', '94_0', '74_0', '78_0', '72_0', '80_0', '47_0', '76_0', '98_0', '75_0', '77_0', '81_0']; } else if (tag == "Div II" && buttons == "indoor") { ids = ['1427_0', '1430_0', '1394_0', '1382_0', '1383_0', '1384_0', '1461_0', '1386_0', '1385_0', '1392_0', '256_0', '1387_0', '254_0', '1388_0', '1389_0', '1453_0', '1458_0', '252_0', '1390_0', '1393_0', '1391_0', '1465_0']; } else if (tag == "Div III" && buttons == "indoor") { ids = ['1427_0', '1395_0', '1430_0', '1396_0', '1398_0', '1397_0', '1367_0', '1435_0', '255_0', '253_0', '1399_0', '1373_0', '1400_0', '1401_0', '1402_0', '1403_0', '1404_0', '256_0', '1405_0', '1406_0', '1407_0', '1408_0', '254_0', '16_0', '1409_0', '1410_0', '1411_0', '1412_0', '1413_0', '1421_0', '1414_0', '1415_0', '1416_0', '1356_0', '1436_0', '1438_0', '1454_0', '1417_0', '1418_0', '1420_0', '1419_0']; } else if (tag == "NAIA" && buttons == "indoor") { ids = ['1470_0', '1439_0', '1434_0', '1423_0', '1440_0', '1424_0', '1437_0', '1446_0', '1456_0']; } else if (tag == "Junior Colleges" && buttons == "indoor") { ids = ['jcollege_0','33_0','144_0', '145_0', '34_0', '24_0','258_0', '21_0', '25_0', '26_0', '28_0', '27_0', '22_0', '29_0', '30_0', '23_0', '31_0', '32_0']; } for(var x = 0; x < ids.length; x++) { arrow = document.getElementById(ids[x]); if (arrow) { target.innerHTML = target.innerHTML + arrow.innerHTML; } } swapCurrentSecondLayer(current); } function capFirst(string) { return string.charAt(0).toUpperCase() + string.slice(1); } function swapCurrentFirstLayer(id) { var ids = ['indoor_btn', 'outdoor_btn', 'swimming_btn', 'hs_btn']; for(var x = 0; x < ids.length; x++) { document.getElementById(ids[x]).className = "not_current"; } document.getElementById(id).className = "current_btn"; //$(id).attr("class","current_btn"); } function showComm(season) { var target = document.getElementById('page_title'); if(season == "outdoor") { target.innerHTML = 'Performance Lists / Outdoor / Junior Colleges'; document.getElementById('cc_btn_Out').className = "current_btn"; var arrow = document.getElementById('outdoor_btns'); var ids = ['NWAACCOutdoorTrack&FieldSeason', 'USComm.Col.TrackCoachesAssn.Rankings', 'CaliforniaComm.CollegeOutdoorTrackSeason', 'NJCAAOutdoorQualifyingList', 'NCCAAOutdoorQualifyingList']; } else { target.innerHTML = 'Performance Lists / Indoor / Junior Colleges'; swapCurrentSecondLayer("cc_btn_In"); var arrow = document.getElementById('indoor_btns'); var ids = ['NWAACCOutdoorTrack&FieldSeason', 'USComm.Col.TrackCoachesAssn.Rankings', 'CaliforniaComm.CollegeOutdoorTrackSeason']; } var target = document.getElementById('tab_content'); target.innerHTML = arrow.innerHTML; for(var x = 0; x < ids.length; x++) { arrow = document.getElementById(ids[x]); target.innerHTML = target.innerHTML + arrow.innerHTML; } } function swapCurrentSecondLayer(id) { var ids = ['qual_btn_Out', 'd1_btn_Out', 'd2_btn_Out', 'd3_btn_Out', 'naia_btn_Out', 'cc_btn_Out']; for(var x = 0; x < ids.length; x++) { //$(ids[x]).attr("class","not_current"); document.getElementById(ids[x]).className = "not_current"; } //var ele = document.getElementById(id); //ele.setAttribute('class', 'current_btn'); //$(id).attr("class","newclass"); document.getElementById(id).className = "current_btn"; }