var windowWidth, newPhotoFolder, largePhotoSize;
var metaColumnWidth = 251;
var photoFolder = "/750/";

$().ready(function() {
	/*
	setPhotoFolder();
	
	$(window).resize(function() {
		setPhotoFolder();
	});
	*/
	conditionalShowExplanation();
});

function setPhotoFolder() {
	windowWidth = $(window).width();
	if (windowWidth >= 1275) {
		newPhotoFolder = "/1000/";
		largePhotoSize = 1000;
	} else if ((windowWidth >= 1000) && (windowWidth < 1275)) {
		newPhotoFolder = "/750/";
		largePhotoSize = 750;
	} else {
		newPhotoFolder = "/500/";
		largePhotoSize = 500;
	}
	var photoSrc = $("img.photo").attr("src");
	photoSrc = photoSrc.replace(photoFolder, newPhotoFolder);
	$("img.photo").attr("src", photoSrc);
	photoFolder = newPhotoFolder;
	
	// set cookie
	$.cookie('largePhotoSize', largePhotoSize, { expires: 90, path: '/' });	
}

function conditionalShowExplanation() {
	if ($.cookie('tagExplanationShown') == null) {
		setTimeout("$('#tagExplain').fadeIn(500);", 1000);
		// set cookie
		$.cookie('tagExplanationShown', 'true', { expires: 90, path: '/' });	
	}
}