    $(function(){
        $('.thumb').click(function(){initShowroom(this);return false;});
    });

	function initShowroom(anchor)
		{
		var uid = new Date().getTime();
    	$('body').append('<div class="showroom"><a href="javascript:;" onclick="hideShowroom();"></a><div><img id="'+uid+'" src="'+anchor.href+'" /></div></div>')
    	  .append('<div class="shadowscreen" style="height:'+$(document).height()+'px;"></div>');
    	$('#'+uid).load(function(){displayShowroom(this.width,this.height);});
		}

    function displayShowroom(w,h)
    	{
    	if(h>800) {w+=15;h=600;}
	    $('.showroom').css({top:($(document).height()-h)/2+'px', left:($(document).width()-w)/2+'px',opacity:1.0});
	    $('.showroom div')
	      .css({'margin-left':parseInt(w/2)+'px','margin-top':parseInt(h/2)+'px',height:'0px',width:'0px'})
	      .animate({width:w,height:h,'margin-top':0,'margin-left':0},250,function(){$('.showroom a').show();$('.shadowscreen').fadeIn(200);});
    	$('.shadowscreen').click(function(){hideShowroom();});
    	}

    function hideShowroom()
    	{
    	$('.shadowscreen').fadeOut(200,function(){$('.shadowscreen').remove();});
    	$('.showroom a').hide();
    	$('.showroom div').animate({'margin-left':$('.showroom div').width()/2,'margin-top':$('.showroom div').height()/2,width:0,height:0},200,function(){$('.showroom').remove();});
    	}
