jQuery(function($){
    $('#caroussel-images').cycle({
        fx: 'fade',
        pager:  '#caroussel-pager',
        activePagerClass: 'active',
        pagerAnchorBuilder: function(idx, slide) {
            return '#caroussel-pager li:eq(' + idx + ') a';
        }
    });
    $('#caroussel-images').cycle('pause');

    $('.video').each(function(){
        jwplayer($(this).attr('title')).setup({
            flashplayer: "/assets/flash/jwplayer/player.swf",
            file: $(this).attr('rel'),
            height: 296,
            width: 640,
            stretching: 'uniform',
            skin: '/assets/flash/jwplayer/bekle/bekle.xml',
            autostart: true
        });
    })

    Shadowbox.init();

    $(".map-container area").mouseover(function(){
        var regionMap = '.map-'+$(this).attr('id');
        $(regionMap).css('display', 'inline');

    }).mouseout(function(){
        var regionMap = '.map-'+$(this).attr('id');

        // Check if a click event has occured and only change the Region hover state accodringly
        if (! jQuery(regionMap).hasClass('selected')) {
            jQuery(regionMap).css('display', 'none');
        }
    });
});


