// JavaScript Document
var s = 0;
$("#port").hide();
$("#container").css({'z-index':"2"});
$("#container").css({backgroundPosition: '0px 0px'});
$("#menuMain > *").click(function () {
 var clickedLink = $(this).attr("id");
   
  if(clickedLink == 'webLink'){
   if(s == 0){ 
   $("#container").animate({backgroundPosition: '0px 1000px'}, 600);   
    $("#social").animate({top: "130px"}, 600, function(){
	 $("#port").css({'z-index':"5"});
     $("#port").load("htm/webPieces.html").delay(200).animate({left: '0px'}, 600).fadeIn("slow");
	 s = 1;									 
    });//End menuMain callback function
   } //End if s=0
  } //end if clickedLink = web
  
  
  if(clickedLink == 'printLink'){
   if(s == 0){  
    $("#container").animate({backgroundPosition: '0px 1000px'}, 600);
    $("#social").animate({top: "130px"}, function(){
	 $("#port").css({'z-index':"5"}); //portfolio forward
     $("#port").load("htm/printPieces.html").delay(200).animate({left: '0px'}, 600).fadeIn("slow");
	 s = 2;
    });//End header callback function
   } //End if s=0
  } // End if clickedLink = print
    
 if(clickedLink == 'webLink' && s != 1){
    $("#port").fadeOut("slow", function(){
	 $("#port").load("htm/blank.html")
	 $("#port").load("htm/webPieces.html");
	 $("#port").fadeIn("slow");
	 s=1;
	});
   } // End if clickedLink = web	
  
  if(clickedLink == 'printLink' && s != 2){
     $("#port").fadeOut("slow", function(){
	 $("#port").load("htm/blank.html")
	 $("#port").load("htm/printPieces.html");
	 $("#port").fadeIn("slow");
	 s=2
	});
   } // End if clickedLink = web	

}); //End menu click function


