function SwitchThumbImage(id,newsrc)
{
    
    $("#"+id).attr("src",newsrc);
    $("#"+id).css("cursor","pointer");
}

function RestoreThumbImage(id,oldsrc)
{
    $("#"+id).attr("src",oldsrc);
    $("#"+id).css("cursor","default");
}

function LoadFullsizeImage(url)
{
    $("#showroom > img").attr("src","images/ajax-loader.gif");
    $("#showroom > img").attr("width","220");
    $("#showroom > img").attr("height","19");
    $("#showroom > span").css("display","none");
    
    
    $.getJSON(url,function(json) {
//        var imghtml = '<img src="' + json.source + '" width="' + json.width + '" height="' + json.height + '" alt="" onclick="fireGallery()" onmouseover="this.style.cursor=\'n-resize\'" onmouseout="this.cursor=\'default\'" /><br /><span class="subtitle">' + json.title + '</span>';
        var imghtml = '<img src="' + json.source + '" width="' + json.width + '" height="' + json.height + '" alt="" /><br /><span class="subtitle">' + json.title + '</span>';

		Lightbox = json.lightbox;
   		lightboxStart = json.lightboxstart;
	
        $("#showroom").html(imghtml);
        $("#showroom").css("display","none");
        $("#showroom").fadeIn(200);
    });
}

function fireGallery() {
	Slimbox = new Array();	
	for (var i = 0; i < Lightbox.length; ++i) {
		Slimbox[i] = new Array(Lightbox[i]);
  	}
	if (Slimbox.length > 0) {
		jQuery.slimbox(Slimbox,lightboxStart,{initialWidth:500, initialHeight:500, overlayOpacity: 1.0, overlayFadeDuration:100, resizeDuration:1, imageFadeDuration:1, counterText:false});
	}
}   
