function WSToolTip( elDiv ) {
	this.initWSLayer( elDiv );
	var ishover = false;

	this.showTip = function(text) {
		this.writeDiv(text);	
		ishover = true;	
	}

	this.hideTip = function(text) {
		ishover = false;
		if(this.WIN32() && this.IE5()) {
			var IfrRef = document.getElementById('DivShim');
			var DivRef = this.elDIv;
			if(typeof(IfrRef)=='object') IfrRef.style.display = "none";
			DivRef.style.display = "none";
		}
		this.hide();
		this.writeDiv(text);		
	}

	this.moveTip = function() {
		if(ishover) {		
			var margin = 1;
			var wH = this.windowHeight();
			var wW = this.windowWidth();
			var mx = this.mouseX;
			var my = this.mouseY;
			var divH = 0;
			var divW = 0;
			var pSX = this.pageScrollX()
			var pSY = this.pageScrollY();

			if(!this.OPERA6()) {
				divH = this.elDIv.offsetHeight;
				divW = this.elDIv.offsetWidth;
				margin = (this.IE4() || this.IE5() || this.W3C())? 1 : 23;
				if(this.NS4()) if((document.height - wW) < 0) margin = 10;		
				if(this.NS6()) if((document.height + 27 - wH) < 0) margin = 15;
				var xoff = mx + 5;
				var yoff = ( (my + divH + 30 - pSY + margin) >= wH) ? -15-divH: 30;	
				var destX = Math.min(wW - divW - margin , Math.max(2,xoff)) + pSX;
				var destY = my + yoff + pSY;	
				this.moveTo(destX , destY);
				if(this.WIN32() && this.IE5()) {
					var IfrRef = document.getElementById('DivShim');
					var DivRef = this.elDIv;
					if(typeof(IfrRef)=='object') {
						DivRef.style.display = "block";
						IfrRef.style.width = DivRef.offsetWidth;
						IfrRef.style.height = DivRef.offsetHeight;
						IfrRef.style.top = DivRef.style.top;
						IfrRef.style.left = DivRef.style.left;
						IfrRef.style.zIndex = DivRef.style.zIndex - 1;
						IfrRef.style.display = "block";
					}
				}

				this.show();			
				
			} else {
				//alert('Opera 6 non supporta il WSToolTip');
				return;
			}
		}
	}
}

WSToolTip.prototype = new WSLayerAPI();