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(){
	
	$(document).pngFix();
	Shadowbox.init();
	SmoothScroll();
	
    $("a[rel*='external']").attr({ target: "_blank" });

	var volatile = $(".field input")
	volatile.focus(function(event){
        if ($(this).val() == $(this).attr("title") ){        
            $(this).val("");
        }}, volatile.blur(function(event){
            if ($(this).val() == "" ){        
                $(this).val($(this).attr("title"));
            }
        }
    ))

//Cufon

	Cufon.replace('h1, h2, .telephoneNumber')
	
	$('#slideShow').cycle({ 
		delay:  2000, 
		speed:  500
	})

//Lightbox
	
var lightbox = $("#galleryThumbs").ariaLightbox({
				imageArray: "a.lightbox",
				altText: function() {
					// $(this) is the triggered element (in this case the link element)
					return $(this).find("img").attr("alt");
				},
				descText: function() {
					return $(this).find("img").attr("title");
				},
				useDimmer: true,
				pos: "auto",
				titleText: "Gallery",
				em: false
			});		

});

