var target_x1 = 6;
var target_y1 = -170;

var has_inner1 = typeof(window.innerWidth) == 'number';
var has_element1 = document.documentElement && document.documentElement.clientWidth;

var fm_id='floatdiv1';
var floating_menu1 =
    document.getElementById
    ? document.getElementById(fm_id)
    : document.all
      ? document.all[fm_id]
      : document.layers[fm_id];

var fm_shift_x1, fm_shift_y1, fm_next_x1, fm_next_y1;

function move_menu1()
{
    if (document.layers)
    {
        floating_menu1.left = fm_next_x1;
        floating_menu1.top = fm_next_y1;
    }
    else
    {
        floating_menu1.style.left = fm_next_x1 + 'px';
        floating_menu1.style.top = fm_next_y1 + 'px';
    }
}

function compute_shifts1()
{
    fm_shift_x1 = has_inner1
        ? pageXOffset
        : has_element1
          ? document.documentElement.scrollLeft
          : document.body.scrollLeft;
    if (target_x1 < 0)
        fm_shift_x1 += has_inner1
            ? window.innerWidth
            : has_element1
              ? document.documentElement.clientWidth
              : document.body.clientWidth;

    fm_shift_y1 = has_inner1
        ? pageYOffset
        : has_element1
          ? document.documentElement.scrollTop
          : document.body.scrollTop;
    if (target_y1 < 0)
        fm_shift_y1 += has_inner1
            ? window.innerHeight
            : has_element1
              ? document.documentElement.clientHeight
              : document.body.clientHeight;
}

function float_menu1()
{
    var step_x1, step_y1;

    compute_shifts1();

    step_x1 = (fm_shift_x1 + target_x1 - fm_next_x1) * .07;
    if (Math.abs(step_x1) < .5)
        step_x1 = fm_shift_x1 + target_x1 - fm_next_x1;

    step_y1 = (fm_shift_y1 + target_y1 - fm_next_y1) * .07;
    if (Math.abs(step_y1) < .5)
        step_y1 = fm_shift_y1 + target_y1 - fm_next_y1;

    if (Math.abs(step_x1) > 0 ||
        Math.abs(step_y1) > 0)
    {
        fm_next_x1 += step_x1;
        fm_next_y1 += step_y1;
        move_menu1();
    }

    setTimeout('float_menu1()', 20);
};

compute_shifts1();
if (document.layers)
{
    // Netscape 4 cannot perform init move
    // when the page loads.
    fm_next_x1 = 0;
    fm_next_y1 = 0;
}
else
{
    fm_next_x1 = fm_shift_x1 + target_x1;
    fm_next_y1 = fm_shift_y1 + target_y1;
    move_menu1();
}
float_menu1();

