$(document).ready(function() {
	
	// Skrivanje tri ikone
	$(".sakrijtriikone").click(
		function(){
			$("#triizbora").slideToggle('slow'); // Sakrij/otrij izbornik
			return false; // Zanemari kuda link vodi
		}	
	);
	
	// Događanja prve ikone
	$(posaoLi).hover(
		function()
		{
			$(studentiDesc, privatnoDesc).stop().hide('slow');
			$(studentiLi).stop().animate({
				width: "110px",
				left: "00px"
				}, animationLength, animationEasing);
			$(privatnoLi).stop().animate({
				width: "110px",
				left: "0px"
				}, animationLength, animationEasing);
			$(posaoLi).stop().animate({
				width: "720px",
				left: "0px"
				}, animationLength, animationEasing);
			
		},
		function()
		{
			showAllDesc();
			$(studentiLi).stop().animate({
				width: "319px",
				left: "0px"
				}, animationLength, animationEasing),
				function() {$(this).css("position","static")};
			$(privatnoLi).stop().animate({
				width: "319px",
				left: "0px"
				}, animationLength, animationEasing);
			$(posaoLi).stop().animate({
				width: "319px",
				left: "0px"
				}, animationLength, animationEasing);
		}
	);
	
	
		// Događanja srednje ikone
	$(studentiLi).hover(
		function()
		{
			$(posaoDesc, privatnoDesc).stop().hide('slow');
			$(posaoLi).stop().animate({
				width: "110px",
				left: "0px"
				}, animationLength, animationEasing);
			$(privatnoLi).stop().animate({
				width: "110px",
				left: "0px"
				}, animationLength, animationEasing);
			$(studentiLi).stop().animate({
				width: "720px",
				left: "0px"
				}, animationLength, animationEasing);
			
		},
		function()
		{
			showAllDesc();
			$(studentiLi).stop().animate({
				width: "319px",
				left: "0px"
				}, animationLength, animationEasing),
				function() {$(this).css("position","static")};
			$(privatnoLi).stop().animate({
				width: "319px",
				left: "0px"
				}, animationLength, animationEasing);
			$(posaoLi).stop().animate({
				width: "319px",
				left: "0px"
				}, animationLength, animationEasing);
		}
	);
	
	// Događanja druge ikone
	$(privatnoLi).hover(
		function()
		{
			$(posaoDesc, studentiDesc).stop().hide('slow');
			$(posaoLi).stop().animate({
				width: "110px", 
				left: "0px",
				}, animationLength, animationEasing);
			$(studentiLi).stop().animate({
				width: "110px",
				left: "0px"
				}, animationLength, animationEasing);
			$(privatnoLi).stop().animate({
				width: "720px",
				left: "0px"
				}, animationLength, animationEasing);
		},
		function()
		{
			showAllDesc();
			$(posaoLi).stop().animate({
				width: "319px",
				left: "0px"
				}, animationLength, animationEasing),
				function() {$(this).css("position","static")};
			$(studentiLi).stop().animate({
				width: "319px",
				left: "0px"
				}, animationLength, animationEasing);
			$(privatnoLi).stop().animate({
				left: "0px",
				width: "319px"
				}, animationLength, animationEasing);
			
		}
	);
	
	
});

// Show all descriptions
function showAllDesc()
{
	$(studentiDesc, posaoDesc, privatnoDesc).stop().show('slow');
};

var animationLength = 750;
var animationEasing = "swing";
var posaoLi = "li.page2";
var studentiLi = "li.page3";
var privatnoLi = "li.page4";
var posaoA = "li.page2 a"
var studentiA = "li.page3 a "
var privatnoA = "li.page4) a"
var posaoDesc = "li.page2 a span.desc";
var studentiDesc = "li.page3 a span.desc";
var privatnoDesc = "li.page4 a span.desc";
var posaoH3 = "li.page2 a span.h3";
var studentiH3 = "li.page3 a span.h3";
var privatnoH3 = "li.page4 a span.h3";
