updateFeaturePhoto = function () {
	var height = frontpageImageHeight;
	var oPhoto = aBarThumbnail[barIndex];
	var img = $("#polaroidPic img");

	img.attr("src", "http://"+oPhoto.STRSERVERNAME+"/img/upload"+oPhoto.STRFOLDERPATH+"/"+oPhoto.STRFILENAME);
	img.attr("height", height);
	img.attr("width", Math.round(height*(oPhoto.INTWIDTH/oPhoto.INTHEIGHT)));
	img.attr("id", "photo"+oPhoto.INTID);

	if (oPhoto.ASTHEMES.length > 0)
	{
		$("#picTheme").html( 'of '
						   + '<a href="/browse/?category=theme&value='
						   + oPhoto.ASTHEMES[0].INTID
						   + '">' + oPhoto.ASTHEMES[0].STRNAME
						   + '</a>'
						   );
	}
	if (oPhoto.STRCITY.length > 0)
	{
		$("#picLocation").html( ' in '
							  + '<a href="/browse/?category=location&value='
							  + oPhoto.INTCITYID
							  + '">' + oPhoto.STRCITY
							  + '</a> '
							  );
	}
	if (oPhoto.STRYEARTAKEN)
	{
		$("#picYear").html( 'in '
						  + '<a href="/browse/?category=year&value='
						  + oPhoto.INTYEARTAKENID
						  + '">' + oPhoto.STRYEARTAKEN
						  + '</a> '
						  );
	}
	$("#picUser").text(oPhoto.STROWNERFIRSTNAME+" "+oPhoto.STROWNERLASTNAME);
	$("#picUser").attr("href", "/user/?id="+oPhoto.INTUSERID);
};

slideThumbnailDown = function () {
	var currThumbnail = $("#barThumbnail"+barIndex);
	//currThumbnail.animate({marginTop: "27px"}, 1000);
	//currThumbnail.removeClass("thumbnailSelected");
	currThumbnail.removeClass("jcarousel-itemSelected");
};

slideThumbnailUp = function (obj) {
	//$(obj).addClass("thumbnailSelected");
	$(obj).addClass("jcarousel-itemSelected");
	//$(obj).animate({marginTop: "0"}, 1000);
};

$(document).ready(function () {
	$("#thumbnailBar li").click(function () {
		slideThumbnailDown();
		slideThumbnailUp(this);
		var barThumbnailID = $(this).attr("id");
		barIndex = barThumbnailID.substring(12, barThumbnailID.length);
		updateFeaturePhoto();
	});

//	$("#barThumbnail"+barIndex).css("margin-top", "0");	
	
	if ($.browser.mozilla || $.browser.msie)
	{
		$("#polaroidPicBlock").dropShadow();
	}
	
/*	
	$("#polaroidPic img").click(function () {
		var oPhoto = aBarThumbnail[barIndex];
		location.href = "/user/photo/?id=" + oPhoto.INTID;
	});
*/

	$("#thumbnailBar").jcarousel({scroll: 7});
	
	$(".jcarousel-skin-welovebc .jcarousel-item").hover(
		function () {
			$(this).addClass("jcarousel-itemOver");
		},
		function () {
			$(this).removeClass("jcarousel-itemOver");
		}
	);

});