jQuery(document).ready(function($) {

function mousedownSideNavTracking(e) {

    var $zone = $(this);
    var linkText = $zone.text();
    var $clickedOn = $(e.target);


    // did they click a link? If so, track it.
    if ($clickedOn.is('a')) {

        if (typeof (CreateOnClickEvent) != "undefined")
            CreateOnClickEvent('SideNav', 29, 'SideNav:' + e.data.section + ':' + linkText)   // eVar29
            
        $zone.unbind('mousedown');

        // only unbind the parent if an image is clicked
        if ($clickedOn.is('img'))
            $zone.parents().unbind('mousedown');
    }
}

    // Click Events to bind    -----------------------------------------------

    // supergroup links
    $('li.secondary a').bind('mousedown', { section: trackingPage }, mousedownSideNavTracking);

    // group links on GroupMenu.asp page
    $('li.main a').bind('mousedown', { section: trackingPage }, mousedownSideNavTracking);

    $('.coreStoreLink').bind('mousedown', function () { CreateOnClickEvent("BackToCore", 35, "GroupMenuTop"); $(this).unbind('mousedown'); });

    // links in Customer Care box
    $('a.groupChatTracking').bind('mousedown', function () { CreateOnClickEvent("SuperProdGroup", 15, "GroupListBox:Chat"); $(this).unbind('mousedown'); });
    $('a.groupEmailTracking').bind('mousedown', function () { CreateOnClickEvent("SuperProdGroup", 15, "GroupListBox:Email"); $(this).unbind('mousedown'); });
    $('a.groupCallTracking').bind('mousedown', function () { CreateOnClickEvent("SuperProdGroup", 15, "GroupListBox:Call"); $(this).unbind('mousedown'); });
    $('a.groupSeeWhyTracking').bind('mousedown', function () { CreateOnClickEvent("SuperProdGroup", 15, "GroupListBox:SeeWhy"); $(this).unbind('mousedown'); });
});


