// Stop page going off the top of the screen when resized
function topBlocker(){
	($(window).height() <= 690 ? $('#wrapper').addClass('small_window') : $('#wrapper').removeClass('small_window'));
};

function formSpamSetup(){
	if($('#appointment_form').size() > 0){
		$('#appointment_form').prepend('<input type="hidden" name="human" id="human" value="human" />')
	}
}

// Window & Loading Events
$(window).resize(function(){
	topBlocker();
});

$(document).ready(function() {	
	// 
	topBlocker();
	formSpamSetup();
	
	
	// Cufon
	if($('h1:first').hasClass("staff")){
		// On team pages?
	} else {
		Cufon.replace('h1');		
	};
	Cufon.replace('h2');
	Cufon.replace('h4');
	Cufon.replace('h5');
	Cufon.replace('h6');
	Cufon.replace('#blurb',{hover:true});
	Cufon.replace('#offers h3');
	// Cufon.replace('#offers p',{hover:true});

	if($('#cycle ul li').size() > 1){
		$('#spec_offers').append('<a href="" id="next">Next</a>');
	}		
	
	if($('#gallery')){
		$('#gallery').cycle({
			fx: 'fade'
		});
	}
	
	if($('#cycle')){
		$('#cycle ul').cycle({ 
		    fx:     'fade', 
		    speed:  'fast', 
		    timeout: 0, 
		    next:   '#next', 
		    prev:   '#prev',
				height: 110
		});		
	}
	
});