/**
 * @author alvaro
 */
//when the dom is ready
window.addEvent('domready', function() {
	
	//idGen = new idGenerator();
	
	//store titles and text
	$$('.tipz').each(function(element,index) {
		var content = element.get('title').split('::');
		element.store('tip:title', content[0] );
		element.store('tip:text', content[1] );
	});
	
	
	//create the tooltips
	var tipz = new Tips('.tipz',{
		className: 'tipz',
		fixed: false,
		hideDelay: 50,
		showDelay: 50,
		offset: { x:10, y:10 }
		
	});
	
	tipz.addEvent('show', function(tip, el){
    	tip.fade( 0.95 );
	});
	
	tipz.addEvent('hide', function(tip, el){
    	tip.fade( 0 );
	});
	
	//store titles and text
	$$('.tipzImage').each(function(element,index) {
		var content = element.get('title').split('::');
		element.store('tip:title', content[0] );
		element.store('tip:text', new Element('img',{ src: content[1] }) );
	});
	
	//create the tooltips
	var tipzImage = new Tips('.tipzImage',{
		className: 'tipzImage',
		fixed: false,
		hideDelay: 50,
		showDelay: 50
	});
	
	
	tipzImage.addEvent('show', function(tip, el){
    	tip.fade( 0.95 );
	});
	
	tipzImage.addEvent('hide', function(tip, el){
    	tip.fade( 0 );
	});
	
	$$('.addOver').addEvents({ 
		'mouseover': function(){ this.addClass( 'over' ); },
		'mouseout' : function(){ this.removeClass( 'over' ); }	
	});
	
	$$('#mainContent .block').addEvents({ 
		'mouseover': function(){ this.addClass( 'over' ); },
		'mouseout' : function(){ this.removeClass( 'over' ); }	
	});
	
	$$('.addFadeOnOver').each( function(item, index){
		item.set( 'opacity', '0.7' );		
		item.addEvents({ 
				'mouseover': function(){ this.fade(1.0); },
				'mouseout': function(){	this.fade(0.7);	}	
		});
	});
	
	
	
});

