$(document).ready(function() {
	//Set Footer
    head_height = $('#header').height();
	foot_height = $('#footer').height();
	offset = head_height + foot_height;
	windowHeight = parseInt($(window).height());
	newHeight = windowHeight - offset;
	$('#main').css('min-height', newHeight-26);
	
	//Attach Cufon fonts
	Cufon.replace('#navigation ul li', {fontFamily: 'Gotham', hover: true});
	Cufon.replace('h1.page-title', {fontFamily: 'Neutra Text TF Light', hover: true});
	Cufon.replace('h2.sub-content-h2');
	Cufon.replace('.caption');
	$('#menu').jmenu();
	
	$('#slide').cycle({ 
	    fx:     'fade',
		cssBefore:{ height:0,width:0},
		animIn:{ height:214,width:315},
	    speed:  'fast', 
	    timeout: 0, 
	    next:   '#next', 
	    prev:   '#prev' 
	});
	
	$('#home-slide').cycle({ 
	    fx:     'fade',
		cssBefore:{ height:0,width:0},
		animIn:{ height:334,width:494},
	    speed:  'slow', 
	    timeout: 6000
	});
});

$(window).bind('resize', function() {
    head_height = $('#header').height();
	foot_height = $('#footer').height();
	offset = head_height + foot_height;
	windowHeight = parseInt($(window).height());
	newHeight = windowHeight - offset;
	$('#main').css('min-height', newHeight-26);
});

function replaceFooter() {
	head_height = $('#header').height();
	foot_height = $('#footer').height();
	offset = head_height + foot_height;
	windowHeight = parseInt($(window).height());
	newHeight = windowHeight - offset;
	$('#main').css('min-height', newHeight-26);
}
