$(function() {

	$("#otherminner > div").hide();
	var visible = 1;
	$("#menuctrl, #otherminner > span").click(function(){
			if(visible == 1){
				$("#menuctrl").css("background", "url('css/menuother.jpg') no-repeat 0 10px");
				$("#otherminner > span").fadeOut();
		  		$("#otherminner > div").slideDown();
				visible = 0;
			}
			else {
				$("#menuctrl").css("background", "url('css/prev_h.jpg') no-repeat 0 10px");
				$("#otherminner > span").fadeIn();
	  			$("#otherminner > div").slideUp();
				visible = 1;
			}
		});

	$("#dolu").hide();
	$(".scrollable").scrollable({keyboard: false});

			$("#nahoru").click(function(){
				$("#block1").animate({"top": "-=165px"}, "slow");
				$("#block2").animate({"top": "-=165px"}, "slow");
				$(this).hide();
				$("#dolu").show();
			});
			$("#dolu").click(function(){
				$("#block1").animate({"top": "+=165px"}, "slow");
				$("#block2").animate({"top": "+=165px"}, "slow");
				$(this).hide();
				$("#nahoru").show();
			});

	$("a[rel^='fancybox']").fancybox();

	$("div.img_shadow > a").mouseover(function(event){
		event.preventDefault();
		//$.fancybox.cancel();

		var img = $(this).attr('href');
		var rel = $(this).attr('rel');
		var alt = $(this).children('img').attr('alt');
		var img_b = img.replace(/.jpg/, '_b.jpg');
		var clasa = $(this).attr('class');
		$("div#main_pic > a > img").attr('src', img_b);
		$("div#main_pic > a").attr('href', img);
		$("div#main_pic > a").attr('rel', rel);
		$("div#main_pic > a").attr('class', clasa);
		$("div#main_pic > a > img").attr('alt', alt);
	});

	$("div#main_pic > a").click(function(event){
		event.preventDefault();
		$.fancybox.cancel();
		var node = "div.img_shadow > a[rel='"+$(this).attr('rel')+"'][class='"+$(this).attr('class')+"']";
		$(node).click();
	});

	$("#main_menu li").hover(
		function() { $(this).addClass("iehover"); },
		function() { $(this).removeClass("iehover"); }
  );

	try{
	
 		$("div#makeMeScrollable").smoothDivScroll({
			autoScroll: "always",
			autoScrollDirection: "endlessloopright",
			autoScrollStep: 1,
			autoScrollInterval: 25
		});
	}
	catch(e){}
});


