window.addEvent('domready', function () {
	
	
	
	//TOOLTIPS
	var t = new Tips('.tip');
	$$('.tip').each(function(tip){
		var imgSrc = tip.retrieve('tip:text');
		var imgAlt = tip.retrieve('tip:title');
		tip.store('tip:text', new Element('img',{'src':imgSrc,'alt':imgAlt,'styles':{'border':'1px solid black'}}));
	});
	
	
	//ACCORDION
	//create our Accordion instance
	var myAccordion = new Accordion($('accordion'), 'h3.acc-header', 'div.acc-content', {
		opacity: false,
	
		onActive: function(toggler, element){
			toggler.setStyle('color', '#000000');
			toggler.setStyle('text-decoration', 'none');
			toggler.addEvents({  
				'mouseenter' : function() { this.setStyle('color','#000000') },  
				'mouseleave' : function() { this.setStyle('color','#000000') }  
         	}); 
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#003399');
			toggler.setStyle('text-decoration','underline');
			toggler.addEvents({  
				'mouseenter' : function() { this.setStyle('color','#000000') },  
				'mouseleave' : function() { this.setStyle('color','#003399') }  
         	}); 
		}
	});
	
	
	//Menu rollovers...
	//preload images
	var aPreLoad = new Array();
	var aPreLoadi = 0;
 
	//do rollover
	$$('img.rollover').each(function(el){
		//let's preload
		aPreLoad[aPreLoadi] = new Image();
		aPreLoad[aPreLoadi].src = el.src.replace(el.src.replace('-normal', '-hover'));
		aPreLoadi++;
 
		el.addEvent('mouseover',function(){
			this.setAttribute('src',this.src.replace('-normal', '-hover'));
		});
 
		el.addEvent('mouseout',function(){
			this.setAttribute('src',this.src.replace('-hover','-normal'));
		});
	});


	
	
});