function slideClick()
{
    var count = jQuery('#slideshow-menu a').length;
    jQuery(jQuery('#slideshow-menu a').get(tabIndex)).click();
    tabIndex = tabIndex+ 1;
    if (tabIndex == count) tabIndex = 0;
}
function initHover()
{
    jQuery('#slideshow').hover(
            function()
            {
                clearInterval(interval);
                //console.log('Interval Stopped!');
            },
            function()
            {
                interval = setInterval('slideClick()', slideShowTimer);
                //console.log('Interval Started!');
            }
    );
}
var interval;
var tabIndex = 1;
var slideShowTimer = 5000;
$(function () {
	var isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
	if (!isIE6) {
        if (jQuery('#ticker-wrapper').length > 0) {
		    jQuery('#js-news').ticker();
        }
	}
    jQuery('#slideshow-pictures').cycle({
        speed:       200,
        timeout:     0,
        pager:      '#slideshow-menu',
        pagerEvent: 'click'
    });
    interval = setInterval('slideClick()', slideShowTimer);
    initHover();
}); 
