/*----------------------------------+
|  script (c)2004 by m.fLo.thomann  |
|  www.virtualvoid.net              |
+----------------------------------*/

var stayTime = 4*1000;
var speedX = 20;
var speedT = 20;
var py = 30;

var wnd;
var posEnd;
var posStay;
var px;

function startWindow(sx,sy)
{
   px = -(sx+50);
   wnd = window.open("moverWin.htm", "window", "width="+sx+",height="+sy+",top="+py+",left="+px+",toolbar=no");
   posEnd = screen.width+50;
   posStay = (screen.width-sx)>>1;
   movIn();
}

function movIn()
{
   if(wnd.closed) return;

   if(px <= posStay) {
      wnd.moveTo(px,py);
      px+=speedX;
      setTimeout("movIn()",speedT);
   }
   else {
      setTimeout("movOut()",stayTime);
   }
}

function movOut()
{
   if(wnd.closed) return;

   if(px <= posEnd) {
      wnd.moveTo(px,py);
      px+=speedX;
      setTimeout("movOut()",speedT);
   }
   else {
      wnd.close();
   }
}


