window.addEvent('domready',function() {
	// Include benefits script 
	//var myScript = new Asset.javascript('js/benefits.js', {id: 'benefits'});
	
	// Load image details...
	var xhr = new Request.JSON({
		url:'benefits',
		onSuccess:function(response) {
			//Implement the benefits slider...
			var slider = new Benefits({
							  'images':response,
							  'controls':'#slide-controls',
							  'container':'banner',
							  'loadingImage':'img/ajax-loader.gif'
							  });

		},
		onFailure:function() {
			alert('there was a problem loading images, please try again later.');
		}
	}).send();
	
	// TOOL TIPS 
	//store titles and text
	$$('.tips').each(function(element,index) {
		element.store('title', element.get('title'));
	});
	
	//create the tooltips
	var tips = new Tips('.tips',{
		className: 'tips',
		fixed: true,
		hideDelay: 50,
		showDelay: 50,
		text:false,
		offset:{x:-40,y:-45}
	});
	
	tips.addEvents({
	'show': function(tip) {
		tip.fade('in');
	},
	'hide': function(tip) {
		tip.fade('out');
	}
});


});