$(document).ready(function() {

	// Slider
	
	$("body.home span.text:not(:eq(0))").css("opacity", 0);

	$("#slides").easySlider({auto: true, continuous: true, speed: 700, pause: 8000});
	
	//if it supports opacity (ie7+) animate, otherwise show/hide
	
	if (jQuery.support.opacity) {
	
		$("#slide-left, #slide-right").css("opacity",0);	
		
		$("#slider li, #slider .dots, #slide-left, #slide-right, span.text").hover(function () {
			$("#slide-left, #slide-right").dequeue().animate({
				opacity: 1.0
			}, 300);
	  	},
		function () {
			$("#slide-left, #slide-right").dequeue().animate({
				opacity: 0
			}, 300);
		});
		
	} else {
	
		$("#slide-left, #slide-right").hide();
		
		$("#slider li, #slider .dots, #slide-left, #slide-right, span.text").hover(function () {
			$("#slide-left, #slide-right").show();
	  	},
		function () {
			$("#slide-left, #slide-right").hide();	
		});
	}
	
	$("#slide-left, #slide-right, #controls li").click(function(){
		$("span.text").dequeue().animate({
			opacity: 0
		}, 300);
	});
	
	
		
	// Back to top link
	
	$(".hr a").click(function(){
		$("html, body").animate({scrollTop:0}, 'slow');	
		return false;
	});

});
