// <!-- $Header: /Projects/Taxi/WebBooker/WJBasp.NV/js/help.js 7     9/09/08 16:17 David.g $ -->
//
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header

isIE      = document.all;
ddEnabled = false;
isHot     = false;

function ddInit(e)
{
    var hotDog   = isIE ? event.srcElement : e.target;
    var helpNode = $("helpLayer");

    while (hotDog.id != "titleBar" && hotDog.tagName != "BODY" && hotDog.tagName != "HTML")
    {
        hotDog = isIE ? hotDog.parentElement : hotDog.parentNode;
    }

    if (hotDog.id == "titleBar")
    {
        offsetX              = isIE ? event.clientX : e.clientX;
        offsetY              = isIE ? event.clientY : e.clientY;
        nowX                 = parseInt(helpNode.style.left);
        nowY                 = parseInt(helpNode.style.top);
        ddEnabled            = true;
        document.onmousemove = dd;
    }
}

function dd(e)
{
    if (!ddEnabled)
    {
        return;
    }

    Shadower.deshadow("helpLayer");
    $("helpLayer").style.left = (isIE ? nowX+event.clientX-offsetX : nowX+e.clientX-offsetX) + 'px';
    $("helpLayer").style.top  = (isIE ? nowY+event.clientY-offsetY : nowY+e.clientY-offsetY) + 'px';
    Shadower.shadow("helpLayer", shadowOptions);

    return false;
}

function hideHelp()
{
    $("helpLayer").hide();
    Shadower.deshadow("helpLayer");
}

function showHelp()
{
   $("helpLayer").show();
   Shadower.shadow("helpLayer", shadowOptions);
}

document.onmousedown = ddInit;
document.onmouseup   = function() 
{
     ddEnabled=false;
}