
function getBrowserId() {

  isNS4= ( document.layers) ? true : false;
  isIE4= ( document.all && !document.getElementById) ? true : false;
  isIE5= ( document.all &&  document.getElementById) ? true : false;
  isNS6= (!document.all &&  document.getElementById) ? true : false;

}


function setVariables(x) {

  getBrowserId();

  set_speed= 10;                 // speed of object movement - 1 is fastest
  speed= (x) ? x : set_speed;

  ypos= 0;

  menu_w=     125;               // graphic width, in pixels
  menu_h=     125;               // graphic height, in pixels

  id_menu1= "floatid1";
  

  id_menu= id_menu1;

  if (isNS6) {

    doc_val1= 'document.getElementById("';
    doc_val2= '")';
    style_val= ".style";
    h_val= ".left";
    v_val= ".top";
    innerW= "window.innerWidth";
    innerH= "window.innerHeight";
    offsetX= "window.pageXOffset";
    offsetY= "window.pageYOffset";

  } else if (isNS4) {

    doc_val1= "document.";
    doc_val2= "";
    style_val= "";
    h_val= ".left";
    v_val= ".top";
    innerW= "window.innerWidth";
    innerH= "window.innerHeight";
    offsetX= "window.pageXOffset";
    offsetY= "window.pageYOffset";

  } else {

    doc_val1= "";
    doc_val2= "";
    style_val= ".style";
    h_val= ".pixelLeft";
    v_val= ".pixelTop";
    innerW= "document.body.clientWidth";
    innerH= "document.body.clientHeight";
    offsetX= "document.body.scrollLeft";
    offsetY= "document.body.scrollTop";

  }

}
function checkLocation() {

  var availableX= eval(innerW);
  var availableY= eval(innerH);
  var currentX= eval(offsetX);
  var currentY= eval(offsetY);
  ydiff= ypos - currentY;
  if ((ydiff < (-1)) || (ydiff > (1))) movey= Math.round(ydiff / speed), ypos -= movey;

  mx= availableX - (menu_w + 10) + currentX;
  my= availableY - (menu_h + 5) + ypos;

  evalMove();
  setTimeout("checkLocation()", 10);

}
function evalMove() {
  
  eval(doc_val1 + id_menu + doc_val2 + style_val + h_val + "=" + mx);
  eval(doc_val1 + id_menu + doc_val2 + style_val + v_val + "=" + my);
}
