$.fn.unwrap = function() {
  this.parent(':not(body)')
    .each(function(){
      $(this).replaceWith( this.childNodes );
    });
	return this;
};

	function valignBox(){
		var windowHeight = $(window).height();
		if(windowHeight <= 651){
			$('#splash-wrapper').wrap('<div class="emergency" />');
		} else {
			$('#splash-wrapper').unwrap();	
		}
	}
	$(document).ready(function(){
		$(function() {
			$('.home-button').find('a.content-toggler').each(function() {							 
				$(this).click(function(){
					$(this).blur();
					var theOtherOne = $(this).parent().siblings().find('.home-button-content');
					if(theOtherOne.is(':visible')){
						theOtherOne.slideUp();
						theOtherOne.parent().find('a.content-toggler').removeClass('close-this');
					}
					$(this).parent().find('.home-button-content').slideToggle();
					$(this).toggleClass('close-this');
				return false
				});				
			});
		});
		valignBox();
	});
	$(window).resize(function(){
		valignBox();
	});
