/** MiniMaps **/

function MiniMaps()
{
}

MiniMaps.activeElement = null;
MiniMaps.hider = null;

var end = true;

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

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

    var mapid = element.getAttribute( "mapid" );
  	var child = document.getElementById( "map_" + mapid );
    var top = document.getElementById( "divTop" );
    title = document.getElementById( "divTitle" );
	
	var offX = 30;
	var offY = 0;
	
	if(mapid.split("_", 1) == "info")
	{
		offX = 0;
		offY = 20;
	}
	
    if( !child ) return;
    
    if( MiniMaps.activeElement != null )
    	this.finalCleanup();

    var pos = getPageCoords( element );    
      	
  	child.style.left = (pos.x + offX) + "px";
  	child.style.top = (pos.y + offY) + "px";
  	
    child.style.display = "block";
   
    
    MiniMaps.activeElement = child;
    
    MiniMaps.srcElement = element;
}

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

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

MiniMaps.prototype.finalCleanup = function()
{
    if( MiniMaps.activeElement != null ) {
    	MiniMaps.activeElement.style.display = "none";
    }
    
    if( MiniMaps.srcElement != null ) {
		MiniMaps.srcElement.style.background = "";
		MiniMaps.srcElement.style.color = "";
	}
    

    MiniMaps.hider = null;
    MiniMaps.activeElement = null;
    MiniMaps.srcElement = null;

}


