function adjust_layout()
{
	if ( $(window).height() >= 700 )
	{
		//alert( "All good." );
		$('.left-side').css('margin-top', -350 );
		$('.display-pane').css('margin-top', -350 );
	}
	else
	{
    	//alert("RESIZE BABY");
		var top_margin = -( $(window).height() / 2 );
	    $('.left-side').css('margin-top', top_margin );
		$('.display-pane').css('margin-top', top_margin );
	}
	
	if ( $(window).width() >= 1025 )
	{
		$('.right-side').css('right', 0 );
		$('.left-side').css('right', 800 );
	}
	else
	{
		var rs_right = $(window).width() - 1025;
		var ls_right = 800 + rs_right;
		$('.right-side').css('right', rs_right );
		$('.left-side').css('right', ls_right );
	}
	
};

var resizeTimer;

$(window).resize(function() {
    clearTimeout(resizeTimer);
    resizeTimer = setTimeout(adjust_layout, 100);
});

function setup_display_pane_links()
{
	$(".sub-link").click(function(e) {

		var page = this.hash.substr(1);
		
		//alert( page );

		$(".display-pane").html("");
		$(".gallery-pane").hide();
		
		$.get(page+".php",function(gotHtml) {
			$(".display-pane").html(gotHtml);
			//$("div.wrapper").unblock();
		});

        /*
		$.get("portfolio_item.php?project="+page,function(gotHtml) {
			$(".display-pane").html(gotHtml);
			//$("div.wrapper").unblock();
		});
        */

	});
	
	if( location.hash) {
		
		var location_string = '';
		
		location_string = location.hash.substring(0, location.hash.lastIndexOf('?') );

		$("a[href="+location.hash+"]").click();
		//$("a[href="+location_string+"]").click();
	}
}

