document.write('<style type="text/css">#main, #grid-v, #grid-h { -moz-opacity:.0; filter:alpha(opacity=0); opacity:.0; }</style>');
document.write('<style type="text/css">#grid-v, #grid-h { margin-top:-9000px; }</style>');
function fadePage(){ 
    $('#main').animate({ 
	opacity: 1
	}, 600 );
}
	
setTimeout("fadePage()",800);

$(document).ready(function() {
	$(document).keypress(function(e) {
		switch(e.which)
		{
			case 118:	
				showViaKeypress("#grid-v");
				break;
			
			case 104:	
				showViaKeypress("#grid-h");
		}
	});
});

function showViaKeypress(element_id) {
	myopacity = $(element_id).css("opacity");
	if(myopacity < 1) {
		$(element_id).css("margin-top","0px");
		$(element_id).animate({ opacity: 1}, 600 );
	} else {
		$(element_id).animate({ opacity: 0}, 600, function(){
		  $(element_id).css("margin-top","-9000px");
		});
	}
}
$(document).ready(function() {
		$('.button').append('<span class="hover"></span>').each(function () {
	  		var $span = $('> span.hover', this).css('opacity', 0);
	  		$(this).hover(function () {
	    		$span.stop().fadeTo(300, 1);
	 		}, function () {
	   	$span.stop().fadeTo(300, 0);
	  		});
		});
});

function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
setTimeout("equalHeight($('.equalize'))",900);
