﻿var layer_width = 250;
var layer_height = 450;
var object = "";

function setVariables() 
{
    if (navigator.appName == "Netscape") {
        v = ".top=";
        h = ".left=";
        dS = "document.";
        sD = "";
        y = "window.pageYOffset";
        x = "window.pageXOffset";
        iW = "window.innerWidth";
        iH = "window.innerHeight";
    }
    else {
        h = ".pixelLeft=";
        v = ".pixelTop=";
        dS = "document.";
        sD = ".style";
        y = "document.body.scrollTop";
        x = "document.body.scrollLeft";
        iW = "document.body.clientWidth";
        iH = "document.body.clientHeight";
    }
    object = "getElementById('logo')";

    var layerPlayer = document.getElementById('logo');
    layer_height = layerPlayer.clientHeight;
    
    innerX = eval(iW) - layer_width;
    innerY = eval(iH) - layer_height; // ****

    checkLocationA();
    
    return;
}

function checkLocation() 
{
    yy = eval(y);
    xx = eval(x);
    ydiff = ystart - yy;
    xdiff = xstart - xx;
    if ((ydiff < (-1)) || (ydiff > (1))) movey = Math.round(ydiff / 10), ystart -= movey;
    if ((xdiff < (-1)) || (xdiff > (1))) movex = Math.round(xdiff / 10), xstart -= movex;
    
//    var layerPlayer = document.getElementById('logo');
//    layer_height = layerPlayer.clientHeight;
    
    innerX = eval(iW) - layer_width;
    innerY = eval(iH) - layer_height;
    eval(dS + object + sD + v + (ystart + innerY));
    eval(dS + object + sD + h + (xstart + innerX));
    setTimeout("checkLocation()", 10);
    
    return;
}

function checkLocationA() 
{
    ystart = eval(y);
    xstart = eval(x);
    
    return;
}

function delayLogo() 
{
    object = "getElementById('logo')";
    eval(dS + object + sD + v + 0);
    eval(dS + object + sD + h - layer_height);
    
    return;
}

movex = 0;
movey = 0;
xdiff = 0;
ydiff = 0;
ystart = 0;
xstart = 0;
