/** errtip */

function ErrorTip()
{
    this.errTip = null;
    this.tmrTip = null;
}

ErrorTip.prototype.onShow = function(el)
{
    if( !el ) return;
    if( el == this.errTip ) {
	if( this.tmrTip != null ) {
	    window.clearTimeout( this.tmrTip );
	    this.tmrTip = null;
	    return;
	}
    }

    if( el.getAttribute( "err" ) ) {
	var posx = getPageCoords( el );

	if( this.errTip == null ) {
	    this.errTip = document.createElement( "DIV" );
	    this.errTip.style.position = "absolute";
	    this.errTip.style.border = "solid 1px #bf2010";
	    this.errTip.style.background = "#f9f9e6";
	    this.errTip.style.padding = "4px 15px 4px 15px";
	    this.errTip.style.fontSize = "10px";
	    this.errTip.style.fontFamily = "Verdana";
	    setEventHandler( this.errTip, "mouseover", function() { etip.onShow( this ); } );
	    setEventHandler( this.errTip, "mouseout", function() { etip.onHide( this ); } );
	    document.body.appendChild( this.errTip );
	}

	this.errTip.style.left = (posx.x + 16) + "px";
	this.errTip.style.top = posx.y + "px";
	this.errTip.innerHTML = el.getAttribute( "err" );

	if( this.tmrTip != null ) {
	    window.clearTimeout( this.tmrTip );
	    this.tmrTip = null;
	}
    }
}

ErrorTip.prototype.closeTip = function()
{
    if( this.errTip != null ) {
	document.body.removeChild( this.errTip );
	this.errTip = null;
    }

    this.tmrTip = null;
}

ErrorTip.prototype.onHide = function()
{
    if( this.tmrTip == null )
	this.tmrTip = window.setTimeout( "etip.closeTip();", 500 );
}



