window.oncontextmenu = function() { return false };

$(function() {
    $(this).bind("contextmenu", function(e) {
        e.preventDefault();
    });
});

var currentTwitterPage = '';

function twitter(team) {
    currentTwitterPage = team;
    $.ajaxSetup({ cache: false });

    $(document).ready(function(){
        var refreshId = setInterval(function() {
            var getPage = currentTwitterPage + '?randval='+ Math.random();
            //alert(getPage);
            $("#twitter_block_container_content").load(getPage);
        }, 30000);
    });
}
var newsbannerSlider = false;
function newsbanner(startSlide)
{
    if(newsbannerSlider == false)
    {
        newsbannerSlider = $('#news_banner_slideshow').slideshow({
            width       : 678,      // width in px
            height      : 231,     // height in px
            title       : false,     // show title
            panel       : false,     // show controls panel
            playframe   : false,
            help        : '',
            effecttime  : 2000,// aviable fast,slow,normal and any valid fx speed value
            effect      : 'scrollDown',
            time        : 6000,      // time out beetwen slides,
            playhoverr  : true,
            callback    : function(index, title)
            {
                $('#news_banner_title a').each(function(index) {
                    $(this).removeClass('active');
                });

                $('#newsbanner_link_' + index).addClass('active');
            }
            // Get the starting slide
        });

        newsbannerSlider.goToSlide(startSlide);
        newsbannerSlider.playSlide();
    }
    else {
        newsbannerSlider.goToSlide(startSlide);
    }
}

function newsbannerPause()
{
    newsbannerSlider.stopSlide();
}

function newsbannerPlay()
{
    newsbannerSlider.playSlide();
}
$(document).ready(function(){
    $('.banner').slidingImageGallery({
        buttonPosition: "right",
        pauseRollOver: "true",
        transition: "random"
    });

    var startSlide = 0;
    // Get slide number if it exists
    if (window.location.hash) {
        startSlide = window.location.hash.replace('#','');
    }

    //newsbanner(startSlide);

    $('#page_slideshow').slideshow({
        width       : 220,      // width in px
        height      : 220,     // height in px
        title       : false,     // show title
        panel       : false,     // show controls panel
        playframe   : false,
        help        : '',
        effecttime  : 2000,// aviable fast,slow,normal and any valid fx speed value
        time        : 3000      // time out beetwen slides
    }).playSlide();

    $('#footer_slideshow').slideshow({
        width       : 629,      // width in px
        height      : 43,     // height in px
        title       : false,     // show title
        panel       : false,     // show controls panel
        playframe   : false,
        help        : '',
        effecttime  : 2000,// aviable fast,slow,normal and any valid fx speed value
        effect      : 'scrollUp',
        time        : 3000      // time out beetwen slides
    }).playSlide();
	
	$("a[rel=gallery_group]").fancybox({
		'transitionIn'      : 'elastic',
		'transitionOut'     : 'elastic',
		'titlePosition'     : 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Foto ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
});

