var activeImage = 0;
var imageLength;
$(document).ready(function() {
	
	imageLength = $("#listimages img").length;
	if(imageLength > 1) {
		$("#left").click(function() {
			activeImage--;
			if(activeImage < 0) {
				activeImage = imageLength - 1;
			}
			s = $("#listimages img").eq(activeImage).attr("src");
			$(".rounded_big").css("background-image", "url(" + s + ")");
		});
		$("#right").click(function() {
			activeImage++;
			if(activeImage >= imageLength) {
				activeImage = 0;
			}
			s = $("#listimages img").eq(activeImage).attr("src");
			$(".rounded_big").css("background-image", "url(" + s + ")");
		});
	} else {
		$("#left").hide();
		$("#right").hide();
	}
	
	if($("#filetree a.openclose").length > 0) {
		$("#filetree  a.openclose").each(function() {
			$(this).click(function() {
				v = $(this).parent("li").find("ul").eq(0);
				if($(v).is(":visible") == false) {
					$(v).show();
				} else {
					$(v).hide();
				}
			});
		});
	}
});
