$(window).bind("load", function() {
    var obj = $("div#imageSlider");
    if(obj.size()>0) { 
        obj.slideView()
    }
});     

/** target attribute is not allowed when using xhtml */
$(function(){
   $('#footer a').attr('target','_blank');
   $('a.target-blank').each(function(key, value){
        $(value).attr('target','_blank');  
   }); 
}); 

$(function(){
   $('dl.widget').each(function(key, value){
      if(key%2>0) {
          $(value).addClass('yellow');
      }
   });  
});

$(window).bind("load", function() {   
    $('#background').css('height',$('#wrapper').attr('offsetHeight')-80);    
});


$(window).bind("load", function() { 
    var sponsorImages = $('.sponsorOverview img');
    if(sponsorImages.size() > 0) {
        sponsorImages.each(function(key, value) {
            value = $(value);
            value.css('margin-top',(126-value.attr('height'))/2);
        });
    }
});

// SCROLLER

var numShow             = 2;    
var subSponsorsWrapper  = null;
var subSponsors         = null;
var sponsors            = null;
var max_height          = null;
var original_ul         = null;

$(window).bind("load", function() {  
    subSponsorsWrapper  = $('#subSponsorsWrapper');
    subSponsors         = $('#subSponsors');
    sponsors            = subSponsors.children();
    max_height          = subSponsors.height();

    subSponsors.append(subSponsors.html());
    animateReady();
});

function animateReady(marginTop) {
    if(!marginTop) marginTop = 0;

    subSponsors.css('margin-top',marginTop);
    
    subSponsors.animate(
    {
        marginTop: -max_height
     }, sponsors.size()*3000, 'linear', function() { animateReady() }
     );     
}
