function show_about() {
    $("#about_link").css("color", "#6f6e73");
    $("#portfolio_link").css("color", "#0d090a");

    if(!$("#galleries").is(":hidden")){
    	$("#galleries").slideUp("slow");
    }

    if( ($("#img-container").length > 0) && ($("#img-container").is(":visible"))){
    	$("#img-container").fadeOut("slow", function() {
    	    	$("#about_text").fadeIn("slow", function() {
   	    		$("#about_text").removeAttr('style');
			})
    		});
    } else {
    	$("#home_image").fadeOut("slow", function() {
    	    	$("#about_text").fadeIn("slow", function() {
   	    		$("#about_text").removeAttr('style');
			})
    		});
    }
}

function show_portfolio() {
    $("#portfolio_link").css("color", "#6f6e73");
    $("#about_link").css("color", "#0d090a");
    $("#galleries").slideDown("slow");

    if( ($("#img-container").length > 0) && $("#img-container").is(":visible") ){
    	$("#img-container").fadeOut("slow", function() {
    	    	$("#home_image").fadeIn("slow");
    		});
    } else if ($("#img-container").length > 0 && ($("#img-container").is(":hidden")) ){
    	$("#about_text").fadeOut("slow", function() {
    	    	$("#img-container").fadeIn("slow");
    		});
    } else if ($("#about_text").is(":visible"))  {
    	$("#about_text").fadeOut("slow", function() {
        	$("#home_image").fadeIn("slow");
    		});
    }
}

function show_hide_gallery() {  
    var path = window.location.href;
    if(path.match(/.php\?/)){
        $("#galleries").css("display", "");
	$("#portfolio_link").css("color", "#6f6e73");
	$("#main_container").fadeIn("slow", function() {
   	    	$("#main_container").removeAttr('style');
		$("#pic_nav").css("z-index", 1000);
	});
    } else {
	$("#main_container").fadeIn("slow");
    }
}

function cleanCaptions()
{
    //$('.caption').css('opacity', '.99999999999999');
}

function rando_homepage() 
{
    var whichImage = Math.round(Math.random()*(3-1) + 1);
    document.write('<img src="imgs/random' + whichImage + '.jpg" alt="" />');
} 

