function portfolioScroll (strDirection) {

	var intPortfolioMargin = pix($("#slides").css("marginLeft"));

    if((strDirection == 'left') && (intPortfolioMargin != 0)) {
		intPortfolioMargin += 796;		

        $('#ar').fadeTo('fast', 1);

        if (intPortfolioMargin == 0) {
            $('#al').fadeTo('fast', .25);
        }
    }


    if((strDirection == 'right') && (intPortfolioMargin - 780 > (-1*totalWidth))) {
		
		intPortfolioMargin -= 796;		

        $('#al').fadeTo('fast', 1);

        if (intPortfolioMargin - 780 <= (-1*totalWidth)) {
            $('#ar').fadeTo('fast', .25);
        }
    }

    $('#slides').animate({marginLeft: intPortfolioMargin+'px'}, 'slow', 'swing');
}

var totalWidth = 0;


$(document).ready(function() {

	$('#al').fadeTo('fast', .25);

	$("#slides div img").each(function(i) {
		totalWidth += $(this).width();
	});


	if(totalWidth > 796)
		$('#ar').fadeTo('fast', 1);
	else
		$('#ar').fadeTo('fast', .25);

	
	$("#slides").css("width", totalWidth + "px");

});

function str_replace(find, replace, search) {
	return search.split(find).join(replace);
}

function pix(value) {
	return parseInt(str_replace("px", "", value));
}

function closeBoxes() {
	$("#what-action").fadeOut("fast");
	$("#where-action").fadeOut("fast");
	$("#notyet-action").fadeOut("fast");
}

function showWhat() {
	$("#where-action").fadeOut("fast");
	$("#notyet-action").fadeOut("fast");
	$("#what-action").fadeIn("fast");
}

function showWhere() {
	$("#what-action").fadeOut("fast");
	$("#notyet-action").fadeOut("fast");
	$("#where-action").fadeIn("fast");
}

//MLG added to display text on homepage when orange menubar links are clicked 
function notYet() {
	$("#where-action").fadeOut("fast");
	$("#what-action").fadeOut("fast");
	$("#notyet-action").fadeIn("fast");
}

function notHere() {
	$("#notyet-action").fadeIn("fast");
}
function closeBox() {
	$("#notyet-action").fadeOut("fast");
}

