var State  	= new String("visible");
var time_id 	= new Number( 0);
var wait_time   = new Number( 100);
var visi_id	= new String("");
var OffsetLeft 	= new Number(0);


function ChangeColor( node, color, bgcolor)
{
    node.style.color = color;
    node.style.backgroundColor = bgcolor;
}

function ChangeColorC( node, color, bgcolor)
{
    n_child = node.childNodes[0];
    n_child.style.color = color;
    node.style.backgroundColor = bgcolor;
}

function No_visi(id)
{
    var node = document.getElementById(id);
    if (node){
        node.style.visibility = State;
    }
    var visis = new Array();
    visis["hidden"] = "visible";
    visis["visible"] = "hidden";
    var n_fltd = document.getElementById( 'fltd');
    if (n_fltd != null)
    n_fltd.style.visibility = visis[State];
}

function visi(id, state)
{
    clearTimeout(time_id);
    if (visi_id != id){
        State = "hidden";
        No_visi(visi_id);
        visi_id = id;
    }
    State = state;
    time_id = setTimeout("No_visi('"+ id +"')", wait_time);
}

function visiPos(id, state, x, y)
{
    var node = document.getElementById( id);
    node.style.left = (x + OffsetLeft) + 'px';
    node.style.top  = (y) + 'px';
    clearTimeout(time_id);
    if (visi_id != id){
        State = "hidden";
        No_visi( visi_id);
        visi_id = id;
    }
    State = state;
    time_id = setTimeout( "No_visi('"+ id +"')", wait_time);
}


function ChangeCrsor(node, cur)
{
    navi = navigator.appName.toUpperCase();

    if (navi.indexOf("EXPLORER") >= 0 && cur == "pointer"){
        node.style.cursor = 'hand';
    } else if (navi.indexOf("NETSCAPE") >= 0 && cur == "hand"){
        node.style.cursor = 'pointer';
    } else {
        node.style.cursor = cur;
    }

}

function setOffsetWidth (size)
{
    if ( navigator.appName.charAt(0) == "N") {
        win_width = window.innerWidth;
    }
    else {
        win_width = document.body.clientWidth;
    }
    if ( (win_width - size) > 0){
        OffsetLeft = (win_width  - size) / 2;
    }
}
