window.addEvent('domready', function() {

	Element.implement({
		flash: function(to,from,reps,prop,dur) {
			
			//defaults
			if(!reps) { reps = 1; }
			if(!prop) { prop = 'background-color'; }
			if(!dur) { dur = 250; }
			
			//create effect
			var effect = new Fx.Tween(this, {
					duration: dur,
					link: 'chain'
				})
			
			//do it!
			for(x = 1; x <= reps; x++)
			{
				effect.start(prop,from,to).start(prop,to,from);
			}
		}
	});
	
	new SmoothScroll({ duration:700 }, window); //700 milliseconds to get there
	
	function showProducts() {
		$('subRange').setStyle('display','block');
	}
	
	function hideProducts() {
		$('subRange').setStyle('display','none');
	}
	
	$('range').addEvent('mouseenter',function() {
		showProducts();
	});
	
	$('range').addEvent('mouseleave',function() {
		hideProducts();
	});
	
	
	
	if($('addedNotification')) {
		$('addedNotification').flash('#FFD400','#FFFFFF',2,'background-color',500);		 
	}
	
	
	if($$('.seatbelt')) {
		$$('.seatbelt').addEvent('change',function() {
			if(this.checked == true) {
				var toselect = "thirdpoint_"+this.id.replace('seatbelt_','');			
				if($(toselect)) {
					$(toselect).checked = true;
				};
			}
		})

		$$('.seatbelt').addEvent('click',function() {
			if(this.checked == true) {
				var toselect = "thirdpoint_"+this.id.replace('seatbelt_','');			
				if($(toselect)) {
					$(toselect).checked = true;
				};
			}
		})
		
	}
		

})