$(document).ready(function(){


   $('#showImage').css('display', '');

   $('#showImage').hide();
   $("#img_shower").hide();
   
   $(".clickImage").click(function(event){
   
   
      
      var tmp = $(this).children().attr( "src" );
	  var alt = $(this).children().attr("alt");
      tmp = tmp.substr( 0, tmp.length - 10 );
      tmp = tmp + ".jpg";
	  var desc = $(this).html().toString();
	  var index = desc.indexOf("<p class=\"staff_desc\">");
	  if(index == -1)
	  	index = desc.indexOf("<P class=staff_desc>")-2;
	  var length = desc.length;
	  length = desc.indexOf("</p>");
	  if(length == -1)
	  	length = desc.indexOf("</P>")+2;
	  length = length-3;
	  var staffDesc = desc.substring(index+22,length);

      $('#inner_img_float').css('background-image', "url('" + tmp + "')" );
      $('#inner_img_float').html("<h4>"+alt+"</h4>" + "<p>" + desc.substring(index+22,length) + "</p><hr /><div style='text-decoration:none;background:white'>Click anywhere to close</div>");
	 

   
      $('#showImage').show();
      
      
   
      $("#img_shower").fadeIn(1000);
      
   });

   $("#showImage").click(function(event){
   
        $('#showImage').hide();
        $('#img_shower').hide();
        var floatimg = document.getElementById("inner_img_float");
        floatimg.setAttribute("src", "");
      
   });
   
 });
 



