// JavaScript Document

var imgTip = new Class({
		
	Implements: [Options, Events],
		
	options: {
		},
        
	initialize: function(classname,options) {
		
		this.tipdiv = new Element('div')
			.setStyles({
				'display':'none',
				'position':'absolute',
				'z-index':10000
				})
			.inject(document.body);
			
		this.tipimg = new Element('img')
			.inject(this.tipdiv);
		
		$$('.'+classname).each(function(el){
			el.addEvents({
				'mousemove':function(e) {
					var coords=e.target.getCoordinates();
					var leftpos=e.page.x+5;
					var toppos=e.page.y+5;
					this.tipdiv.setStyles({
						'left': leftpos+'px',
						'top': toppos+'px'
						});
					}.bind(this),
				'mouseenter':function(e) {
					this.tipimg.src=e.target.get('tipimg');
					this.tipdiv.setStyle('display','block');
					}.bind(this),
				
				'mouseleave':function(e) {
					this.tipdiv.setStyle('display','none');
					}.bind(this)
				});
			}.bind(this));
			

		}
	});
