
jQuery(document).ready(function() {
aktiven=0;
	jQuery(".hidden").hide();
	jQuery("#dostop1").hide();
	jQuery("#dostop2").hide();
	jQuery("#dostop3").hide();


	jQuery("#tab1").click(function () {
	if (aktiven==0)
	{
		jQuery("#zacetek").hide();
		jQuery("#dostop2").hide();
		jQuery("#dostop3").hide();
		jQuery("#dostop1").animate({height:"show"},"fast");
		aktiven=1;
		} else {
			jQuery("#dostop"+aktiven).animate({height:"hide"},"fast",function () { jQuery("#dostop1").animate({height:"show"},"fast"); });
			aktiven=1;
		}
	});
	jQuery("#tab2").click(function () {
	if (aktiven==0)
	{
		jQuery("#zacetek").hide();
		jQuery("#dostop1").hide();
		jQuery("#dostop3").hide();
			jQuery("#dostop2").animate({height:"show"},"fast");
		aktiven=2;
		} else {
			jQuery("#dostop"+aktiven).animate({height:"hide"},"fast",function () { jQuery("#dostop2").animate({height:"show"},"fast"); });
			aktiven=2;
		}
	});
	jQuery("#tab3").click(function () {
	if (aktiven==0)
	{
		jQuery("#zacetek").hide();
		jQuery("#dostop1").hide();
		jQuery("#dostop2").hide();
		jQuery("#dostop3").animate({height:"show"},"fast");
		aktiven=3;
		} else {
			jQuery("#dostop"+aktiven).animate({height:"hide"},"fast",function () { jQuery("#dostop3").animate({height:"show"},"fast"); });
			aktiven=3;
		}
	});
	jQuery("#slika1").click(function () {
		jQuery("#zacetek").hide();

		jQuery("#dostop2").hide();
		jQuery("#dostop3").hide();
		jQuery("#dostop1").animate({height:"show"},"fast");
		aktiven=1;
	});
	jQuery("#slika2").click(function () {
		jQuery("#zacetek").hide();
		jQuery("#dostop1").hide();
		jQuery("#dostop3").hide();
		jQuery("#dostop2").animate({height:"show"},"fast");
		aktiven=2;
	});
	jQuery("#slika3").click(function () {
		jQuery("#zacetek").hide();
		jQuery("#dostop1").hide();
		jQuery("#dostop2").hide();
		jQuery("#dostop3").animate({height:"show"},"fast");
		aktiven=3;
	});
		jQuery("#squery").focus(function() {
		jQuery("#squery").val('');
		jQuery("#filtri").animate({
				height:"show"
			});
	});
	jQuery("#slika1").hover(function() { jQuery("#tab1").addClass("hovered"); }, function() { jQuery("#tab1").removeClass("hovered"); });
	jQuery("#slika2").hover(function() { jQuery("#tab2").addClass("hovered"); }, function() { jQuery("#tab2").removeClass("hovered"); });
	jQuery("#slika3").hover(function() { jQuery("#tab3").addClass("hovered"); }, function() { jQuery("#tab3").removeClass("hovered"); });

	jQuery("#side-navi-wrapper").fadeTo('fast', 0.5, function() {

    });

	jQuery("#side-navi-wrapper").mouseenter(function() {

		jQuery(this).fadeTo('slow', 1, function() { });

	});

	jQuery("#side-navi-wrapper").mouseleave(function() {

		jQuery(this).fadeTo('slow', 0.5, function() { });

	});


});


function updateObrazec(a)
{
	jQuery("#flong_izobrazba").next().html(""); 	//pobrisi error msg

	if (a==0)
	{
		jQuery(".izobrazba_select").hide("slow");
		jQuery(".dodatna_znanja").hide("slow");
		jQuery(".izkusnje_select").hide("slow");
	}
	if (a==1)
	{
		jQuery(".izobrazba_select").hide("slow");
		jQuery(".dodatna_znanja").hide("slow");
		jQuery(".izkusnje_select").show("slow");
	}
	if (a==2)
	{
		jQuery(".izobrazba_select").show("slow");
		jQuery(".dodatna_znanja").hide("slow");
		jQuery(".izkusnje_select").show("slow");

	}
	if (a>2)
	{
		jQuery(".izobrazba_select").show("slow");
		jQuery(".dodatna_znanja").show("slow");
		jQuery(".izkusnje_select").show("slow");
	}

	if (a==1)
	{
		document.getElementById('stopnjatest').value="Osnovna šola ali manj (I. in II.)";
	}
	if (a==2)
	{
		document.getElementById('stopnjatest').value="Krajše izobraževanje - USO (III.)";
	}
	if (a==3)
	{
		document.getElementById('stopnjatest').value="Poklicna šola (IV.)";
	}
	if (a==4)
	{
        document.getElementById('stopnjatest').value="Srednja šola (V.)";
	}
	if (a==5)
	{
		document.getElementById('stopnjatest').value="Višja šola (I. stopnja) (VI.)";
	}
	if (a==6)
	{
		document.getElementById('stopnjatest').value="Fakulteta, visoka šola, umet. akademija (VII.)";
	}
	if (a==7)
	{
		document.getElementById('stopnjatest').value="Specializacija ali magisterij (VII./2)";
	}
	if (a==8)
	{
		document.getElementById('stopnjatest').value="Doktorat znanosti (VIII.)";
	}
	if (a==9)
	{
		document.getElementById('stopnjatest').value="B.Š. - izobrazba, pridobljena z bolonjskim študijem";
	}

}

  jQuery(document).ready(function(){

	jQuery("#formulartest1").submit(function(e) {
		var ok = true;
		if(!jQuery("#flong_spol_m").is(":checked") && !jQuery("#flong_spol_z").is(":checked"))
		{
			jQuery("#flong_spol_z").next().html("To polje je obvezno.");
			ok = false;
		}
		if(jQuery("#flong_izobrazba").val() == 0)
		{
			jQuery("#flong_izobrazba").next().html("To polje je obvezno.");
			ok = false;
		}
		var one_checked = false;
		jQuery(".flong_zapzelje").each(function() {
			if(jQuery(this).is(":checked"))
				one_checked = true;
		});
		if(!one_checked)
		{
			ok = false;
			jQuery("#flong_zapzelje_msg").html("Izbrati morate vsaj eno zaposlitveno željo.");
		}

		if(!ok)
			e.preventDefault();
	});

	jQuery("#flong_spol_m").click(function() {
		jQuery("#flong_spol_z").next().html("");
	});
	jQuery("#flong_spol_z").click(function() {
		jQuery("#flong_spol_z").next().html("");
	});
	jQuery(".flong_zapzelje").click(function() {
		jQuery("#flong_zapzelje_msg").html("");
	});

  });


