﻿$(document).ready(function () {
    /* News Ticker */
    var options = {
        newsList: "#news-ticker",
        startDelay: 10,
        placeHolder1: " _",
        stopOnHover: false
    }
    $().newsTicker(options);

    $('#download a').mousedown(function () {
        _gaq.push(['_trackEvent', 'download-button', 'clicked'])
    });

    /* Nivo slider effect */
    $('#banner').nivoSlider({
        effect: 'fade'
    });

    /* News Filter Slider */
    $('#news-region-container .select-regions').click(function () {
        var $marginLefty = $('#news-region-container');
        $marginLefty.animate({
            marginLeft: parseInt($marginLefty.css('marginLeft'), 10) == -($marginLefty.outerWidth() - 100) ?
         0 :
        -($marginLefty.outerWidth() - 100)
        });
    });
});
