jQuery(document).ready(function($){						
    
	// Add platform classes
	if (navigator.appVersion.indexOf("Mac")!=-1) {
	$('html').addClass('mac');
	} else {
		$('html').addClass('pc');
	}
	
	if (parent.frames[1]){
		$('html').addClass('framed');
	}
	
	$("#site-title").lettering();
	
	$("#site-title").fitText(0.7, { minFontSize: '20px', maxFontSize: '96px' })
	
   $('a[href*=#]').bind('click', function(e) {
        e.preventDefault(); //prevent the "normal" behaviour which would be a "hard" jump

        var target = $(this).attr("href"); //Get the target

        // perform animated scrolling by getting top-position of target-element and set it as scroll target
        $('html, body').stop().animate({ scrollTop: $(target).offset().top }, 400, function() {
             location.hash = target;  //attach the hash (#jumptarget) to the pageurl
        });

        return false;
   });
   
	
	$('#colophon').waypoint(function(event, direction) {
		if (direction === 'down') {
		
			$('#enquire').removeClass('sticky', direction === "down");
		
  		 }
  		 else {
      		$('#enquire').addClass('sticky', direction === "up");

  		 }
			}, {
		offset: function() {
   			return $.waypoints('viewportHeight') - $('#enquire').outerHeight();
		}
	});
                
});
