  function fadeOutAll(){
  jQuery('#img_template1').fadeOut(2000);
  jQuery('#img_template2').fadeOut(2000);
  jQuery('#img_template3').fadeOut(2000);
  jQuery('#img_template4').fadeOut(2000);
  jQuery('#img_template5').fadeOut(2000);
  }

jQuery(document).ready(function(){
jQuery("#thumb1").click(function(){
	fadeOutAll();
showOverlay();
	  jQuery("#img_template1").fadeIn("slow");  

	
    });

jQuery("#thumb2").click(function(){
	fadeOutAll();
showOverlay();
//alert(document.getElementById('img_template1').style.opacity);
	  jQuery("#img_template2").fadeIn("slow");
	
    });
jQuery("#thumb3").click(function(){
	fadeOutAll();
showOverlay();
	  jQuery("#img_template3").fadeIn("slow");
	
    });
jQuery("#thumb4").click(function(){
	fadeOutAll();
showOverlay();
	  jQuery("#img_template4").fadeIn("slow");
	
    });
jQuery("#thumb5").click(function(){
	fadeOutAll();
showOverlay();
	  jQuery("#img_template5").fadeIn("slow");
	
    });


});

function closeTemplate(tempId){
jQuery('#'+tempId).fadeOut(2000);
hideOverlay();
}
function showOverlay(){
jQuery("#overlay").slideDown("slow");
}
function hideOverlay(){
jQuery("#overlay").slideUp("slow");
}
function showTemplate(tempId){

	fadeOutAll();
	//jQuery("#"+tempId).fadeIn("slow");
	jQuery('#'+tempId).fadeIn("slow");
}
