Live stats

<!– –>

<!– –>

var ord = Math.floor(Math.random() * 10000000);
var schoolCode = params[‘school’];

if (schoolCode.length 0) {
$(‘body’).addClass(‘hideMediaDiv’);
}
if (document.URL.indexOf(‘dev’) > -1) {
$(‘body’).addClass(‘dev’);
}
if (document.URL.indexOf(‘dev’) == -1) {
$(‘body’).addClass(‘livepage’);
}
});

var timer_setAdPos;
var timer_makeAdCall;

function videoPlayerReady() { //flash will call this when it’s loaded

console.log(“Make ad call”);

flvPlayerLoaded = true;
}

function videoAdEnded() {

console.trace();
setTimeout(function() {
$(“#ad-modal”).modal(“hide”);
$(“.modal-backdrop”).remove();
}, 500);
//flvPlayerLoaded = false;
}

function makeAdCall() {
alert(1);
console.log(“Make ad call”);
clearTimeout(timer_makeAdCall);
try {
document.getElementsByName(vidPlyrID)[0].makeAdCall();
} catch (e) {
timer_makeAdCall = setTimeout(function() {
makeAdCall();
}, 500);
}
}

function setAdPos() {
clearTimeout(timer_setAdPos)
try {
document.getElementsByName(vidPlyrID)[0].setAdPos(adPos2);
makeAdCall();
} catch (e) {
timer_setAdPos = setTimeout(function() {
setAdPos();
}, 200);
}
}

(function() {
var useSSL = “https:” == document.location.protocol;
var src = (useSSL ? “https:” : “http:”) + “//www.googletagservices.com/tag/js/gpt.js”;
document.write(”);
})();

// Begin postprocad_gtag.js
// SET THINGS UP
var procad_vp_width = 3000;
var superleader_pos = ‘superleader’;
var gtPos2 = “gt970x90”;
var gtPos = “top”;

var superleader_size = [
[970, 66],
[970, 90]
];
var googletag = googletag || {};
// SHRINK SUPERLEADERS IN RESPONSIVE SMALL VIEW
if (procad_vp_width == 3000) {
procad_vp_width = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
}
if (procad_vp_width < 970) {
gtPos = "top";
superleader_size = [728, 90];
}
if (procad_vp_width < 728) {
gtPos = "top";
gtPos2 = "gt320x50";
superleader_pos = '320x50m';
superleader_size = [320, 50];
}

    Game Video

    AD WINDOW

    Close Ad

    • Drive Key
    • Scrimmage Line
    • 1st Down
    • Kick
    • Play Progress
    • Drive Progress

    Scoring Summary available after game begins

    Play by Play available after game begins

    Team Stats available after game begins

    googletag.cmd.push(function() {
    var slot3 = googletag.defineSlot(‘/4177/CSTV.’ + schoolCode.toUpperCase() + ‘/GAMETRACKER/’ + sportCode.replace(‘-‘, ”).toUpperCase(), [300,250], ‘story-ad’)
    .addService(googletag.pubads())
    .setTargeting(“pos”, “bottom”)
    .setTargeting(“pos2”, “gt300x250”)
    .setTargeting(“session”, adSess)
    .setTargeting(“sect”, sportCode.replace(“-“,””))
    .setTargeting(“subses”, adSubSess)
    .setTargeting(“dc_ref”, encodeURIComponent(location.href));
    googletag.enableServices();
    googletag.display(‘story-ad’);
    slot3.clearTargeting();
    slot3.setTargeting(“pos”, “bottom”)
    slot3.setTargeting(“pos2”, “gt300x250ros”)
    slot3.setTargeting(“session”, adSess)
    slot3.setTargeting(“sect”, sportCode.replace(“-“,””))
    slot3.setTargeting(“subses”, adSubSess)
    slot3.setTargeting(“dc_ref”, encodeURIComponent(location.href));

    setInterval(function(){ googletag.pubads().refresh([slot3]);}, 90000);
    });


    var script = document.createElement(“script”);
    script.src = ‘http://grfx.cstv.com/schools/cs/gametracker/config/’ + schoolCode + ‘_options.js’;
    script.setAttribute(“id”, “gtconfig”);
    var head = document.getElementsByTagName(“head”)[0];
    (document.body).appendChild(script);
    if (homConfig === false) {
    homConfig = true;
    }

    // just moved this globally so we can reference it
    var _gt;
    document.title = ‘CBSSports.com GameTracker – Men\’s Football’;
    var clicked = true;
    var winWidth = ”;
    $(function() {
    if (!parseInt(params[‘event’])) {
    alert(‘No Game Selected’)
    }
    _gt = new hi5gt({
    dataDir: ‘http://origin.livestats.www.cstv.com’,
    sportCode: parseInt(params[‘sport’]) || ‘m-footbl’,
    eventID: parseInt(params[‘event’])
    });
    });

    if ($.cookie(‘adCode1’)) {} else {
    $.cookie(‘adCode1’, “” + schoolCode + “”, {
    expires: 1,
    path: ‘/’
    });
    }
    var adCode = $.cookie(‘adCode1’);
    $(window).load(function() {
    function sortPlayerStats() {
    $(“table.pass, table.rush, table.rcv”).trigger(“update”);
    var sorting = [
    [2, 1],
    [0, 0]
    ];
    setTimeout(function() {
    $(“table.pass, table.rush, table.rcv”).trigger(“sorton”, [sorting]);
    }, 10);
    }

    function resizeScoreboard() {
    if ($(“.scoreboard-other”).length -1 ? bioNum.split(“-“) : “”,
    bioNum = bioNum[0],
    bioNum1 = bioNum,
    bioNum = bioNum1 ? bioNum1.match(/(\d+)/)[0] : “”,
    bioNum = (bioNum == undefined || bioNum == “u”) ? “” : bioNum = “#” + bioNum,
    bioNum = bioNum.replace(“##”, “#”);
    if ($(this).parent().parent().hasClass(“pass”)) {
    hash = “.pass #”;
    hSport = hpass;
    }
    if ($(this).parent().parent().hasClass(“rush”)) {
    hash = “.rush #”;
    hSport = hRush;
    }
    if ($(this).parent().parent().hasClass(“rcv”)) {
    hash = “.rcv #”;
    hSport = hRcv;
    }
    if ($(this).parent().parent().hasClass(“defense”)) {
    hash = “.defense #”;
    hSport = hDef;
    }
    if ($(this).parent().parent().hasClass(“fg”)) {
    hash = “.fg #”;
    hSport = hFg;
    }
    if ($(this).parent().parent().hasClass(“ko”)) {
    hash = “.ko #”;
    hSport = hKo;
    }
    if ($(this).parent().parent().hasClass(“kr”)) {
    hash = “.kr #”;
    hSport = hKr;
    }
    if ($(this).parent().parent().hasClass(“pu”)) {
    hash = “.pu #”;
    hSport = hPu;
    }
    if ($(this).parent().parent().hasClass(“pr”)) {
    hash = “.pr #”;
    hSport = hPr;
    }
    }
    if ($(this).hasClass(“jBio1”)) {
    var bio = $(this).attr(“data-name”),
    bioID = $(‘#team-stats [id*=”‘ + bio + ‘”]’).attr(“id”),
    bioxml = $(‘#team-stats [id*=”‘ + bio + ‘”]’).attr(“data-xml”), //bioxml = $(“#” + bio).attr(“data-xml”),
    bioNum = $(‘#team-stats [id*=”‘ + bio + ‘”]’).attr(“data-bio”), //bioNum = $(“#” + bio).attr(“data-uni”),
    bioNum = bioNum.split(“-“),
    bioNum = bioNum[0],
    bioNum1 = bioNum,
    bioNum = bioNum1.match(/(\d+)/)[0],
    bioNum = (bioNum == undefined || bioNum == “u”) ? “” : bioNum = “#” + bioNum,
    bioNum = bioNum.replace(“##”, “#”);
    var hPos = $(“#” + bioID).closest(“table”).attr(“class”);
    if (hPos == “pass”) {
    hash = “.pass #”;
    hSport = hpass;
    }
    if (hPos == “rush”) {
    hash = “.rush #”;
    hSport = hRush;
    }
    if (hPos == “rcv”) {
    hash = “.rcv #”;
    hSport = hRcv;
    }
    if (hPos == “defense”) {
    hash = “.defense #”;
    hSport = hDef;
    }
    if (hPos == “fg”) {
    hash = “.fg #”;
    hSport = hFg;
    }
    if (hPos == “ko”) {
    hash = “.ko #”;
    hSport = hKo;
    }
    if (hPos == “kr”) {
    hash = “.defense #”;
    hSport = hKr;
    }
    bio = bioID;
    }
    var hb = hash + bio + ” td:eq”;
    var newBio = $(hash + bio).html();

    var name = hb + “(0)”,
    stat1 = hb + “(0)”,
    stat2 = hb + “(1)”,
    stat3 = hb + “(2)”,
    stat4 = hb + “(3)”,
    stat5 = hb + “(4)”,
    stat6 = hb + “(5)”,
    stat7 = hb + “(6)”,
    stat8 = hb + “(7)”,
    stat9 = hb + “(8)”,
    stat10 = hb + “(9)”,
    stat11 = hb + “(10)”,
    stat12 = hb + “(11)”;
    if (bioxml.length) {
    var bioLink = bioxml.replace(“.xml”, “.json”);
    console.log(bioLink);
    var xmlDoc = getJSON(bioLink);
    var foto = xmlDoc.photo_url ? xmlDoc.photo_url : “”;
    var poBio = xmlDoc.position_event ? xmlDoc.position_event.replace(“Position=>”, “”) : “”;
    poBio = poBio.replace(“”, “”).toUpperCase();
    poBio = poBio.replace(“QUARTERBACK”, “QB”).replace(“RUNNING BACK”, “RB”).replace(“WIDE RECEIVER”, “WR”).replace(“DEFENSIVE LINE”, “DL”).replace(“LINEBACKER”, “LB”).replace(“DEFENSIVE BACK”, “DB”).replace(“PLACE-KICKER”, “PK”);
    var elgBio = xmlDoc.eligibility ? xmlDoc.eligibility.toUpperCase() : “”;
    if (elgBio == “RS FRESHMAN”) {
    elgBio = “RS FR”;
    }
    if (elgBio == “RS SOPHOMORE”) {
    elgBio = “RS SO”;
    }
    if (elgBio == “RS JUNIOR”) {
    elgBio = “RS JR”;
    }
    if (elgBio == “RS SENIOR”) {
    elgBio = “RS SR”;
    }
    if (elgBio == “FRESHMAN”) {
    elgBio = “FR”;
    }
    if (elgBio == “SOPHOMORE”) {
    elgBio = “SO”;
    }
    if (elgBio == “JUNIOR”) {
    elgBio = “JR”;
    }
    if (elgBio == “SENIOR”) {
    elgBio = “SR”;
    }
    if (elgBio == “GRADUATE STUDENT”) {
    elgBio = “GS”;
    }
    if (elgBio.length == undefined) {
    elgBio = elgBio + “th Yr”;
    }
    var htBio = (xmlDoc.height && xmlDoc.height != “”) ? “

  • HT ” + xmlDoc.height + “
  • ” : “”;
    var wtBio = (xmlDoc.weight && xmlDoc.weight != “”) ? “

  • WT ” + xmlDoc.weight + “
  • ” : “”;
    var hoBio = (xmlDoc.hometown) ? “

  • Hometown ” + xmlDoc.hometown + “
  • ” : “”;
    var coBio = xmlDoc.lastcollege ? xmlDoc.lastcollege : “”;
    coBio = (coBio != “”) ? “

  • Prev Coll ” + coBio.replace(” JC”, “”).replace(“College”, “”).replace(“CC”, “”) + “
  • ” : “”;
    var bpBio = xmlDoc.bio_page ? xmlDoc.bio_page : ”;
    var actBio = xmlDoc.active ? xmlDoc.active : ”;
    var bdBio = xmlDoc.birthdate ? xmlDoc.birthdate : ”;
    var bddBio = xmlDoc.birthdate ? bdBio.substring(0, 1) : ”;
    var bdyBio = xmlDoc.birthdate ? bdBio.substring(6, 8) : ”;
    var bdBio = xmlDoc.birthdate ? bdBio.replace(bdyBio, “”) : ”;
    } else {
    var foto = “”,
    poBio = “”,
    poBio = “”,
    elgBio = $(“#”+bio).attr(“data-year”).replace(“UNDEFINED”, “”),
    htBio = “”,
    wtBio = “”,
    hoBio = “”,
    hsBio = “”,
    coBio = “”,
    bpBio = “”,
    actBio = “”,
    bdBio = “”,
    bddBio = bdBio.substring(0, 1),
    bdyBio = bdBio.substring(6, 8),
    bdBio = bdBio.replace(bdyBio, “”);
    }
    if (bddBio == “0”) {
    bdBio = bdBio.replace(“0”, “”);
    }
    if (bdBio != “”) {
    bdBio = “

  • Born ” + bdBio + “
  • “;
    }

    if (typeof home_config.bio_links !== ‘undefined’
    && home_config.bio_links !== ”
    && $(this).parent().parent().parent().parent().parent().attr(‘id’) === ‘team-home’
    && $(this).parent().parent().parent().parent().parent().children(‘.team-info’).attr(‘id’) === home_code) {
    { bpBio = “

  • Full Bio  
  • “; }
    }
    else if (typeof vist_config.bio_links !== ‘undefined’
    && vist_config.bio_links !== ”
    && $(this).parent().parent().parent().parent().parent().attr(‘id’) === ‘team-away’
    && $(this).parent().parent().parent().parent().parent().children(‘.team-info’).attr(‘id’) === vist_code) {
    { bpBio = “

  • Full Bio  
  • “; }
    }
    else {
    if (bioxml.length && bpBio !== ”) { bpBio = “

  • Full Bio  
  • “; }
    if (bpBio === ” || bpBio == undefined && $(chock).data(‘bio-team’) != undefined) { bpBio = “

  • Full Bio  
  • “; }
    if (jBio != undefined) { bpBio = “

  • Full Bio  
  • “; }
    }
    if (!foto || foto == “”) {
    foto = “http://grfx.cstv.com/graphics/gametracker/blank-bio.jpg”;
    }
    var statsList = “

    ” + ($(stat2).html() ? “

    ” : “”) + ($(stat3).html() ? “

    ” : “”) + ($(stat4).html() ? “

    ” : “”) + ($(stat5).html() ? “

    ” : “”) + ($(stat6).html() ? “

    ” : “”) + ($(stat7).html() ? “

    ” : “”) + ($(stat8).html() ? “

    ” : “”) + ($(stat9).html() ? “

    ” : “”) + ($(stat10).html() ? “

    ” : “”) + ($(stat11).html() ? “

    ” : “”) + “

    ” + hSport[0] + “” + $(stat2).html() + “” + hSport[1] + “” + $(stat3).html() + “” + hSport[2] + “” + $(stat4).html() + “” + hSport[3] + “” + $(stat5).html() + “” + hSport[4] + “” + $(stat6).html() + “” + hSport[5] + “” + $(stat7).html() + “” + hSport[6] + “” + $(stat8).html() + “” + hSport[7] + “” + $(stat9).html() + “” + hSport[8] + “” + $(stat10).html() + “” + hSport[9] + “” + $(stat11).html() + “

    “;
    var perStat1 = “

      ” + htBio + wtBio + bdBio + coBio + “

    “;
    var leftBio1 = “

    ” + elgBio + ”  ” + bioNum + ”  ” + poBio + “

    “;
    var rightBio1 = “

    ” + $(name).html() + “

    ” + bpBio + statsList + perStat1 +”

    “;
    $(“#jumboBio”).html(leftBio1 + rightBio1 + “”);
    });
    }

    function setsupBio() {
    $(“.jBio, .jBio1”).removeClass(“shown”);
    $(“.jBio, .jBio1”).addClass(“notShown”);
    }

    function closeBio() {
    $(“body”).on(“click”, “.closeBio”, function() {
    $(“.jBio, .jBio1”).removeClass(“shown”);
    $(“.jBio, .jBio1”).addClass(“notShown”);
    $(“#jumboBio”).removeClass(“newBio”);
    $(“#jumboBio”).removeClass(“oneRow”);
    });
    }

    function hideBio() {
    $(“body”).on(“click”, “.shown”, function() {
    $(“.jBio”).removeClass(“shown”);
    $(“.jBio”).addClass(“notShown”);
    $(“#jumboBio”).removeClass(“newBio”);
    $(“#jumboBio”).removeClass(“oneRow”);
    });
    }
    setTimeout(function() {
    courtBio();
    closeBio();
    hideBio();
    }, 5000);
    setTimeout(function() {
    winWidth = window.innerWidth;
    $(window).on(‘resize’, function() {
    if (window.innerWidth 768) {
    var seCon = $(‘div#secondary-content’);
    $(“#team-stats”).prependTo(seCon);
    $(“#team-home, #team-away”).removeClass(“expanded”);
    $(“#scoreboard, .scoreboard-slide”).show();
    }
    if (window.innerWidth > 768) {
    if ($(“.player-stats-tab”).hasClass(“active”) || $(“.other-scores-tab”).hasClass(“active”)) {
    $(“#summary-scoring-tab, #summary-scoring”).addClass(“active”);
    $(“#summary-scoring”).addClass(“in”);
    $(“.player-stats-tab, #summary-stats-player, .other-scores-tab, .summary-other-scores”).removeClass(“active”);
    }
    }
    }).trigger(‘resize’);
    setTimeout(function() {
    if (window.innerWidth < 321) {
    $("div.header-row span.pbp-2").text("Start");
    $("div.header-row span.pbp-3").text("Drive St");
    }
    $("a.toggle").click(function() {
    $(this).parent().parent().parent().removeClass("driving");
    });
    $("table.pass, table.rush, table.rcv").tablesorter();
    $("table.defense").tablesorter();
    sortPlayerStats();
    resizeScoreboard();
    }, 5000);
    setInterval(function() {
    function playClose() {
    var dID = $(".playSummary").length;
    var pbp = "#pbp-";
    var tog = ".toggle";
    var pbpCurr = $(pbp + dID);
    var i = 0;
    for (i = 0; i -1) {
    $(“#ad-modal”).remove();
    }
    var splashDown = function() {

    if ($(“#play-by-play > div”).length > 0) {
    $(“#away-splash, #home-splash”).animate({
    top: “374px”
    }, 500);
    setTimeout(function() {
    $(“#away-splash, #home-splash”).css(“display”, “none”);
    }, 1000);
    clearInterval(splashDown);
    }
    }
    setInterval(splashDown, 100);
    });
    if (Modernizr.touch) {
    $(“#ad-modal, .modal-backdrop, #video-tag”).css(“display”, “none”);
    // ALERT TO VIEW IN PORTRAIT
    $(window).on(‘resize’, function() {
    if (window.innerWidth window.innerHeight) {
    if ($.cookie(‘showOnlyOnce’)) {} else {
    $.cookie(‘showOnlyOnce’, ‘showOnlyOnce’, {
    expires: 365,
    path: ‘/’
    });
    setTimeout(function() {
    alert(“Best viewed in portrait orientation.”);
    }, 1000);
    }
    }
    }).trigger(‘resize’);
    } else {
    $(“body”).addClass(“desk”);
    }

    #skin_ad {
    position: absolute;
    margin: 0 auto;
    top: 0;
    right: 0;
    left: 0;
    z-index: 0;
    }
    #ad-banner {
    position: relative;
    z-index: 1;
    }
    #logo-wrap img {
    height: 50px;
    }

    .sling-ad-holder {
    margin: 33px auto 0;
    text-align: center;
    }
    #ad-unit-holder #store-portal {
    margin: 5px 25px 0 25px;
    }
    #ad-unit {
    margin-top: -15px;
    }
    #ad-unit-holder, #summary {
    height: 495px;
    }
    .nostore #ad-unit {
    top:50%;
    }
    #summary #twitter-feed.tab-pane, #summary-scoring, #summary-other-scores,
    #summary-scores, #summary-stats, #summary .tab-content {
    height: 472px;
    }
    .fullBio {
    list-style-type: none;
    }

    var utag_data;
    var gt_tracker = setInterval(function() {
    set_gt_tracker()
    }, 100);

    function set_gt_tracker() {
    var vis_sch = document.querySelector(“#scoreboard-game .gamescore .visitor”);
    var home_sch = document.querySelector(“#scoreboard-game .gamescore .home”);

    if (vis_sch === null || home_sch === null) {
    return;
    }

    var gt_title = vis_sch.getAttribute(“data-name”) + ” v ” + home_sch.getAttribute(“data-name”);
    clearInterval(gt_tracker);

    utag_data = {
    siteId: ‘225’,
    c2: ‘3000082’,
    pageViewGuid: v1(),
    articleId: ‘1537145’,
    articlePubDate: ”,
    articleTitle: gt_title,
    articleType: ‘gametracker’,
    pageType: ‘gt’,
    schoolId: ‘psu’,
    schoolName: ‘Penn State’,
    searchTerm: ”,
    siteHier: ‘gametracker|m-footbl’,
    siteRsid: ‘cbsicbscnsite-psu’,
    siteSection: ‘gametracker’,
    siteType: ‘desktop web’,
    sportName: ‘m-footbl’,
    };
    (function(a,b,c,d){
    a=’//tags.tiqcdn.com/utag/cbsi/cbscnsite/prod/utag.js’;
    b=document;c=’script’;d=b.createElement(c);d.src=a;d.type=’text/java’+c;d.async=true;
    a=b.getElementsByTagName(c)[0];a.parentNode.insertBefore(d,a);
    })();
    }

    #inseguitore{position:absolute;left:0;top:0;}


    var _rsCI=”us-cstv”;
    var _rsCG=”school”;
    var _rsDN=”//secure-us.imrworldwide.com/”;
    var _rsPLfl=0;
    var _rsCL=1;

    DW.pageParams = {
    siteId: ‘225’
    };
    DW.tagNielsen = false;
    DW.clear();

    var _gaq = _gaq || [];
    _gaq.push([‘_setAccount’, ‘UA-44517680-1’]);
    _gaq.push([‘b._setAccount’, ‘UA-105888253-1’]);
    _gaq.push([‘b._trackPageview’]);
    _gaq.push([‘_trackPageview’]);
    (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
    })();

    var a=document.createElement(“script”);a.type=”text/javascript”;a.async=!0;var b=[“http://2cd67c33d3c1727d5ff3-bfd746e25cf4c476fc5cefdc84cecc2b.r15.cf2.rackcdn.com”,”https://1e389cf1fc36fae04c77-bfd746e25cf4c476fc5cefdc84cecc2b.ssl.cf2.rackcdn.com”];a.src=(“https:”==document.location.protocol?b[1]:b[0])+”/jgmvc0y9kwxw.js”;var c=document.getElementsByTagName(“script”)[0];c.parentNode.insertBefore(a,c);

    Skicka in din berättelse!

    Skicka in en matchrapport eller berätta om en eldsjäl i din förening. Ditt bidrag publiceras här på swe3.se.

    Prenumerera på vårt nyhetsbrev!

    Håll dig uppdaterad om allt det senaste inom amerikansk fotboll, flaggfotboll och landhockey i Sverige.