fadWidth = 100;

fadHeight = 300;

nowX = 950;

nowY = 340;

posX = 0;

posY = 0;

fad_style = document.getElementById("forumRightMenu").style;


finnerWidth = 0;


function fadIni()

{

  innerWidth = document.body.clientWidth;

  innerHeight = document.body.clientHeight;


  edge = (innerWidth-950)/2;

  if( edge < 0 )

  {

    posX = innerWidth - 110;

  }

  else

  {

    posX = edge + 870;

  }


  if(innerHeight < 500 ){

    posY = innerHeight-fadHeight;

  }

  else{

    posY = 20;

  }
}


function fadRefresh()

{

  if(innerWidth != document.body.clientWidth){

    fadIni();

  }

  offsetX = posX + document.body.scrollLeft - nowX;

  offsetY = posY + document.body.scrollTop - nowY;

  nowX += offsetX/5;

  nowY += offsetY/5;

  fad_style.left = nowX;

  fad_style.top = nowY;


  var temp = getCookie("ckFORUM_setting");

  opobj = document.getElementById("op");



  if(document.body.scrollTop < 472 && ('' == temp || null == temp)){

    opobj.style.display = 'none';

    fad_style.zIndex = 0;

  }

  else if(document.body.scrollTop > 472 && ('' == temp || null == temp)){

    opobj.style.display = 'block';

    fad_style.zIndex = 10;
  }

/*

  else if('none' == temp || 'block' == temp){

    //opobj.style.display = temp;

    fad_style.zIndex = ('none' == temp)? 0:10;

  }

*/


  floatID = setTimeout("fadRefresh()", 20 );

}


function fadStart()

{

  fadIni();

  //window.onresize=fadIni;

  fadRefresh();

}


fadStart();
