// FILE IS IDENTICAL TO js_photo_popup.js, except calls a FUNCTION that can be recalled every time new html is inserted in dom.  FILE SETS UP SHADOWBOX DISPLAY OF PHOTO AND REVIEW LINKS
function reset_shadowbox_lnks(url_prefix){

Shadowbox.init({
skipSetup: true
	});

// when Click, gets the div ID for pics and displays it
$(".photlink").click(function(event) 
{
event.preventDefault();
var dest = $(this).attr("title");
var div_id = $(this).attr("id");
div_id = div_id.replace("a_","d_");

//START position the div
var shiftleft = 60;
var shifttop = -50;
var obj = this;
while (obj.offsetParent) 
	{
	shiftleft += obj.offsetLeft;
	shifttop += obj.offsetTop;
	obj = obj.offsetParent;
	}
// replace 0 with an integer to offset the vertical position 
shifttop += this.offsetHeight + 0;
if (document.body.currentStyle && document.body.currentStyle['marginTop']) 
	{
	shifttop += parseInt(document.body.currentStyle['marginTop']);
	}
shifttop = shifttop + "px";
shiftleft = shiftleft + "px";
$("#" + div_id).css({ top: shifttop, left: shiftleft });
//END position the div
// get the pic links via ajax
$.post(url_prefix + "ajax/responses/resp_photo_popup.php", { destination: dest}, function(data)
	{
	//setup the shadowbox
	$("#" + div_id).html(data);
		Shadowbox.setup("#" + div_id + " a", {
	     	gallery: "View photos",
			overlayOpacity: 0.7,
			continuous: true,
			displayCounter: false,
			slideshowDelay: 6
		    });
	// start the shadowbox
	$("#" + div_id + " a:first") .click();
	});

});
// end of $(".photlink") events 	

$(".review_link").click(function(event) 
{
event.preventDefault();
	//setup the shadowbox
	var titl = $(this).attr("title");
	var href = $(this).attr("href");
	Shadowbox.open({
        content:    href,
        player:     "iframe",
        title:      titl
    });
});

}
