(function(namespace){
	if(typeof(window[namespace]) == 'undefined'){
		window[namespace] = {};
	}
	var gsTip = Class.create();
	gsTip.prototype = {
		org:null,
		initialize:function(container){
			this.container = container;
			$(this.container).observe('mouseout', (function(){
				if(this.org) this.org.style.display = 'none';
			}).bind(this));
			$(this.container).observe('mouseover', (function(){
				if(this.org) this.org.style.display = 'block';
			}).bind(this));
		},
		initEvent:function(){
			var archor = $$('#'+this.container+' a[rel="tooltip"]');
			var i=0, len = archor.length;
			for(i; i < len; i++){
				archor[i].observe('mouseover', this.showTip.bindAsEventListener(this, archor[i]));
			}
			var notshow = $$('#'+this.container+' a[rel="notshow"]');
			i=0;
			len = notshow.length;
			for(i; i < len; i++){
				notshow[i].observe('mouseover', (function(evt){
					evt.stop();
					if(this.org) this.org.style.display = 'none';
				}).bindAsEventListener(this));
			}
		},
		showTip:function(event, archor){
			var _left = Event.pointerX(event);
			var _top = Event.pointerY(event);
			if(this.org) this.org.style.display = 'none';
			var tooltip = archor.next(0);
			tooltip.setStyle({display:'block', left:_left+'px', top:_top+'px'});
			this.org = tooltip;
		}
	};
	window[namespace]['tip'] = gsTip;
})('ITLONG');
