(function() { // Localize jQuery variable var jQuery, _domain = document.domain; /******** Load jQuery if not present *********/ if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.7.1') { var script_tag = document.createElement('script'); script_tag.setAttribute("type","text/javascript"); script_tag.setAttribute("src","https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"); // var script_tag_tmpl = document.createElement('script'); // script_tag_tmpl.setAttribute("type","text/javascript"); // script_tag_tmpl.setAttribute("src","https://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"); if (script_tag.readyState) { script_tag.onreadystatechange = function () { // For old versions of IE if (this.readyState == 'complete' || this.readyState == 'loaded') { scriptLoadHandler(); } }; } else { script_tag.onload = scriptLoadHandler; } // Try to find the head, otherwise default to the documentElement (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag); // (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag_tmpl); } else { // The jQuery version on the window is the one we want to use jQuery = window.jQuery; main(); } /******** Called once jQuery has loaded ******/ function scriptLoadHandler() { // Restore $ and window.jQuery to their previous values and store the // new jQuery in our local jQuery variable jQuery = window.jQuery.noConflict(true); // Call our main function main(); } /******** Our main function ********/ function main() { var ResultsLib = (function () { var pub={},_apir="https://alaska-api.athlinks.com/",_badgePath="",_isStartlistLoad=false,_view="",_mode='o';_classid='';_hasPhotos=true,_isResLoad=false,_isRaceLoad=false,_Millisecond=10,_Second=1e3,_Minute=6e4,_Hour=36e5,_Day=864e5,_race=undefined,_affid=0,_spid="",_raceid=0,_courseid=0,_coursename='',_colspan=10,_cpid=0,_cpname="",_pageSize=100,_page=1,_gender="m",_term="",_entryid=0,_strPaging=undefined,_msgLoading='
',_pageContent=''; pub.Setup=function(){jQuery("#athlinks-raceresult-widget").html(_pageContent)} pub.GetRaceList = function (affid,y,a,m,c) { _affid = affid; _y = 2022, _gender = "a", _page = 1, _term = '', _classid = c, _mode = m; var hasResults = 1; Inject("athlinks-race-info",""); Inject("athlinks-results-info",""); Inject("athlinks-fields",""); jQuery("#resTbl").css({opacity:.25}); var results = '
', cY = 0; var url = _apir + "Groups/Races/" + _affid + "?page=1&pagesize=256&startdate=1/1/"+ (a===true?_y:1753) +"&enddate=12/31/" + (a===true?_y:2999) + "&key=fa66a5aa758736f64e21a0811ab0f84f&hasresults=" + hasResults + "&stateprov=&country=&format=json&callback=?"; jQuery.getJSON(url,function(data){ jQuery.each(data.List, function(index, value){ var y = new Date(parseInt(this.RaceDate.substr(6))).getFullYear(); var link = ( new Date(parseInt(this.RaceDate.substr(6))) > new Date() ) ? "Check back for results." : (this.ResultCount > 0 ? this.ResultCount + " Results" : "Results Pending"); if(cY!==y){cY=y;results+='

' + cY + ' Results

';} results += '

' + this.RaceName + '

' + this.Home + '
' + FormatJSONDate(this.RaceDate) + ' - ' + link + '
'; }); results += '
'; Inject("athlinks-results-info",results); }); }; pub.GetTeamResults = function(raceID, page){ jQuery("#resTbl").css({opacity:.25}); _raceid = raceID; _page = page; var url = _apir + "results/list/" + _raceid + "/teams/?key=fa66a5aa758736f64e21a0811ab0f84f&courseid=" + _courseid + "&gender=&page=" + _page + "&pageSize=" + _pageSize + "&format=json&callback=?"; jQuery.getJSON(url,function(data){ Inject("athlinks-fields",""); _strPaging = GenerateTeamPaging(data); var results = '

Rules for Team Rankings:

'; results += _strPaging + ''; jQuery.each(data.List, function(index, value){ results += ''; }); results += '
RankTeam NameTeam SizeTime
' + this.Rank + '' + this.TeamName + '' + this.MemberCount + '' + this.Time + '
' + _strPaging; Inject("athlinks-results-info",results); track('fa66a5aa758736f64e21a0811ab0f84f','resultslist/TeamResults','raceid:'+_raceid+';page='+_page); }); }; pub.GetRace = function(rmode, mastereventid, raceID, courseID, page, gender, term, entryid, mode, classid){ jQuery("#raceList").hide(); _mastereventid = mastereventid; _raceid = raceID; _courseid = courseID; _page = page; _gender = gender; _term = term; _entryid = entryid; _classid = classid; _mode = mode; var c = ''; var url = _apir + "races/" + _raceid + "?format=json&key=fa66a5aa758736f64e21a0811ab0f84f&callback=?"; if( typeof _race === "undefined" || _isRaceLoad == false || courseID === 0 ){ jQuery.getJSON(url,function(data){ _spid = jQuery.trim(data.StateProvID); if( courseID === 0 ){ _courseid = courseID = data.Courses[0].CourseID; _cpid = data.Courses[0].CoursePatternID; _cpname = data.Courses[0].CoursePattern; } _race = data; _badgePath = data.Badge.Path; c = '
Show All Races

' + data.RaceName + '

' + (( data.City !== "" ) ? data.City + ", " : "" ) + data.StateProvName + ', ' + data.CountryID3 + ' — ' + FormatJSONDate(data.RaceDate) + '
' + GenerateCourseList(data, courseID) + '
'; Inject("athlinks-race-info",c); track('fa66a5aa758736f64e21a0811ab0f84f','resultslist/GetRace','raceid:'+_raceid); _isRaceLoad = true; var parms = {"mastereventid":_mastereventid,"courseid":_courseid,"gender":_gender,"page":_page}; jQuery.bbq.pushState(parms); if(_courseid>0){ /// Is there a way to block this from firing if not new page? ResultsLib.GetResults(_raceid, _courseid, _gender, _page, _term, _entryid); } }); return; } if( rmode === "i" ){ ResultsLib.GetResults(_raceid, _courseid, _gender, _page, _term, _entryid); } else { ResultsLib.GetTeamResults(_raceid, _page); } }; pub.GetStartList = function( raceid, courseid, page ){ if( _isStartlistLoad === false ){ Inject("athlinks-startlist",_msgLoading); }else{ jQuery("#startListTbl").css({opacity:.25}); } _raceid = raceid; _courseid = courseid === 0 ? _courseid : courseid; _page = page; var url = _apir + "races/startlist/" + _raceid + "?&page=" + _page + "&pagesize=" + _pageSize + "&format=json&key=fa66a5aa758736f64e21a0811ab0f84f&callback=?"; jQuery.getJSON(url, function(data) { Inject("athlinks-startlist", ResultsLib.LoadStartList(data)); jQuery('html, body').animate({scrollTop: jQuery("#athlinks-race-info").offset().top}, 200); }); }; pub.GetResults = function(raceid, courseid, gender, page, term, entryid){ if( new Date(parseInt(_race.RaceDate.substr(6))) > new Date() ){ _view = "start"; pub.GetStartList(raceid, courseid, page); return; } _view = "results"; if(_isResLoad===false){ Inject("athlinks-results-info",_msgLoading); }else{ jQuery("#resTbl").css({opacity:.25}); } _raceid = raceid; _courseid = courseid === 0 ? _courseid : courseid; _gender = gender; _page = page; _term = (term === undefined) ? '' : term.trim(); var url = _apir + "results/list/" + _raceid + "/" + _courseid + "/" + _gender + "?mode=" + _mode + "&classid=" + _classid + "&term=" + term + "&page=" + _page + "&pageSize=" + _pageSize + "&format=json&key=fa66a5aa758736f64e21a0811ab0f84f&callback=?"; jQuery.getJSON(url, function(data) { Inject("athlinks-results-info",ResultsLib.LoadResults(data)); if(_term !== ''){jQuery("#tbAL_Search").trigger("keyup");jQuery("#btnAL_Clear").show();}; jQuery('html, body').animate({scrollTop: jQuery("#athlinks-race-info").offset().top}, 200); // Now load the result pub.DrawDetailOptions(jQuery("#resrow_"+_entryid)); }); }; pub.LoadResults = function (data) { if(_term === '' && data.RaceEntries.MasterCount === 0 && data.ResultCount === 0){ return "

Results are not yet available.

"; }else{ _cpid = data.CoursePatternID; _cpname = data.CoursePattern; _colspan = 8 + (data.LegCount === 1 ? 2 : data.LegCount*2 + 1); _strPaging = GeneratePaging(data,_mode); _coursename = jQuery("#lstCourses option:selected").text(); Inject("athlinks-fields",""); var results = '
Name or Bib:
'; if(_term===''){results += _strPaging;} results += ''; jQuery.each(data.Legs, function(index, value){ if( data.LegCount > 1 ){ results += ''; } }); results += ''; jQuery.each(data.RaceEntries.List, function(index, value){ results += ''; jQuery.each(this.LegEntries, function(leIx, leVal){ if( data.LegCount > 1 ){ results += ''; } }); results += ''; }); results += '
Plc OPlc GPlc AAthleteTeam NameSex-AgeBib' + this.ActionCatName + 'Final
' + (this.IsMember===true?"":DrawClaim(this.DisplayName,this.Age,_spid)) + '' + this.RankO + '' + this.RankG + '' + this.RankA + '' + this.Sponsor + '' + this.Gender + '-' + ( this.Age > 0 ? this.Age : "-" ) + '' + ( this.BibNum === '' ? '-' : this.BibNum ) + '' + this.TicksString + '' + this.TicksString + '
'; if(_term===''){results += _strPaging;} track('fa66a5aa758736f64e21a0811ab0f84f','resultslist/loadresults','raceid:'+_raceid+';courseid:'+_courseid+';gender:'+_gender+';term='+_term+';page='+_page); _isResLoad = true; return results; } }; pub.LoadStartList = function (data) { if(_term === '' && data.StartListEntries.MasterCount === 0 ){ return "

Start List not yet available.

"; }else{ _strPaging = GenerateStartPaging(data); _spid = jQuery.trim(data.Race.StateProvID); var results = '

Start List: ' + data.Race.RaceName + '

'; jQuery.each(data.StartListEntries.List, function(index, value){ var spid = (value.Athlete.StateProvID == null || value.Athlete.StateProvID == '' ) ? _spid : value.Athlete.StateProvID, age = value.Athlete.Age, yob = age == 0 ? 40 : value.Athlete.Age; results += ''; }); results += '
AthleteSex-AgeRaces@ DistP.R.Goal
' + (value.Athlete.IsMember===true?"":DrawClaim(value.Athlete.DisplayName,age,spid)) + '' + value.Athlete.Gender + '' + (age == 0 ? '-' : age) + '' + value.Athlete.ResultCount + '' + value.RaceCountAtDist + '' + (value.BestTicks>0?value.BestTime:"-") + '' + value.SelfTime + '
+
' + _strPaging; _isStartlistLoad = true; track('fa66a5aa758736f64e21a0811ab0f84f','resultslist/startlist','raceid:'+_raceid+';courseid:'+_courseid+';'); return results; } }; pub.DrawDetailOptions = function(row){ var icocell = jQuery(row).find(".member"), icohtml = icocell.html(); icocell.html(_msgLoading); jQuery("#resTbl").find(".rowED").fadeOut(600); var i = row.id; if( row.next().attr('class') === 'rowED' ){ row.next().fadeIn(300); icocell.html(icohtml); return; } var meid = row.find("#fldMEID").val(), evid = row.find("#fldEVID").val(), ecid = row.find("#fldECID").val(), bib = row.find("#fldBib").val(); var dn = row.find("#fldDN").val(), racerID = row.find("#fldRID").val(), isMember = ( row.find("#fldIsMember").val() === 'true' ), entryID = row.find("#fldEID").val(), ticks = undefined, isLoad = row.find("#fldLoad").val()!=="false"; if(_view==="results"){ ticks = row.find("#fldTicks").val(); bib = row.find("#fldBib").val(); } var galTab = '', galCont = ''; var optsRow = jQuery('
'); // When we bring Stats back, we can reenable this tab setup. //var tabsRow = jQuery('
' + galCont + '
'); var tabsRow = jQuery('
'); var ai = optsRow.find("#divAI"); if(_view==="results"){ ai.after(tabsRow); pub.GetAthleteDetails(optsRow,racerID,entryID); pub.GetResultsListForAthlete(optsRow, racerID, entryID); pub.GetEntryDetail(optsRow, racerID, entryID, ticks, bib, meid, evid, ecid); }else{ if(isMember===false){ var claim = DrawClaimED(_view,dn,racerID,entryID, meid, evid, ecid, bib); ai.prepend(claim); var a = parseInt(row.find("#fldAge").val()), s = row.find("#fldSP").val(); pub.SearchAthlete(optsRow.find("#divAI"),dn,a,s); if(isLoad===false){ icocell.html(icohtml); row.after(optsRow); return; } }else{ ai.after(tabsRow); pub.GetResultsListForAthlete(optsRow, racerID, entryID); pub.GetSLEntryDetail(jQuery(optsRow).find("#tabED_"+entryID), entryID); } } row.after(optsRow); icocell.html(icohtml); pub.TabIt2(optsRow.find(".athlinkstabs")); var o=0; var row = jQuery("#resrow_"+_entryid); if(row.length>0){ jQuery("html, body").animate({scrollTop: row.position().top}, 200); } }; pub.SearchAthlete = function(row,dn,ag,sp){ sp=''; var url = _apir + 'results/search/' + encodeURIComponent(dn) + '/' + (ag-5) + '-' + (ag+5) + '/' + sp + '?format=json&key=fa66a5aa758736f64e21a0811ab0f84f&callback=?'; jQuery.getJSON(url,function(data){ var year=0; var rows='
Found ' + data.MasterCount + ' Results. matching "' + dn + '"
You can CLAIM or SHARE these results.
'; jQuery.each(data.List, function(index, value){ var race = value.Race; var y=eval(race.RaceDate.replace(/\/Date\((\d+(-\d+)?)\)\//gi,"new Date($1)")).getFullYear(); if(year!==y){ year=y; rows+='" } rows+='" }); rows+="
'+y+"
'+FormatJSONDate(value.Race.RaceDate,"m")+''+value.Race.StateProvAbbrev+''+(parseInt(value.Age)>0?value.Age:"-")+''+value.TicksString+"
"; row.append(rows); }); }; pub.GetAthleteDetails = function(row,racerID,entryID){ if(!racerID){ return; } var r = jQuery(row).find("#divAI"); r.html(_msgLoading); var url = _apir + "athletes/" + racerID + "?format=json&key=fa66a5aa758736f64e21a0811ab0f84f&callback=?"; jQuery.getJSON(url,function(data){ r.html(pub.RenderProfile(data,entryID)); }); }; pub.RenderProfile = function(data,entryid){ if(data.IsMember===true){ return '
' + data.DisplayName + '
' + parseGender(data.Gender) + ', ' + data.Age + ' | ' + pub.ToHomeString(data.City,data.StateProvAbbrev,data.CountryID3) + '
'; }else{ return '
' + data.DisplayName + '
' + parseGender(data.Gender) + ', ' + data.Age + ' | ' + pub.ToHomeString(data.City,data.StateProvAbbrev,data.CountryID3) + '
'; } }; pub.GetSLEntryDetail = function(row,entryID){ url = _apir + "races/getstartlistentry/" + _raceid + "?entryid=" + entryID + "&format=json&key=fa66a5aa758736f64e21a0811ab0f84f&callback=?"; var cell = jQuery(row).children(".cnvs"); cell.html(_msgLoading); jQuery.getJSON(url,function(data){ var r = data.BestRaceAtDistance; var summary = data.Summary; var summ = '
' + data.Athlete.DisplayName + ' statistics at "' + summary.CoursePatternName + '" Race Distance:
RacesScore
A' + (summary.RatingA===100?'-':summary.RatingA) + '
G' + (summary.RatingG===100?'-':summary.RatingG) + '
O' + (summary.RatingO===100?'-':summary.RatingO) + '
BestAverage
' + summary.Count + '
' + (summary.RatingM===100?'-':summary.RatingM) + '
' + summary.BestString + '
' + summary.AverageString + '
'; cell.html('
Race Statistics
' + summ + '
'); }); }; pub.GetEntryDetail = function(row,racerID,entryID,ticks,bib, meid, evid, ecid){ if(!racerID){ return; } var url = _apir + "results/" + entryID + "?key=fa66a5aa758736f64e21a0811ab0f84f&format=json&callback=?"; var detTable = jQuery('
'); var entryData; url = _apir + "athletes/results/" + racerID + "/" + _cpid + "/summary?format=json&key=fa66a5aa758736f64e21a0811ab0f84f&callback=?"; var icocell = jQuery(row).find("#tabED_"+entryID).children(".cnvs"); var infocell = row.find("#divAI"); icocell.html(_msgLoading); jQuery.getJSON(url,function(data){ if(data.Athlete.IsMember===false){ //https://athlinks.com/signup.aspx?ReturnUrl=%2fclaimworksheet.aspx%3fsearch%3dAthlete%26term%3drobert%2520byrd%26showmembers%3dtrue%26mode%3dclaim //https://www.athlinks.com/event/339916/results/Event/930935/Course/1892077/Bib/u57 infocell.append(DrawClaimED(data,data.Athlete.DisplayName,data.Athlete.RacerID,entryID,meid,evid,ecid,bib)); infocell.find("#divClaim").slideDown('fast'); return; } detTable.find("#stats").replaceWith('
' + data.Athlete.DisplayName + ' statistics at "' + _cpname + '" Race Distance:
RacesAthlinks
Score
A' + (data.RatingA===100?'-':data.RatingA) + '
G' + (data.RatingG===100?'-':data.RatingG) + '
O' + (data.RatingO===100?'-':data.RatingO) + '
BestThisAverageThis
' + data.Count + '
' + (data.RatingM===100?'-':data.RatingM) + '%
' + data.BestString + '
' + pub.RenderDiff(ticks,data.BestTicks,true) + '
' + data.AverageString + '
' + pub.RenderDiff(ticks,data.AverageTicks,true) + '
'); }); icocell.html(detTable); track('fa66a5aa758736f64e21a0811ab0f84f','resultslist/EntryDetail','raceid:'+_raceid+';racerid='+racerID+';cpid='+_cpid); }; pub.GetResultsListForAthlete = function(row,racerID,entryID){ if(!racerID){ return; } var url = _apir + "athletes/results/" + racerID + "?limitAff=false&format=json&key=fa66a5aa758736f64e21a0811ab0f84f&callback=?"; var icocell = jQuery(row).find("#tabRes_"+entryID).children(".cnvs"); icocell.html(_msgLoading); jQuery.getJSON(url,function(data){ var newRow = '
Athlinks Race History
' + DrawRL(data) + '
'; icocell.html(newRow); }); track('fa66a5aa758736f64e21a0811ab0f84f','resultslist/AthleteResults','raceid:'+_raceid+';racerid='+racerID); }; pub.ToHomeString=function(a,b,c){var d="";if(c!==""){d=c;if(a!==""||b!==""){d=", "+d}}if(b!==""){d=b+d;if(a!==""){d=", "+d}}if(a!==""){d=a+d}return d} pub.RenderDiff=function(a,b,c){var d=c===true?"Green":"Red",e=c===true?"Red":"Green",f="";a=Math.floor(a);if(b){b=Math.floor(b)}else{b=Math.floor(_ticks)}var g=pub.TicksToTime(Math.abs(Math.floor(b)-Math.floor(a)));if(b>a){f='
'+(c===false?"+":"-")+g+"
"}else if(a>b){f='
'+(c===false?"-":"+")+g+"
"}else{f='
—
'}return f} pub.TicksToTime=function(a,b){var c=0,d=0,e=0,f=0,g=0,h="";a=Math.floor(a);c=GetDayInTicks(a);a=a-c*_Day;d=GetHourInTicks(a);a=a-d*_Hour;e=GetMinuteInTicks(a);a=a-e*_Minute;f=GetSecondInTicks(a);a=a-f*_Second;g=GetMSInTicks(a);a=a-g*_Millisecond;if(g===100){g=0;f+=1}if(f===60){f=0;e+=1}if(e===60){e=0;d+=1}if(d===24){d=0;c+=1}if(c>0){h+=("0"+c).substr(0,2)+":"}if(d>0||c>0){if(d<10){h+=d+":"}else{h+=("0"+d).substr(0,2)+":"}}if(a>_Minute*5){h+=zeroPad(e,2)+":"+zeroPad(f,2)}else{h+=zeroPad(e,2)+":"+zeroPad(f,2);if(g!=0&&b===true){h+="."+g}}return h} pub.SafeHash=function(a,b){return a===undefined?b:a} pub.TabIt2=function(a){jQuery(a).each(function(){var a,b,c=jQuery(this).find("a");a=jQuery(c.filter('[href="'+location.hash+'"]')[0]||c[0]);a.addClass("active");b=jQuery(a.attr("href"));c.not(a).each(function(){jQuery(jQuery(this).attr("href")).hide()});jQuery(this).delegate("a","click",function(c){a.removeClass("active");b.hide();a=jQuery(this);b=jQuery(jQuery(this).attr("href"));a.addClass("active");b.show();c.preventDefault()})})} // onError event handler function onError(event) { alert('An error has occured' + ': ' + event.errorCode + '; ' + event.errorMessage); } function parseGender(val) { switch(val){ case 'M': return 'Male'; case 'F': return 'Female'; default: return 'Unspecified'; } } // onSendDone event handler. // Displays in the status field, the list of providers to which the newsfeed has been // successfully published. function onSendDone(event) { document.getElementById('status').style.color = "green"; switch(event.context) { case 'multiSelect': document.getElementById('status').innerHTML = 'The newsfeed has been posted to: ' + event.providers; break; case 'simpleShare': document.getElementById('status').innerHTML = 'Clicked ' + event.providers; break; default: document.getElementById('status').innerHTML = 'Share onSendDone' ; } } function Place(p){ p = Math.floor(p); switch(p){ case 10: case 11: case 12: case 13: return p + 'th'; } p = ''+p; switch(p.substring(p.length-1)){ case "1": return p+'st'; case "2": return p+'nd'; case "3": return p+'rd'; default: return p+'th'; } return p; } function DrawClaimED(z,a,b,c, meid, evid, ecid, bib){return ''} function DrawRL(data){var year=0;var rows='';jQuery.each(data.List,function(index,value){var y=eval(value.Race.RaceDate.replace(/\/Date\((\d+(-\d+)?)\)\//gi,"new Date($1)")).getFullYear();if(year!==y){year=y;rows+='"}rows+='"});rows+="
'+y+"
'+FormatJSONDate(value.Race.RaceDate,"m")+''+value.Race.StateProvAbbrev+''+value.RankO+''+value.RankG+''+value.RankA+''+value.TicksString+"
";return rows} function RenderGrad(a){var b="",c="",d="",e=parseInt(a<50?"00":"cc",16),f=parseInt(a<50?"aa":"00",16),g=parseInt(a<50?"00":"00",16),h=parseInt(a<50?"ff":"ff",16),i=parseInt(a<50?"cc":"cc",16),j=parseInt(a<50?"33":"33",16),k="",l="",m="";if(a>=50){a=100-a;k=Math.round(Math.abs(e-h)*.01*a*2),l=Math.round(Math.abs(f-i)*.01*a*2),m=Math.round(Math.abs(g-j)*.01*a*2)}else{a=a*2;k=Math.round(Math.abs(e-h)*.01*a),l=Math.round(Math.abs(f-i)*.01*a),m=Math.round(Math.abs(g-j)*.01*a)}b=GetColor(e>h?e-k:e+k);c=GetColor(f>i?f-l:f+l);d=GetColor(g>j?g-m:g+m);return"#"+b+c+d} function GetColor(a){if(a<16){return"0"+a.toString(16)}return a.toString(16)} function RaceURL(a,b){return a.replace("%%raceid%%",b)} function StarterLink(a,b,c){return b===true?a:'
'+a+"
"} function RacerLink(a,b,c,d){return b===true?a:''+a+""} function GenerateCourseList(a,b){var c="";jQuery.each(a.Courses,function(a,d){c+='"});return'"} function Inject(a,b){jQuery("#"+a).html(b)} function FormatJSONDate(jsonDate,mode){mode=mode===undefined?"t":mode;var date=eval(jsonDate.replace(/\/Date\((\d+(-\d+)?)\)\//gi,"new Date($1)"));switch(mode){case"f":return dateFormat(date,"ddd, mmm ddS, yyyy");case"t":return dateFormat(date,"mm/dd/yy");case"y":return dateFormat(date,"yyyy");case"m":return dateFormat(date,"mm/dd")}} function GenerateGenderList(a){var b="";jQuery.each(a.GenderCounts,function(a,c){b+='"});return'"} function GenerateTeamPaging(a){var b="
There were "+a.MasterCount+" Teams!
",c="",d="";totPg=1+Math.floor(a.MasterCount/_pageSize);if(_page>1){d=''}for(var e=1;e<=totPg;e++){b+='"}if(_pageNext'}return'
Show Team:
"} function GenerateStartPaging(a){var b="",c="",d="",e=0,f=false,g=false;k=a.StartListEntries.MasterCount;e=Math.floor(k/_pageSize)+(k%_pageSize===0?0:1);if(_page>1){c=''}for(var h=1;h<=e;h++){b+='";}if(_pageNext →'}return'
"} function GeneratePaging(a){ var b="", c="", d="", e=0, f=false, g=false, h=''; h = '
View By:
'; }else{ if(a.GenderCounts.length===2){ jQuery.each(a.GenderCounts,function(){ if(_gender.toUpperCase()===this.Gender.toUpperCase()){ f=true; } if(this.Gender.toUpperCase()==="U"){ g=true; } }) } if(g===true&&f===false){ _gender="U"; } jQuery.each(a.GenderCounts,function(){ if(this.Gender.toUpperCase()===_gender.toUpperCase()&&this.Count>_pageSize){ e=1+Math.floor(this.Count/_pageSize); if(_page>1){ c='' } for(var a=1;a<=e;a++){ b+='" } if(_pageNext' } } }); return h+GenerateGenderList(a,_gender)+(b===""?"":c+'"+d)+"
" } } function DrawClaim(a,b,c){return'Claim'} function Smaller(a,b){return a>b?b:a} function zeroPad(a,b){var c=a+"";while(c.length_Millisecond?a/_Millisecond:0)} function GetSecondInTicks(a){return Math.ceil(a>_Second?a/_Second:0)} function GetMinuteInTicks(a){return Math.floor(a>_Minute?a/_Minute:0)} function GetHourInTicks(a){return Math.floor(a>_Hour?a/_Hour:0)} function GetDayInTicks(a){return Math.floor(a>_Day?a/_Day:0)} var dateFormat = function () { var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, timezoneClip = /[^-+\dA-Z]/g, pad = function (val, len) { val = String(val); len = len || 2; while (val.length < len) val = "0" + val; return val }; return function (date, mask, utc) { var dF = dateFormat; if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) { mask = date; date = undefined } date = date ? new Date(date) : new Date; if (isNaN(date)) throw SyntaxError("invalid date"); mask = String(dF.masks[mask] || mask || dF.masks["default"]); if (mask.slice(0, 4) == "UTC:") { mask = mask.slice(4); utc = true } var _ = utc ? "getUTC" : "get", d = date[_ + "Date"](), D = date[_ + "Day"](), m = date[_ + "Month"](), y = date[_ + "FullYear"](), H = date[_ + "Hours"](), M = date[_ + "Minutes"](), s = date[_ + "Seconds"](), L = date[_ + "Milliseconds"](), o = utc ? 0 : date.getTimezoneOffset(), flags = { d: d, dd: pad(d), ddd: dF.i18n.dayNames[D], dddd: dF.i18n.dayNames[D + 7], m: m + 1, mm: pad(m + 1), mmm: dF.i18n.monthNames[m], mmmm: dF.i18n.monthNames[m + 12], yy: String(y).slice(2), yyyy: y, h: H % 12 || 12, hh: pad(H % 12 || 12), H: H, HH: pad(H), M: M, MM: pad(M), s: s, ss: pad(s), l: pad(L, 3), L: pad(L > 99 ? Math.round(L / 10) : L), t: H < 12 ? "a" : "p", tt: H < 12 ? "am" : "pm", T: H < 12 ? "A" : "P", TT: H < 12 ? "AM" : "PM", Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] }; return mask.replace(token, function ($0) { return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1) }) } } (); dateFormat.masks = { "default": "ddd mmm dd yyyy HH:MM:ss", shortDate: "m/d/yy", mediumDate: "mmm d, yyyy", longDate: "mmmm d, yyyy", fullDate: "dddd, mmmm d, yyyy", shortTime: "h:MM TT", mediumTime: "h:MM:ss TT", longTime: "h:MM:ss TT Z", isoDate: "yyyy-mm-dd", isoTime: "HH:MM:ss", isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" }; dateFormat.i18n = { dayNames: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] }; Date.prototype.format = function (mask, utc) { return dateFormat(this, mask, utc) }; (function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this); return pub; } ()); jQuery(document).ready(function($) { var css_link = $("", { /******* Load CSS *******/ rel: "stylesheet", type: "text/css", href: "https://athlinks-static.s3.amazonaws.com/athlinks_static/styles/athlinks-widget-results.css?fresh=54" }); css_link.appendTo('head'); jQuery('head').append(''); jQuery(document).on("click","#tabEvents",function(){ }); jQuery(document).on("keyup keypress","#tbAL_Search",function(e){ var code = e.keyCode || e.which; if( e !== undefined && code === 13 ){ e.preventDefault(); jQuery.bbq.removeState("entryid"); var parms = {"term":jQuery("#tbAL_Search").attr("value"),"page":"1"}; jQuery.bbq.pushState(parms); return false; }else{ if( jQuery(this).attr("value")!=='' ){ jQuery("#btnAL_Search").removeAttr("disabled"); }else{ jQuery("#btnAL_Search").attr("disabled","disabled"); } } }); jQuery(document).on("click","#btnAL_Search",function(){ jQuery.bbq.removeState("entryid"); var parms = {"term":jQuery("#tbAL_Search").attr("value"),"page":"1"}; jQuery.bbq.pushState(parms); }); jQuery(document).on("click","#btnAL_Clear",function(){ jQuery.bbq.removeState("term","entryid"); }); jQuery(document).on("click","#btnToggleView",function(){ jQuery.bbq.removeState("entryid"); if(jQuery(this).html().toLowerCase().indexOf("team")>-1){ jQuery(this).html("Show Individual Results"); jQuery.bbq.pushState({"rmode":"t","page":"1"}); }else{ jQuery(this).html("Show Team Standings"); jQuery.bbq.pushState({"rmode":"i","page":"1"}); } }); jQuery(document).on("change","#lstStartPaging",function(){ var parms = {'page':jQuery(this).val()}; jQuery.bbq.pushState(parms); }); jQuery(document).on("change","#lstTmPaging",function(){ var parms = {'page':jQuery(this).val()}; jQuery.bbq.pushState(parms); }); jQuery(document).on("click",".pager",function(){ jQuery.bbq.removeState("entryid"); var pg = jQuery(this).attr("title"), id = jQuery(this).attr("id").toLowerCase(); var parms = {'page':pg}; jQuery.bbq.pushState(parms); }); jQuery(document).on("change","#lstViewBy",function(){ var parms = {"mode":jQuery(this).val(),"page":1}; jQuery.bbq.removeState("entryid"); jQuery.bbq.pushState(parms); }); jQuery(document).on("change","#lstGenders",function(){ var parms = {"gender":jQuery(this).val(),"page":1}; jQuery.bbq.removeState("entryid"); jQuery.bbq.pushState(parms); }); jQuery(document).on("change","#lstCourses",function(){ jQuery.bbq.removeState("entryid"); var parms = {"courseid":jQuery(this).val(),"gender":"A","page":1}; jQuery.bbq.pushState(parms); }); jQuery(document).on("change","#lstAgeGroups",function(){ jQuery.bbq.removeState("entryid"); var val = jQuery(this).val().split(':'); var parms = {'gender':val[0],'classid':val[1]}; jQuery.bbq.pushState(parms); }); jQuery(document).on("change","#lstIndPaging",function(){ jQuery.bbq.removeState("entryid"); var val = jQuery(this).val().split(':'); var parms = {'gender':val[0],'page':val[1]}; jQuery.bbq.pushState(parms); }); jQuery(document).on("click","#btnRaceList",function(){ jQuery.bbq.removeState("raceid","courseid","gender","page","term","rmode","entryid"); }); jQuery(document).on("click","#btnRaceItem",function(){ jQuery.bbq.removeState("entryid"); var parms = { 'mastereventid':jQuery(this).attr("mastereventid"),'raceid':jQuery(this).attr("raceid"),"gender":"A","page":"1" }; jQuery.bbq.pushState(parms); return; }); jQuery(document).on("click",".gigyatrigger", function(){ if(jQuery(this).is(":checked")){ var id = jQuery(this).attr('name').replace("rbpic_",""); jQuery("#btnShare_"+id).click(); } }); jQuery(document).on("click", ".resrow", function(){ var isPublic = $(this).find("#fldIsPublic").val() === 'true'; if( isPublic !== true ){ return; } jQuery("[name^='rbpic_']").attr('checked',false); jQuery(".rowED:visible").slideUp(200); var n = $(this).next(); if( n.attr('class') === 'rowED' && n.is(':visible') === true){ n.hide(); }else{ var eid = $(this).find("#fldEID").val(); var parms = {"entryid":eid}; jQuery.bbq.pushState(parms); //ResultsLib.DrawDetailOptions($(this)); } }); jQuery(window).bind('hashchange', function (e) { var raceid = Math.floor(ResultsLib.SafeHash(e.getState("raceid"),0)); if(raceid>0){ var rmode = ResultsLib.SafeHash(e.getState("rmode"),"i"), courseid = Math.floor(ResultsLib.SafeHash(e.getState("courseid"),0)), mastereventid = Math.floor(ResultsLib.SafeHash(e.getState("mastereventid"),0)), gender = ResultsLib.SafeHash(e.getState("gender"),"m"), page = Math.floor(ResultsLib.SafeHash(e.getState("page"),'1')), term = ResultsLib.SafeHash(e.getState("term"),''), mode = ResultsLib.SafeHash(e.getState("mode"),"o"), classid = ResultsLib.SafeHash(e.getState("classid"),""), entryid = Math.floor(ResultsLib.SafeHash(e.getState("entryid"),'0')); if( gender.length > 0 ){ gender = gender.substring(0,1); } if(Math.floor(raceid)===0){ ResultsLib.GetRaceList(3447,2022,false,mode,classid); return; } ResultsLib.GetRace(rmode,mastereventid,raceid,courseid,page,gender,term,entryid,mode,classid); }else{ ResultsLib.GetRaceList(3447, 2022,false); } }); ResultsLib.Setup(); jQuery(window).trigger('hashchange'); }); } function track(key,p,ipc){ var track = 'https://www.google-analytics.com/__utm.gif?&utmwv=1&utmn=' +Math.floor(Math.random()*99999) + '&utmhn=' + _domain + '&utmr=http://www.referer.com/referer.html' + '&utmp=' + p + '&utmipc=' + ipc + '&utmtst=' + key + '&utmac=UA-2421114-3' + '&utmcc=__utma%3D999.290587279.999.999.999.1%3B'; jQuery.get(track); } })(); // We call our anonymous function immediately