// JavaScript Document
$(function(){
var speed = 60;
var delay = 3000;
//var mheight = $("#mwBody").attr("height");
var mheight = 118;
var kjoer;
 $("<div></div>").addClass("mwAlternate").height(mheight).css("position", "relative").css("overflow", "hidden").appendTo("#mw");
 $("<div></div>").addClass("mwScroller").css({"position": "absolute", "top": "0px"}).appendTo(".mwAlternate");
 $("#mwBody").hide().children().appendTo("div.mwScroller"); 
 var dim = $(".mwScroller").clone().appendTo(".mwAlternate").height();
 $(".mwScroller:eq(1)").css("top", dim);

function scroll(){
$(".mwScroller").each(function(){
  var a = parseInt($(this).css("top"));
  $(this).css("top", a-1);
  if (a<(0-dim)) tick($(this));
});
};

function tick(obj){
  obj.css("top", dim);
};

function wait(){
  kjoer = setInterval(scroll, speed);
}
var go = setTimeout(wait,delay)
  $(".mwScroller").hover(function(){clearTimeout(go); clearInterval(kjoer);}
  ,function(){kjoer = setInterval(scroll, speed);})
});

