$(document).ready(function() {
	
	
	$("#moretxt").click(function() {
		var t = $(".text-kolom").css("height");
		t = parseInt(t);
		$("#main-text").animate({scrollTop: t}, 500);
		return false;
	});
	$("#lesstxt").click(function() {
		$("#main-text").animate({scrollTop: 0}, 500);
	});
	
	$(".block img").hover(function() {
		if($(this).attr("over")) {
			$(this).attr("src", $(this).attr("over"));
		}
	}, function() {
		if($(this).attr("out")) {
			$(this).attr("src", $(this).attr("out"));
		}
	});
	if($(".scrollable").length > 0) {
		$(".scrollable").scrollable({ vertical: true});
		var scrol = $(".scrollable").data("scrollable");
		
		ac = $(".scrollable").find("div.active").index();
		if(ac > 0) {
			scrol.seekTo(ac, 500);
		}
	
		
		$(".scrolsearch").click(function() {
			
			$(".scrolsearch").removeClass("active");
			$(this).addClass("active");
			
			scrol.seekTo($(this).attr("rel"), 500);
			return false;
		});
	};
	
	if($(".scrolhor").length > 0) {
		if($(".scrolhor").find("div .list").length > 1) {
			$(".scrolhor").scrollable();
		} else {
			$("#actions").hide();
		}
	}

	if($(".scrollist").length > 0) {
		if($(".scrollist").find("div .list").length > 1) {
			$(".scrollist").scrollable({next:".nextlist", prev:".prevlist", vertical: true});
			var scr = $(".scrollist").data("scrollable");
			var start = $(".scrollist").attr("start");
			if(start > 1) {
				scr.seekTo((start-1));
			}
		} else {
			$(".listactions").hide();
		}
	}

	$(".menu li").hover(function() {

		$(this).children("ul").show();
	}, function() {
		if($(this).hasClass("active")) {
			
		} else {
			$(this).children("ul").hide();
		}
	});
});
