/** DropDown **/

function DropDown()
{
}

DropDown.activeElement = null;
DropDown.activeFog = null;
DropDown.hider = null;


DropDown.prototype.mouseOver = function(element)
{
    if( (element == DropDown.activeElement) || (element == DropDown.activeSrc) || (element == DropDown.activeFog) ) {
		if( DropDown.hider != null ) {
		    clearTimeout( DropDown.hider );
		    DropDown.hider = null;
		}
		return;
    }

    if( DropDown.activeElement != null ) {
		if( DropDown.hider != null )
		    clearTimeout( DropDown.hider );
		DropDown.hider = null;
		this.finalCleanup();
    }

    var dropId = element.getAttribute( "dropid" );
    var child = document.getElementById( "drop_" + dropId );
    if( !child ) return;
    
    if( DropDown.activeElement != null )
    	this.finalCleanup();

    var pos = getPageCoords( element );
    
	child.style.left = (pos.x) + "px";
    child.style.top = (pos.y + 34) + "px";
    child.style.display = "block";
    
    DropDown.activeElement = child;

}

DropDown.prototype.mouseOut = function(element)
{
    if( DropDown.hider != null ) return;
    if( DropDown.activeElement == null ) return;

    DropDown.hider = setTimeout( this.finalCleanup, 800 );
}

DropDown.prototype.finalCleanup = function()
{
    if( DropDown.activeElement != null ) {
    	DropDown.activeElement.style.display = "none";
    }
    
    DropDown.hider = null;
    DropDown.activeElement = null;
}

