/* Script by: www.jtricks.com
 * Version: 20060303
 * Latest version:
 * www.jtricks.com/javascript/navigation/floating.html
 */
var targetrd_x = (screen.width - 450) / 2;
var targetrd_y = 85;

var has_inner = typeof(window.innerWidth) == 'number';
var has_element = document.documentElement && document.documentElement.clientWidth;

var rd_id='musicblock';
var floating_juke =
    document.getElementById
    ? document.getElementById(rd_id)
    : document.all
      ? document.all[rd_id]
      : document.layers[rd_id];

var rd_shift_x, rd_shift_y, rd_next_x, rd_next_y;
function radioScroll() {
    	window.scrollBy(0,375); // horizontal and vertical scroll increments
    	//scrolldelay = setTimeout('radioScroll()',100); // scrolls every 100 milliseconds
}

function move_radio_menu()
{
    if (document.layers)
    {
        floating_juke.left = rd_next_x;
        floating_juke.top = rd_next_y;
    }
    else
    {
        floating_juke.style.left = rd_next_x + 'px';
        floating_juke.style.top = rd_next_y + 'px';
		//alert(rd_next_x);
    }
}

function radio_shifts()
{
    rd_shift_x = has_inner
        ? pageXOffset
        : has_element
          ? document.documentElement.scrollLeft
          : document.body.scrollLeft;
    if (targetrd_x < 0)
        rd_shift_x += has_inner
            ? window.innerWidth
            : has_element
              ? document.documentElement.clientWidth
              : document.body.clientWidth;

    rd_shift_y = has_inner
        ? pageYOffset
        : has_element
          ? document.documentElement.scrollTop
          : document.body.scrollTop;
    if (targetrd_y < 0)
        rd_shift_y += has_inner
            ? window.innerHeight
            : has_element
              ? document.documentElement.clientHeight
              : document.body.clientHeight;
}

function float_radio()
{
    var steprd_x, steprd_y;

    radio_shifts();

    steprd_x = (rd_shift_x + targetrd_x - rd_next_x) * .07;
    if (Math.abs(steprd_x) < .5)
        steprd_x = rd_shift_x + targetrd_x - rd_next_x;

    steprd_y = (rd_shift_y + targetrd_y - rd_next_y) * .07;
    if (Math.abs(steprd_y) < .5)
        steprd_y = rd_shift_y + targetrd_y - rd_next_y;

    if (Math.abs(steprd_x) > 0 ||
        Math.abs(steprd_y) > 0)
    {
        rd_next_x += steprd_x;
        rd_next_y += steprd_y;
        move_radio_menu();
    }

    setTimeout('float_radio()', 20);
};

radio_shifts();
if (document.layers)
{
    // Netscape 4 cannot perform init move
    // when the page loads.
    rd_next_x = 0;
    rd_next_y = 0;
}
else
{
    rd_next_x = rd_shift_x + targetrd_x;
    rd_next_y = rd_shift_y + targetrd_y;
    move_radio_menu();
}
float_radio();
