$(document).ready(function(){

/*========  Initial state: only "website" category is shown, all photo links set to 80% opacity ========== */
	 $('.catplates').hide();
	 $('#websitesplate').show();
	 $('.linkyphoto').css("opacity", "0.8");

/* =======   Images get brighter on mouse-over ======================= */
	 $('.linkyphoto').mouseover(function() { $(this).stop().fadeTo(130, 1.0);
											$('.linkyphoto').mouseout(function() {  $(this).stop().fadeTo(1400, 0.8);	});
										   });
	
/* ==== buttons at the top -- mouseover and click behavior =================   */
	  	$(".buttonz01").live('click',     function(){   $(".buttonz03").addClass("buttonz01");
													$(".buttonz03").removeClass("buttonz03");
										   			$(this).addClass("buttonz03"); 
													$(this).removeClass("buttonz01");
												 	$(this).removeClass("buttonz02");
													var revealit = $(this).attr("name");
													var revealit = revealit + "plate";
													blinkon(revealit);
													return false;
													     }   );
	$(".buttonz01").live('mouseover', function(){   $(this).addClass("buttonz02");    	   }   );
	$(".buttonz01").live('mouseout',  function(){   $(this).removeClass("buttonz02"); 	   }   );

/* ====== click on an image, open the feature box that describes the item  ==== */
	$('.itemz').click(function () { 
	  var toopen = $(this).attr("name");
	  var toopen = toopen + "inner";
	  feetur (toopen);
	  return false;
    });

/* ====== the "close" button in the upper right of the feature box  ==== */
	$('.fermezme').click(function () { 
	  $(".featureinner").hide();
	  $("#featureplate").fadeOut(1700); 
	  return false;
    });

}); /*    END OF $(document).ready(function()   */

function blinkon( blinktarg )  {      /*    to show the proper group (websites, print, etc) when a 'titlez' button is clicked   */
		  var blinkme = document.getElementById( blinktarg );
		  $('.catplates').hide();
		  $(blinkme).show();
		  $("#featureplate").hide();
		  $(".featureinner").hide();                         	
}
  
function feetur( feeturInner )  {      /*    to show appropriate detail screen when an 'itemz' link is clicked   */
		  var targinner = document.getElementById( feeturInner );
		  $('#featureplate').show();
		  $('.featureinner').fadeOut(200);
		  $(targinner).fadeIn(900);
}
