
locale = "none";

function showRating() {
    if(jsDebug) alert("showRating");
    var rating = $j("#rating");
    rating.show(10);
}

function updateFooter(l) {
    locale = l
    if (jsDebug) alert("updateFooter: " + locale + "\n" + footerData[locale]);
    if (footerData[locale]) $j("#footer").html(footerData[locale]);
    if (mode == "teaser") showRating();

    addClickHandlers();
}

function addClickHandlers() {
    $j("#xboxLink").click(function () {
        //alert("xboxLink");
        omnitureTrackLink("Nav_Xbox", "Nav_Xbox");
    });

    $j("#bungieLink").click(function () {
        //alert("bungieLink");
        omnitureTrackLink("Nav_Bungie", "Nav_Bungie");
    });

    $j("#microsoftLink").click(function () {
        //alert("microsoftLink");
        omnitureTrackLink("Nav_Msoft", "Nav_Msoft");
    });

    $j("#kukaLink").click(function () {
        //alert("kukaLink");
        omnitureTrackLink("Nav_KuKa", "Nav_KuKa");
    });

    $j("#ratingLink").click(function () {
        //alert("ratingLink");
        omnitureTrackLink("Nav_Rating", "Nav_Rating");
    });
}

function omnitureTrackLink(tracking_tag, prop36) {
    s.linkTrackVars = "prop4, prop36, events";
    s.prop4 = locale;
    s.prop36 = prop36;
    s.event = "event1";
    s.tl(true, "o", tracking_tag);
}

function doLike() {
    var width = 435;
    var height = 180;
    var left = (screen.width / 2) - (width / 2);
    var top = (screen.height / 2) - (height / 2);

    window.open('FBLike.aspx?locale='+locale, 'KinectCentral', 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no');

    omnitureTrackLink("Nav_Like", "Nav_Like");
}

function atlasLogEvent(id) {

    //alert(id);
    var atlasBaseUrl = "http://view.atdmt.com/jaction/"
    var timestamp = new Date();

    var qs = "?qstr=random=" + Math.ceil(Math.random() * 99999999) + timestamp.getUTCFullYear() + timestamp.getUTCMonth()
    + timestamp.getUTCDate() + timestamp.getUTCHours() + timestamp.getUTCMinutes() + timestamp.getUTCSeconds() + timestamp.getUTCMilliseconds();

    var uriPlus = atlasBaseUrl + id + qs;

    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = uriPlus;

    document.getElementsByTagName('head')[0].appendChild(script);
}


