﻿function MarkCurrentMenuItem(){var menuLinks=$("ul.menu li.mItem a");if(menuLinks!=null){menuLinks.each(function(index){if(location.pathname.toLowerCase()==$(this).attr("href").toLowerCase())$(this).css("font-weight","bold");})}}
//function StartCountDown(elemId, year, month, day, hour, minute, second) { $('#' + elemId).countdown({ until: new Date(year, month, day, hour, minute, second), format: "HMS", layout: '{hn}:{mnn}:{snn}' }); }
function StartCountDown(elemId, totalSeconds) { $('#' + elemId).countdown({ until: totalSeconds, format: "HMS", layout: '{hn}:{mnn}:{snn}' }); }
function linkTrack()
{
    try
    {
        var action = this.href.toLowerCase().substr(0, 11) == "javascript:" ? 5 : 2;
        var cWidth = parseInt($(document).width());
        var cHeight = parseInt($(document).height());
        var loc = $(this).offset();        
        var req =  { type: 'POST', url: '/service/TrackShort', contentType: 'application/json; charset=utf-8', dataType: "json"
                            , data: '{ actionType: ' + action + ', page: 0, referrer: "' + window.location.href + '", request: "' + this.href + '", currentVisit: ' + visitId + ', w: ' + cWidth + ', h: ' + cHeight + ', l: ' + parseInt(loc.left) + ', t: ' + parseInt(loc.top) + '}'
                            , cache: false
                            , error: trackError }
        $.ajax(req);                     
    }
    catch(e){}
    return true;
}
function trackError(req, stat, err)
{    
    //alert(err);
}
function setTracking()
{
    $("a").click(linkTrack);
}
