function scrollsponsors(){
  tmp = document.getElementById('sponsorsmove');
  tmp_ml = tmp.style.marginLeft;
  if(tmp_ml.length <= 2 || (-1 * parseInt(tmp_ml.substr(0,tmp_ml.length-2))) >= (tmp.offsetWidth)){
   tmp2 = tmp.firstChild.offsetWidth;
   tot = 10;
  }else{
   tmp2 = parseInt(tmp_ml.substr(0,tmp_ml.length-2)) - 1;
   tot = 10;
  };
  tmp.style.marginLeft = tmp2 + "px";
  for(i=0;i<stops.length;i++){
    if(tmp2 == stops[i]) tot = 5000;
  };
  scroll_to = setTimeout("scrollsponsors()", tot);
};

function startscroll(){
  if(!document.getElementById('sponsorsmove')) return;
  tmp = document.getElementById('sponsorsmove').getElementsByTagName('img');
  boxwidth = document.getElementById('sponsors').offsetWidth;
  twidth = 0;
  mheight = 0;
  offset = 2;
  stops = new Array(tmp.length);
  for(i=0;i<tmp.length;i++){
    stops[i] = 0 - twidth;
    if(tmp[i].offsetWidth < boxwidth){
      tmp[i].style.paddingLeft = ((boxwidth - tmp[i].offsetWidth)/2) + 'px'; //So it starts off screen
    };
    if(i + 1 < tmp.length) newsize = boxwidth - ((boxwidth - tmp[i + 1].offsetWidth)/2);
    else newsize = 0;
    tmp[i].style.paddingRight = newsize + 'px';
    twidth = twidth + tmp[i].offsetWidth;
    if(tmp[i].offsetHeight > mheight) mheight = tmp[i].offsetHeight;
  };
  document.getElementById('sponsorsmove').style.width = twidth + offset + 'px';
  mheight = mheight + 4;
  for(i=0;i<tmp.length;i++){
    if(tmp[i].offsetHeight < mheight){
      tmp[i].style.paddingTop = ((mheight - tmp[i].offsetHeight)/2) + "px";
    };
  };
  document.getElementById('sponsors').style.top = '7px';
  document.getElementById('sponsors').style.height = mheight + 'px';
  document.getElementById('sponsorsmove').style.marginLeft = tmp[0].offsetWidth + offset + "px";
  document.getElementById('sponsorstext').style.top = '70px';
  scrollsponsors();
};

if(window.attachEvent) window.attachEvent("onload", function(){startscroll()});
else if(window.addEventListener) window.addEventListener("load", function(){startscroll()}, false);
else document.addEventListener("load", function(){startscroll()}, false);