function setUpPhotoAlbumSB() {
	var contentDivs = new Array();
	var contentDiv=document.getElementById("content_text");
	contentDivs = contentDiv.getElementsByTagName('div');
	for (i=0; i<contentDivs.length; i++) {
		if (contentDivs[i].className=='thumbnail-frame') {
			var theLink=contentDivs[i].getElementsByTagName('a');
			for (j=0; j<theLink.length; j++){
				var htmlURL=theLink[j].getAttribute('href');
				var imageURL=htmlURL.replace(/html/, 'jpg');
				theLink[j].setAttribute('href', imageURL);
				theLink[j].setAttribute('rel', 'shadowbox[photoSet]');
			}
	    }
	}
}
	    	
function setUpSB(){
	Shadowbox.setup(".thumbnail-frame a", {
		gallery:"My Movies"
	});
}

function checkEnabled() {
	var theSBAutoDiv=document.getElementById('SBAuto');
	var theSBAutoHeight;
	if (theSBAutoDiv.currentStyle) {
		theSBAutoHeight=theSBAutoDiv.currentStyle.height;
	}
	else if (window.getComputedStyle) {
		theSBAutoHeight=window.getComputedStyle(theSBAutoDiv, null).height;
	}
	
	if (parseInt(theSBAutoHeight)==0) {
		return;
	}
	
	else {
		setUpPhotoAlbumSB();
		setUpSB();
	}
}

if(!((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))) {
	addLoadEvent(checkEnabled);
};