var speed = '';

$(document).ready(function(){
  
  //tabs code
  $('#news_tab_div').click(function(){
    $('#news_tab_div').removeClass('news_tab_but').addClass('news_tab_but_active');
    $('#events_tab_div').removeClass('events_tab_but_active').addClass('events_tab_but');
    $('#topics_tab_div').removeClass('topics_tab_but_active').addClass('topics_tab_but');
    $('#events_wrapper').hide(speed);
    $('#topics_wrapper').hide(speed);
    $('#news_wrapper').show(speed);
	$('#subscribe').show(speed);
	$('#previous_seminars').hide(speed);
	$('#blog_lead').hide(speed);
  });
  $('#events_tab_div').click(function(){
    $('#events_tab_div').removeClass('events_tab_but').addClass('events_tab_but_active');
    $('#news_tab_div').removeClass('news_tab_but_active').addClass('news_tab_but');
    $('#topics_tab_div').removeClass('topics_tab_but_active').addClass('topics_tab_but');
    $('#news_wrapper').hide(speed);
    $('#topics_wrapper').hide(speed);
    $('#events_wrapper').show(speed);
	$('#subscribe').hide(speed);
	$('#previous_seminars').show(speed);
	$('#blog_lead').hide(speed);
  });
  $('#topics_tab_div').click(function(){
    $('#topics_tab_div').removeClass('topics_tab_but').addClass('topics_tab_but_active');
    $('#news_tab_div').removeClass('news_tab_but_active').addClass('news_tab_but');
    $('#events_tab_div').removeClass('events_tab_but_active').addClass('events_tab_but');
    $('#news_wrapper').hide(speed);
    $('#events_wrapper').hide(speed);
    $('#topics_wrapper').show(speed);
	$('#subscribe').hide(speed);
	$('#previous_seminars').hide(speed);
	$('#blog_lead').show(speed);
  });
  
  //banner code
  /*$('#ban1').click(function(){
    $('#banner_inner').animate({left: '0px'},1500);
    $('#ban1').addClass('li_active');
    $('#ban2').removeClass('li_active');
    $('#ban3').removeClass('li_active');
  });
  $('#ban2').click(function(){
    $('#banner_inner').animate({left: '-953px'},1500);
    $('#ban1').removeClass('li_active');
    $('#ban2').addClass('li_active');
    $('#ban3').removeClass('li_active');
  });
  $('#ban3').click(function(){
    $('#banner_inner').animate({left: '-1906px'},1500);
    $('#ban1').removeClass('li_active');
    $('#ban2').removeClass('li_active');
    $('#ban3').addClass('li_active');
  });*/
	
  function doNothing(){

  }  

  //more banner stuff
  $(function() { 
    $('#banner_window').after('<div id="banner_number">').cycle({ 
      fx:      'scrollLeft', 
      speed:    1700, 
      timeout:  11000, 
      pager: '#banner_number',
      easing: 'easeOutBack'
    });
  });
  
  var topOffset=0;
  var linkHeight=26;
  topOffset=254-(($('#banner_number').children().length)*linkHeight)    
  //$('#banner_number').children(':first').addClass('top-link');
  $('#banner_number').children(':first').css({'margin-top': topOffset});

  //partners code
  var myleft=0;
  var offset=139;
  var visnum=6; //number of visible partnets on the screen
  var partners=$('#partners_list').children().size();
  var leftend=(partners-visnum)*offset*-1;
  
  $('#partners_arrow_left').click(function(){  
    myleft=myleft-offset;
    $('#partners_list').animate({left: myleft+'px'},800);
    $('#arrrightimg').show();
    if(myleft==leftend){
      $('#arrleftimg').hide();      
    }
  });  
  
  $('#partners_arrow_right').click(function(){
    myleft=myleft+offset;
    $('#partners_list').animate({left: myleft+'px'},800);
    $('#arrleftimg').show();
    if(myleft==0){
      $('#arrrightimg').hide();      
    }
  });
  
  
});


