$(document).ready(function(){
						   
	$("#logo").click(function () { 
      
	  $("#content").fadeOut("slow");
	  setTimeout(function(){window.location='index.asp';}, 500);
	  
	
	  
	  
	  
    });

  $("#footer").hide();
	
	$("#foo").click(function () { 
      
	  if( $("#footer").is(':visible') ) {
    	$("#footer").fadeOut();
		}
		else {
		$("#footer").fadeIn();
	  }
	  
    });
	 
		
	$("#onama").click(function () { 
      
	  if( $("#onama2").is(':visible') ) {
    	$("#onama2").fadeOut();
		}
		else {
		$("#onama2").fadeIn();
	  }
	  
    });	
	
	
	$("#clanovi").click(function () { 
      
	  if( $("#home").is(':visible') ) {
    	$("#home").animate({"margin-left":"2000px"}, 1000); 
		$("#home").fadeOut();
		}
		else {
			$("#home").fadeIn();
		$("#home").animate({"margin-left":"0px"}, 1000);
	  }
	  
    });	
	
	
	(function() {
		//settings
		var fadeSpeed = 0, fadeTo = 1, topDistance = 30;
		var topbarME = function() { }, topbarML = function() {  };
		var inside = false;
		//do
		$(window).scroll(function() {
			position = $(window).scrollTop();
			if(position > topDistance && !inside) {
				//add events
				topbarML();
				$('#footer').bind('mouseenter',topbarME);
				$('#footer').bind('mouseleave',topbarML);
				inside = true;
			}
			else if (position < topDistance){
				topbarME();
				$('#footer').unbind('mouseenter',topbarME);
				$('#footer').unbind('mouseleave',topbarML);
				inside = false;
			}
		});
	})();
	
		
  });  
  
	function povisi(kaj) {   

		var zoom = "#" + kaj + "z";
		$(zoom).fadeIn("slow");
		
		$(zoom).mouseout(function () {       
	  
	  		$(zoom).fadeOut();
	  
    	});
	
	};

