function SmoothScroll() {
	$('.scroll').click(function() {
	  if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	  && location.hostname == this.hostname) {
		var $target = $(this.hash);
		$target = $target.length && $target
		|| $('[name=' + this.hash.slice(1) +']');
		if ($target.length) {
		  var targetOffset = $target.offset().top;
		  $('html,body')
		  .animate({scrollTop: targetOffset}, 1000);
		 return false;
		}
	  }
	});
}

$(document).ready(function(){
	
	SmoothScroll();
	$(document).pngFix();
	
	var volatile = $("input[type=text]")
	volatile.focus(function(event){
        if ($(this).val() == $(this).attr("title") ){        
            $(this).val("");
        }}, volatile.blur(function(event){
            if ($(this).val() == "" ){        
                $(this).val($(this).attr("title"));
            }
        }
    ));
	
	$("#homeBanner ul").carouFredSel({
		items:1,
		scroll: {
			pauseOnHover: true,
			easing: "easeInOutExpo",
			duration: 1000
		},
		prev: "#homeBanner div.controls .prev",
		next: "#homeBanner div.controls .next"
	});
	
	
	$(".thumbs a").click(function() {
		var mainImagePath = $(this).attr("href"); //Find Main Image
		var mainImage = $(".selectedThumb img"); // Image to replace
		
		mainImage.fadeOut('slow', function(){
			mainImage.attr('src', mainImagePath);
			mainImage.fadeIn('slow');
		});
		
			
		return false;		
	});
	
	
});

