$(window).load(function(){

});

$(window).resize(function(){
	if($(window).height() > 969){
		$('#global').center(); // Center vertical, horizontal on page
	} else {
		$('#global').horizCenter(); // Center vertical, horizontal on page
	};
	
	if($(window).width() > 1280){
		$("#red-bar").css("width", ($(window).width() - 1280) / 2 + 10 + "px");
		$("#red-bar").css("height", $(window).height() + 50 + "px");
	}
	
	
});

jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
    this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
    return this;
}

jQuery.fn.horizCenter = function () {
    this.css("position","absolute");
    this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
    return this;
}

$(document).ready(function() {
	if($(window).height() > 969){
		$('#global').center(); // Center vertical, horizontal on page
	} else {
		$('#global').horizCenter(); // Center horizontal on page
	};
	
	if($(window).width() > 1280){
		$("#red-bar").css("width", ($(window).width() - 1280) / 2 + 10 + "px");
		$("#red-bar").css("height", $(window).height() + 50 + "px");
	}
	
	$("ul.staff li").hover(function() { //On hover...

		var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'

		//Set a background image(thumbOver) on the <a> tag - Set position to bottom
		$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat left bottom'});

		//Animate the image to 0 opacity (fade it out)
		$(this).find("span").stop().fadeTo('normal', 0 , function() {
			$(this).hide() //Hide the image after fade
		});
	} , function() { //on hover out...
		//Fade the image to full opacity 
		$(this).find("span").stop().fadeTo('normal', 1).show();
	});

});

