document.onmousedown=dragHandler;

function modalWindow(id) 
{
	if (windowPaneID.style.display=='block') 
	{
	windowPaneID.style.display='none';
	windowPaneID.innerHTML=''; 
	} 
	else 
	{
	windowPaneID.style.display='block';
	windowPaneID.innerHTML='<div align="right"><A HREF="javascript:modalWindow()">CLOSE</a></div><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/lK1kFF839WY&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/lK1kFF839WY&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>' ;
	}
}


function moveHandler(e){
      if (e == null) { e = window.event } 
      if (e.button<=1&&dragOK){
         savedTarget.style.left=e.clientX-dragXoffset+'px';
         savedTarget.style.top=e.clientY-dragYoffset+'px';
         return false;
      }
   }



   function cleanup(e) {
      document.onmousemove=null;
      document.onmouseup=null;
      savedTarget.style.cursor=orgCursor;
      dragOK=false;
   }



   function dragHandler(e){
      var htype='-moz-grabbing';
      if (e == null) { e = window.event; htype='move';} 
      var target = e.target != null ? e.target : e.srcElement;
      orgCursor=target.style.cursor;
      if (target.className=="windowFrame") {
         savedTarget=target;       
         target.style.cursor=htype;
         dragOK=true;
         dragXoffset=e.clientX-parseInt(windowPaneID.style.left);
         dragYoffset=e.clientY-parseInt(windowPaneID.style.top);
         document.onmousemove=moveHandler;
         document.onmouseup=cleanup;
         return false;
      }
   }
