$(".photoblock").click(function(){
$("#photoboard").fadeOut("slow");
$(this).css("background-color","#7c2916");
$("#loading_message").show();
//post the pictureID to controller and return the picture and embed it to the photoboard.
$.ajax({
type:"post",
data: "picID=" + $(this).attr("id"),
url:"<?=base_url()?>photogallery/getPhoto",
success: function(result)
{
$("#photoboard").fadeTo("slow", 0.85).fadeIn("normal").html(result);
$("#loading_message").hide();
},
error: function()
{
$("#loading_message").hide();
alert("ajax error");
}
});
});