
var Properties = {
	detailsInit: function()
	{
		$("#nextPhoto").click(Properties.nextPhoto);
		$("#previousPhoto").click(Properties.previousPhoto);
	},
	
	previousPhoto: function()
	{
		if (iCurrentPhoto > 0)
		{
			iCurrentPhoto--;
		}
		else
		{
			iCurrentPhoto = 0;
		}
		
		Properties.swapPhoto();
		return false;
	},
	
	nextPhoto: function()
	{
		var iStop = aPhotos.length - 1;
		if (iCurrentPhoto < iStop)
		{
			iCurrentPhoto++;
		}
		else
		{
			iCurrentPhoto = iStop;
		}
		Properties.swapPhoto();
		return false;
	},
	
	swapPhoto: function()
	{
		$("#previousPhoto").unbind();
		if (iCurrentPhoto == 0)
		{			
			$("#previousPhoto").addClass("inactive");
		}
		else
		{
			$("#previousPhoto").click(Properties.previousPhoto);
			$("#previousPhoto").removeClass("inactive");
		}
		
		$("#nextPhoto").unbind();
		if (iCurrentPhoto == aPhotos.length - 1)
		{
			$("#nextPhoto").addClass("inactive");
		}
		else
		{
			$("#nextPhoto").click(Properties.nextPhoto);
			$("#nextPhoto").removeClass("inactive");
		}
		
		$("#photoCount").html((iCurrentPhoto + 1));
		document.getElementById("photoDisplayer").src = aPhotos[iCurrentPhoto];
	}
}
