var ditdot = Class.create({
	initialize: function(container) {
		
		this.container = $(container);
		this.dotball = new Element('img', {'class':'imgball','src':'/global/images/minidot3.png',width:10,height:10});
		
		this.container.insert({'bottom':this.dotball});
		
		this.dotball.hide();
		
		Event.observe(document, 'mousemove', this.dotpos.bindAsEventListener(this));
	
	},
	dotpos: function(e){
		var xstart = $("main").cumulativeOffset()[0];
		var xend = xstart + 934;
		
		
		
		var x = Event.pointerX(e);
		var show = false;
		
		if(x>xstart && x<xend)
		{
			var y = Event.pointerY(e);
			var ystart = $("main").cumulativeOffset()[1];
			var yend = ystart + 50;
			
			if(y>ystart && y<yend)
			{
				show = true;
			}
		
			
		}
		
		
		if(!show){
			
		
			if(this.dotball.visible())
			{
				this.dotball.fade();
			}
		
		}
		
		
	},
	movedot: function(a){
	
		if(!this.dotball.visible())
		{
			this.dotball.appear();
		}
		
		var val = a.cumulativeOffset()[0] - $("main").cumulativeOffset()[0] + (a.getWidth()/2) - 6;
		
		new Effect.Move(this.dotball,{x:val, y:41, mode:'absolute'})
		
	},
	dothide: function(){
	if(this.dotball.visible())
	{
		//this.dotball.fade();
	}
	
	}

});