var NS4 = (document.layers) ? 1 : 0;
var IE4 = (document.all) ? 1 : 0;
var AINDA_NAO_FOI = true;
var strTemp = "";

function showMessage( str ) {
	if( NS4 ){
		if( typeof document.messageLayer != "undefined" )
			with ( document.messageLayer.document ){
				open( );
				write( str ); 
				close( );
			}
	}
	else{
		if( typeof messageLayer != "undefined" )
			messageLayer.innerHTML = str;
	}
}

function hideMessage( ) {
	if( NS4 ){
		if( typeof document.messageLayer != "undefined" )
			with ( document.messageLayer.document ){
				open( );
				write( "" ); 
				close( );
			}
	}
	else{
		if( typeof messageLayer != "undefined" )
			messageLayer.innerHTML = "";
	}
}

function showFloatMessage( ev, str, leftx, topy ) {
	hideFloatMessage2( );
	if( str && str != "" ) {
		if( NS4 ) {
			if( typeof document.floatMessageLayerOut != "undefined" ) {
				
				if( AINDA_NAO_FOI || strTemp != str ) {
					with ( document.floatMessageLayerIn.document ){
						open( );
						write( str ); 
						close( );
					}
					AINDA_NAO_FOI = false;
				}
				document.floatMessageLayerOut.visibility = "show";
				document.floatMessageLayerOut.top = ev.pageY + 3 + topy;
				document.floatMessageLayerOut.left = ev.pageX + 3 + leftx;
			}
		}
		else {
			if( typeof floatMessageLayerOut != "undefined" ) {
				if( AINDA_NAO_FOI || strTemp != str ) {
					floatMessageLayerIn.innerHTML = str;
					strTemp = str;
					floatMessageLayerOut.style.visibility = "visible";
					AINDA_NAO_FOI = false;
				}
				floatMessageLayerOut.style.pixelTop = ev.clientY + document.body.scrollTop + 3 + topy;
				floatMessageLayerOut.style.pixelLeft = ev.clientX + document.body.scrollLeft + 3 + leftx;
			}
		}
	}
}

function hideFloatMessage( ) {
	if( NS4 ) {
		if( typeof document.floatMessageLayerOut != "undefined" )
			document.floatMessageLayerOut.visibility = "hide";
		AINDA_NAO_FOI = true;
	}
	else {
		if( typeof floatMessageLayerOut != "undefined" )
			floatMessageLayerOut.style.visibility = "hidden";
		AINDA_NAO_FOI = true;
	}

}

function showFloatMessage2( ev, str, leftx, topy ) {
	hideFloatMessage( );
	if( str && str != "" ) {
		if( NS4 ) {
			if( typeof document.floatMessageLayerOut2 != "undefined" ) {
				
				if( AINDA_NAO_FOI || strTemp != str ) {
					with ( document.floatMessageLayerIn2.document ){
						open( );
						write( str ); 
						close( );
					}
					AINDA_NAO_FOI = false;
				}
				document.floatMessageLayerOut2.visibility = "show";
				document.floatMessageLayerOut2.top = ev.pageY + 3 + topy;
				document.floatMessageLayerOut2.left = ev.pageX + 3 + leftx;
			}
		}
		else {
			if( typeof floatMessageLayerOut2 != "undefined" ) {
				if( AINDA_NAO_FOI || strTemp != str ) {
					floatMessageLayerIn2.innerHTML = str;
					strTemp = str;
					floatMessageLayerOut2.style.visibility = "visible";
					AINDA_NAO_FOI = false;
				}
				floatMessageLayerOut2.style.pixelTop = ev.clientY + document.body.scrollTop + 3 + topy;
				floatMessageLayerOut2.style.pixelLeft = ev.clientX + document.body.scrollLeft + 3 + leftx;
			}
		}
	}
}

function hideFloatMessage2( ) {
	if( NS4 ) {
		if( typeof document.floatMessageLayerOut2 != "undefined" )
			document.floatMessageLayerOut2.visibility = "hide";
		AINDA_NAO_FOI = true;
	}
	else {
		if( typeof floatMessageLayerOut2 != "undefined" )
			floatMessageLayerOut2.style.visibility = "hidden";
		AINDA_NAO_FOI = true;
	}

}

