isBigImageOpen = false;
largeImgIndex = 0;
$(document).ready(function(){

	$("#d_thumbnails ul li a").click(function(){
		//alert('test');
		//var img = document.createElement('img');
		crossFade($(this).attr('href'), $(this).attr('id') - 1);
		return false;
	});

	$("#large>img").load(function(){$("#large>img:hidden").fadeIn("slow")});
});


function getImegeSrc(index) {
	src_img = url_prefix+'Upload/'+photos_info[index][1]+'/'+photos_info[index][2]+'/Photo/'+photos_info[index][3];
	return src_img;
}

function crossFade(src_img, photo_number) {
		var img = document.createElement('img');
		//alert(photos_info[photo_number]);
		//alert('1');
		$(img).attr({"src": src_img, "width": photos_info[photo_number][1],"height": photos_info[photo_number][2]});
		$(img).css({'position': 'absolute', 'display':'none'})
		//$(img).addClass('details_absolute');
		//alert('2');
		var left_align = (350 - photos_info[photo_number][1]) / 2;
		var top_align = (220 - photos_info[photo_number][2]) / 2;
		$(img).css({"left": left_align, 'top': top_align });
		//alert('3');
		$("#d_large_image img").fadeOut("2000", function(){
			$("#d_large_image img:first").remove();
			//alert('4');
		});
		$(img).appendTo("#d_large_image");
		//alert('5');		
		$("#d_large_image>img").fadeIn("2000");
		/*
		$("#number_of_photo").text(photo_number + 1);
		largeImgIndex = photo_number;
		*/
}
