/**
 * scripts.js
 *
 * Global JavaScript functions and variables for Crown Bingo website.
 *
 * @author Martin Bean <martin@newcastlemarketingservices.co.uk>
 * @version 2.0
 */
$(document).ready(function() {
    Cufon.replace('#winners');
    Cufon.replace('#main h1');
    Cufon.replace('#sidebar .widget .heading');
    Cufon.replace('#sidebar .widget .jackpot');
    Cufon.replace('.promo.first li');
    Cufon.replace('.sidegame .sidejackpot');
    $('#navigation li.' + $('body').attr('class')).addClass('selected');
    var cycleParams = {
        fx: 'fade',
        timeout: 7000,
        speed: 1000
    };
    // remove effects for Internet Explorer
    if ($.browser.msie === true) {
        cycleParams['cleartype'] = true;
        cycleParams['cleartypeNoBg'] = true;
        cycleParams['fx'] = 'none';
    }
    $('.cycle').cycle(cycleParams);
    $('#winners').nms_WinnersAnimation({});
    $('#recent_winners').flash({
        swf: '/assets/swf/recent_winners.swf',
        width: 278,
        height: 304,
        wmode: 'transparent',
        flashvars: {
            xml: 'http://feeds.newcastlemarketingservices.co.uk/vf_web_service/data/winningToday.xml'
        }
    });
});

/**
 * Son of Suckerfish, jQuery-style.
 * @link http://www.martinbean.co.uk/web-development/son-of-suckerfish-drop-downs-jquery-style/
 */
function sfHover(elm) {
    $(elm + ' li').each(function() {
        $(this).hover(
            function() { $(this).addClass('sfhover'); },
            function() { $(this).removeClass('sfhover'); }
        );
    });
};
