jQuery(window).load(function() {
    // Side shadows height fix
	var w = $('#content').innerHeight();
	$('#leftshadow, #rightshadow').height(w);
	
	// Navigation Hover
	$('#nav li').not('.active').find('span a').hover(function() {
		$(this).parents('li').addClass('active');
	}, function() {
		$(this).parents('li').removeClass('active');
	});
	
	// Checkbox/Radio styles
	$('input[type="checkbox"], input[type="radio"]').addClass("radio-check");
	
	// Excess footer height
	var f = $('#grad_background>.container_16').outerHeight() + $('#footer').outerHeight();
	var h = $(document).height() - f;
	if (h>0) {
		var fb = $('#fb-inner').height() + h;
		$('#fb-inner').height(fb);
	}
	
	// Portfolio left height
	var h = $('#portfolio_right').height() - 60;
	$('#image_bank').height(h);
	
	var itemHeight = -10;
	var scrollItems = $('#image_bank .item');
	scrollItems.each(function(index,item) {
		itemHeight += $(this).outerHeight(true);
		
		if (index == (scrollItems.length - 1)) {
			if (itemHeight <= h) {
				$('#image_bank').removeClass('scrollable');
				$('#actions').hide();
			}
		}
	});
	
	// iPhone Scroller buttons
	$('#portfolio_left.mobile').hover(function() {
		$('.mobile .action p').fadeIn();
	}, function() {
		$('.mobile .action p').fadeOut();
	})
});

// Cufon Replacement
Cufon.replace('#nav ul li a, #masthead header p, h3, th, .submit, #breadcrumb li a, h2:not(.postit>h2):not(.highlight>h2), .header h4, #footer-contact p, .news-entry p.date, .news-entry .meta span', { fontFamily: 'Museo 500' });
Cufon.replace('h1, .postit h2, #contactform label', { fontFamily: 'Complete In Him' });
