<!-- 
// by choco

var level = 50;      // SpeedControl (slow=10,middle=30,fast=50)

var firstX = -450;   // first position X
var firstY = 100;  // first position Y
var lastX  = 200;    // last position X
var lastY  = 100;     // last position Y

var closeLimit = 8; // auto close (sec)

var moveControl;
var xControl = 1, yControl = 1;
var closeControl = 0;

closeLimit--;

function moveStart ( headerName,address ){

  if(closeControl > 0) { clearTimeout(closeTimer); } // by choco
  closeControl = 0; // by choco

  var Browser = navigator.userAgent;

  if ( Browser.indexOf("MSIE") < -1  ||  Browser.indexOf("Firefox") < -1){
	location.href = address;
	return false;
  } 
  else if ( Browser.indexOf("Safari") > -1) {
	location.href = address;
	return false;
  }

  if ( moveControl ){
    closeTable();
  }

  if ( document.getElementById )
     moveControl = document.getElementById ( headerName );
  else 
  moveControl = document.all [ headerName ];

  moveiframe.location.href = address;
  moveControl.onmousedown = mouseCheckOn;
  runControl();
}

 function minimizeTable ( tableName ) {
   if ( document.getElementById )
     content = document.getElementById ( tableName );  
   else
     content = document.all [tableName];
   if ( content.style.display == "none" )     {
       content.style.display = "";
       moveControl.style.height = "170px";
     }
   else     {
       content.style.display = "none";
       moveControl.style.height = "20px";
     }
 }

 function closeTable ( ) {
   moveControl.style.display = "none";
 } 


 function xMove ( ) {
    return ( ( window.pageXOffset ) ? window.pageXOffset : document.body.scrollLeft ) + xControl;
 }

 function yMove ( ) {
    return ( ( window.pageYOffset ) ? window.pageYOffset : document.body.scrollTop ) + yControl;
 }

 function timeControl ( ) {
   moveControl.style.top = yMove ( );
   moveControl.style.left = xMove ( );

   if (closeControl > closeLimit) { // by choco
      clearTimeout(closeTimer);
      closeControl = 0;
      closeTable();
   }
   else {
      closeControl++;
      //window.status = closeControl;
   }

   closeTimer = setTimeout ( "timeControl ( );", 1000 );
 }

 function moveCheck ( ) {
   if ( xControl != lastX || yControl != lastY )     {
       if ( xControl != lastX )
         if ( Math.abs ( xControl - lastX ) <= level )
           xControl = lastX;
         else
           if ( xControl < lastX )
             xControl += level;
           else
             xControl -= level;
       if ( yControl != lastY )
         if ( Math.abs ( yControl - lastY ) <= level )
           yControl = lastY;
         else
           if ( yControl < lastY )
             yControl += level;
           else
             yControl -= level;
       moveControl.style.top  = yMove ( );
       moveControl.style.left = xMove ( );

       setTimeout ( "moveCheck();", 1 );
     }
   else
      timeControl ( );
    
 }

 function runControl ( WindowName ) {
   xControl = 0;
   yControl = 0;

   switch ( 1 )     {
       case 1: xControl = firstX;  break;
       case 2: xControl = ( ( window.innerWidth ) ? window.innerWidth : document.body.clientWidth );  break;
     }
	 
   switch ( 1 )     {
       case 1: yControl = firstY;  break;
       case 2: yControl = ( ( window.innerHeight ) ? window.innerHeight : document.body.clientHeight );  break;
     }

   moveControl.style.top  = yMove ( );
   moveControl.style.left = xMove ( );
   moveControl.style.display = "";
   moveCheck ( );
 }

 var nowX, nowY;

 function tailMouse ( e ) {
   setX = ( document.all ) ? event.clientX : e.clientX;
   setY = ( document.all ) ? event.clientY : e.clientY;
   xControl += setX - nowX;
   yControl += setY - nowY;
   nowX = setX;
   nowY = setY;
   moveControl.style.top  = yMove ( );
   moveControl.style.left = xMove ( );
 }

 function mouseCheckOff ( ) { }

 function mouseCheckControl ( ) {
   document.onmousemove = mouseCheckOff;
   document.onmouseup   = mouseCheckOff;
 }

 function mouseCheckOn ( stat ) {
   nowX = ( document.all ) ? event.clientX : stat.clientX;
   nowY = ( document.all ) ? event.clientY : stat.clientY;
   document.onmousemove = tailMouse;
   document.onmouseup   = mouseCheckControl;
 } 

//<table width='500' height='150' border='0' cellspacing='0' cellpadding='1' style='display:none;position:absolute;top:10px;left:10px;empty-cells:hide' id='hahinHeader'>
//<tr><td style='background: pink'>
//<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>
//<tr height='1'><td>
//<table width='100%' border='0' cellspacing='1' cellpadding='0' style='background: blue; color: pink; cursor: default'>
//<tr style='font-family: Arial, sans-serif; font-size: 12pt; font-weight: bold'><td>HAHIN!
//<td style='width: 20px; cursor: pointer;' onclick='javascript:minimizeTable("hahinBody");'><IMG src='minimize.gif'>
//<td style='width: 20px; cursor: pointer;' onclick='javascript:closeTable();'><IMG src='close.gif'>
//</table>
//<tr><td>
//<table width='100%' height='100%' id='hahinBody' border='0' cellpadding='0' cellspacing='0' bgcolor=pink>
//<tr>
//<td>
//</table></table></table>

//-->
