$(function() {
  $('.scroll-pane').jScrollPane({showArrows: true, horizontalGutter: 10});
	var banner=document.getElementById('wt-img-idx');
	if(banner) {
    $('#banner').wtRotator({
      delay:12000,
      play_once:false,
      transition:'random',
      transition_speed:800,
      auto_center:true,
      easing:"",
      cpanel_position:'outside',
      cpanel_align:'BR',
      display_thumbs:false,
      display_dbuttons:true,
      display_playbutton:false,
      display_numbers:true,
      display_timer:false,
      mouseover_pause:true,
      cpanel_mouseover:false,
      text_mouseover:false,
      text_effect:'fade',
      text_sync:true,
      shuffle:true,
      block_size:75,
      vert_size:55,
      horz_size:50,
      block_delay:25,
      vstripe_delay:75,
      hstripe_delay:180
    });
	}
  setTimeout('SetBG();',2000);
	SponsorSwap();
});

function SponsorSwap() {
  var url='mod/lists/ajax_listimage.php?keyword=SPONSOREN';
  $('#sponsoren').load(url,function(response,status,xhr) {
   if(status=="error") { $('#sponsoren').html('Sorry but there was an error: '+xhr.status+' '+xhr.statusText); }
  });
  setTimeout('SponsorSwap();',10000);
}

function SetBG() {
	document.getElementsByTagName('body')[0].style.backgroundColor='#315400'; // for summer: #AD3B28  (#F4EBE6 for left-div)
	//-- scroll to next event -------------------------------------------------
	if(typeof nextdateid!='undefined' && nextdateid>0) {
	  $('#listcontentID'+nextdateid).css('color','#B90E22');
  	var scrpane=$('#jahresprogramm-scroll-pane');
  	if(scrpane) {
  		var api=scrpane.data('jsp');
    	api.scrollToElement($('#listcontentID'+nextdateid),true);
		}
	}
}


