var tooltip=function(){
	var id = 'tt';
	var top = -53;
	var left = 20;
	var maxw = 300;
	var speed =10;
	var timer = 20;
	var endalpha = 90;
	var alpha = 0;
	var tt,t,c,b,h;
	var ie = document.all ? true : false;
	return{
		showRight:function(v,w,mwidth){			
			tt = document.getElementById(mwidth);		
			if (c == null) {
				c = document.createElement('div');
			}
				c.setAttribute('id',id + 'cont');
			if (b == null) {			
				b = document.createElement('div');
			}
			tt.appendChild(c);
			tt.appendChild(b);								
			c.innerHTML = v;
			tt.style.width = w ? w + 'px' : 'auto';						
			tt.style.marginLeft = "-200px"; 	
			tt.style.marginTop = "-60px"; 	
			tt.style.position = "absolute";
			tt.style.display = "inline";
			tt.style.zIndex = "99999";		
			tt.style.borderColor = "#C8C9C9";
			tt.style.borderStyle = "solid";
			
			tt.style.opacity = 85;
			tt.style.filter = 'alpha(opacity=85)';

			//tt.style.filter = 'alpha(opacity=1)';
			//clearInterval(tt.timer);
			//tt.timer = setInterval(function(){tooltip.fade(1)},timer);			
			
		},
		
		show:function(v,w,mwidth){
			tt = document.getElementById(mwidth);		
			if (c == null) {
				c = document.createElement('div');
			}
				c.setAttribute('id',id + 'cont');
			if (b == null) {			
				b = document.createElement('div');
			}
			tt.appendChild(c);
			tt.appendChild(b);								
			c.innerHTML = v;
			tt.style.width = w ? w + 'px' : 'auto';						
			tt.style.marginLeft = "100px"; 	
			tt.style.marginTop = "-50px"; 	
			tt.style.position = "absolute";
			tt.style.display = "inline";
			tt.style.zIndex = "99999";		
			tt.style.borderColor = "#C8C9C9";
			tt.style.borderStyle = "solid";
			tt.style.opacity = 85;
			tt.style.filter = 'alpha(opacity=85)';

		
		},
		pos:function(e){
			var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
			var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
			tt.style.top = (u - h) + 'px';
			tt.style.left = (l + left) + 'px';
		},
		fade:function(d){
			var a = alpha;
			if((a != endalpha && d == 1) || (a != 0 && d == -1)){
				var i = speed;
				if(endalpha - a < speed && d == 1){
					i = endalpha - a;
				}else if(alpha < speed && d == -1){
					i = a;
				}
				alpha = a + (i * d);
				tt.style.opacity = alpha * .01;
				tt.style.filter = 'alpha(opacity=' + alpha + ')';
			}else{
				clearInterval(tt.timer);
				if(d == -1){tt.style.display = 'none'}
			}
		},
		hide:function(){
			
			tt.style.display = "none";			
			//clearInterval(tt.timer);
			//tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
			
		},
		
		hideLeft:function(onn){
			document.getElementById(onn).style.display = 'none';			
			//clearInterval(tt.timer);
			//tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
			
		}

	};
}();