EFFGallery = {
		active: 0,
		init : function() {
			$("#big_photo").css("cursor","pointer");
			$(".small_photo").css({display:"block",float:'left'});
			$("#detail_gallery span").css({display:"none"});
			$("#detail_gallery a").hover(function(){
				$(this).fadeTo('fast',1);
			}, function() {
				if (!$(this).hasClass('.selected-image')) {
					$(this).fadeTo('fast',0.5);
				}
			});
			$("#detail_gallery a").click(function() {
				var newSrc = $("span",this).text();
				$('#detail_gallery a').fadeTo('fast',0.5);
				$('#detail_gallery a').removeClass('selected-image');
				$('#detail_gallery a').each(function(i,e){
					if (newSrc == $("span",this).text()) {
						$(this).fadeTo('fast',1);
						$(this).addClass('selected-image');
						EFFGallery.active = i;
					}
				});
				$("#big_photo").attr("src",newSrc);
			});
			$("#big_photo").click(function() {
				var next = EFFGallery.active+1;
				if (next > $("#detail_gallery a").size()-1) {
					EFFGallery.active = 0;
					next = 0;
				}
				$("#detail_gallery a").eq(next).click();
				console.log(EFFGallery.active);
			});
			$("#detail_gallery a:first").click();

		}
	}