var MD;
var MDX; 

function image2OnMouseDown(Sender,Button,Shift,X,Y)
{
  MD = true;
  MDX = X;
}

function image2OnMouseMove(Sender,Shift,X,Y,Dx,Dy)
{
  if(MD)
  {
     image2.Left=image2.Left+X-MDX;
     if(image2.Left<0) image2.Left=0;
     if(image2.Left>301) image2.Left=301;
  }
}

function image2OnMouseUp(Sender,Button,Shift,X,Y)
{
   MD = false;
   if(image2.Left>=301) widget.cmd("!shutdown");
   image2.Left=0;
   image1.Visible=false;
}

function widgetOnEnter()
{
  image1.Visible=true;
}
