$(document).ready(function() {
	
	if (screen.width<=1440) {
	
		$('.hp').css("background-image", "url(/img/bg_small.jpg)");  
	
	} else if ( (screen.width>1440) && (screen.width<=1680) ) {
		
		$('.hp').css("background-image", "url(/img/bg_medium.jpg)");  
		
	} else {
	
		$('.hp').css("background-image", "url(/img/bg_large.jpg)");  
	
	}
	
	// CHANGE THE HEIGHT OF THE CONTAINER IF ITS NOT REACHING FULLSCREEN STATUS
	var footerHeight = $('#footer').height();
	var headerHeight = $('#header').height();
	var containerHeight = $('#container').height();
	var contentHeight = containerHeight + headerHeight;
	
	//alert ("WINDOW HEIGHT: "+$(window).height()+" / CONTENT HEIGHT: "+($('#container').height()+headerHeight));
	
	// CHECK TO THE SEE IF IT COVERS VIEWPORT
	if ( contentHeight < $(window).height() ) {
		
		//COVER RUDOLPH IMAGE TO BOTTOM OF BROWSER WINDOW
		//var newContainerHeight = $(window).height() - headerHeight;
		
		// COVER RUDOLPH IMAGE BUT PUT FOOTER TO BROWSER BOTTOM
		var newContainerHeight = $(window).height() - ( (headerHeight + footerHeight) + parseInt($('#footer').css('padding-bottom').replace("px", "")) );
		//alert(newContainerHeight);
		$('.hp').css('height', newContainerHeight);
		
	}
	
});

function getFancy(hr, w, h) {
		
		$.fancybox({
			'padding'           : 12,
			'autoScale'     	: false,
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'href'				: hr,
			'width'				: w,
			'height'			: h,
			'overlayColor'		: '#003366'
		});
		
	}
