$(document).ready(function() {
		$("a[id=photonavigator]").click(function() {			
			// Get the link
			$url = $(this).attr("href");
			
			// Put the loading anigif for a while sir mam
			$("img[rel=photobody]").fadeOut("fast",function() {			
				$("img[rel=photobody]").attr("src","/images/loading.gif");
				$("img[rel=photobody]").css("border","none");
				$("img[rel=photobody]").css("margin-top","90px");
				$("img[rel=photobody]").show();
			});
			
			
			// Get the current height
			$height = $("div[id=photowrapper]").css("height");
			
			// Hide the old comments exif etc
			$("#commentandstuff").hide();
			
			// Preserve the height
			$("div[id=photowrapper]").css("height",$height);
			/*
			// Load the new image			
			$.ajax({
				url: $url,
				cache: false,
				data: "runtime=no",
				error: function() {
				alert('est');
					return true;
				},
				success: function(html){
				
					$("#results").html(html);	
					
					$("div[id=photowrapper]").css("height","auto");
					// Assign the comments ajax
					
					assignCommentAjax();
					
					return false;					
				}
			});

/*			
			$("#photowrapper").load($url, { 'runtime': 'no'},function() {
				// Height auto so there's no overflowing
				$("div[id=photowrapper]").css("height","auto");
				// Assign the comments ajax
				assignCommentAjax();				
				return false;
			});*/
			
			return true;
		});
});
