//INITIALIZE TABS $( "#teamtabs" ).tabs({ active: 0 }); function showTeam(teamPrimaryID) { var data = {}; data['sf'] = 'team'; data['TeamPrimaryID'] = teamPrimaryID; $.ajax({ url: '/data/teams/', type: 'get', data: data, dataType: 'json', success: function(data) { if ( data.message != "" ) alertMsg(data.message); else { viewTeam(data); } }, error: function (jqXHR, textStatus, errorThrown) { alertMsg(jqXHR.responseText); } }); } function viewTeam(data) { var teamInfo = ""; var mapLink = " GET MAP"; teamInfo = teamInfo + "" + mapLink + "
"; teamInfo = teamInfo + data.venues[0].Street + "
" + data.venues[0].City + ", " + data.venues[0].State + " " + data.venues[0].Zip + "
"; teamInfo = teamInfo + "Course: "; if ( data.venues[0].Course1 == "S" ) teamInfo = teamInfo + "25 Meters"; else if (data.venues[0].Course1 == "Y" ) teamInfo = teamInfo + "25 Yards"; else if (data.venues[0].Course1 == "L" ) teamInfo = teamInfo + "50 Meters"; teamInfo = teamInfo + ""; if ( data.team.TeamURL != "" ) teamInfo = teamInfo + "
 Website
"; var teamReps = ""; if ( data.contacts.length > 0 ) { teamReps = teamReps + "

Team Reps
"; for ( var i=0; i < data.contacts.length; i++ ) { if ( i > 0 ) teamReps = teamReps + "

"; teamReps = teamReps + data.contacts[i].ContactName + "
"; if ( data.contacts[i].Title != "" ) teamReps = teamReps + data.contacts[i].Title + "
"; teamReps = teamReps + "" + data.contacts[i].ContactEmail + "
"; } } $("#TeamName").html(data.team.TeamName); $("#TeamInfo").html(teamInfo); $("#TeamReps").html(teamReps+"  "); $("#ModalTeamView").modal(); } function getMap(venue) { //https://www.google.com/maps?q=8608+howrey+ct,+annandale+va+22003 var mapURL = "https://www.google.com/maps?q="; mapURL = mapURL + venue; window.open(mapURL, "_blank"); }