var requiredMajorVersion = 9;
var requiredMinorVersion = 0;
var requiredRevision = 0;





$(document).ready(function() {
				$('#example').dataTable( {
						"fnDrawCallback": function( ) {$("select").selectbox();},
						"sPaginationType": "full_numbers",
						"oLanguage": {
							"sLengthMenu": "Broj rezultata po stranici _MENU_ ",
							"sZeroRecords": "Nema rezultata",
							"sInfo": "Prikazano <strong>_START_</strong> do <strong>_END_</strong> od ukupno <strong>_TOTAL_</strong> rezultata",
							"sInfoEmtpy": "Showing 0 to 0 of 0 records",
							"sInfoFiltered": "(filtered from _MAX_ total records)",
							"sSearch": "<span class='traziTables'>Tra&#382;i</span>",
							"oPaginate": {       
								"sFirst":    "Prva",       
								"sPrevious": "Prethodna",      
								"sNext":     "Naredna",    
								"sLast":     "Posljednja"				
							}
						}
				});
});


var items_per_page = 5;
			function pageselectCallback(page_index, jq){
				$("#hiddenresult div.nabavkaWrapper").hide();
	             var start = page_index * items_per_page;
	            $("#hiddenresult div.nabavkaWrapper:gt("+(start-1)+"):lt("+items_per_page+")").show();
             return false;
            }

            function initPagination() {
				var num_entries = $('#hiddenresult div.nabavkaWrapper').length;
				// Create pagination element
                $("#Pagination").pagination(num_entries, {
                    num_edge_entries: 2,
                    num_display_entries: 8,
					callback: pageselectCallback,
					items_per_page:5
                });
				if (num_entries < 6) {
					$("#Pagination").hide();
				}
             }
      
            $(document).ready(function(){      
                initPagination();
            });

/*ddaccordion.init({
	headerclass: "menuheaders", //Shared CSS class name of headers group that are expandable
	contentclass: "menucontents", //Shared CSS class name of contents group
	revealtype: "clickgo", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["suffix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isclicked){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})*/

$(document).ready(function(){
		adjustHeight('#sadrzaj',57);
		$('.prikazi').ajaxContent({
		   type:'Post',
		   loaderType:'img',
		   loadingMsg:'/images/loadingAjax.gif',
		   target:'#ajaxContent', 
		   bind:'#broj'
		});
		
		$('.prikaziMjesto').ajaxContent({
		   type:'Post',
		   loaderType:'img',
		   loadingMsg:'/images/loadingAjax.gif',
		   target:'#ajaxContent', 
		   bind:'#mjesto'
		});
		
		$('.rezultat').ajaxContent({ 
		   loaderType:'img',
		   loadingMsg:'/images/loadingAjax.gif',
		   target:'#ajaxContentAnketa',
		   bind:'#uncashe'
		});
		
		$('.prikaziAnketa').ajaxContent({ 
		   type:'Post',
		   loaderType:'img',
		   loadingMsg:'/images/loadingAjax.gif',
		   target:'#ajaxContentAnketa',  
		   bind:'#radio'
		});
		
		$('.kalkulatorPismo').ajaxContent({ 
		   type:'Post',
		   loaderType:'img',
		   loadingMsg:'/images/loadingAjax.gif',
		   target:'#ajaxKalkulator',  
		   bind:'#pismo_masa,#pismo_prep,#pismo_hitno,#pismo_povr,#tip'
		});
		
		
		$('.kalkulatorMpismo').ajaxContent({ 
		   type:'Post',
		   loaderType:'img',
		   loadingMsg:'/images/loadingAjax.gif',
		   target:'#ajaxKalkulator',  
		   bind:'#mpismo_masa,#mpismo_prep,#mpismo_hitno,#mpismo_povr,#tip'
		});
		
		
		
	});
	
	
	function disableEnterKey(e,obj)
		{
		     var key;     
		     if(window.event)
		          key = window.event.keyCode; //IE
		     else
		          key = e.which; //firefox 
		          
		     if (key==13 && obj.id=='broj') {
		     	$("#broj").change();
		     	$("a.prikazi").click(); 
		     }
		     

		     return (key != 13);
		     
		     key = 0;
		};
		
$(document).ready(function() {
$("select").selectbox();
$("#example1 > ul, .level1 > ul").tabs();
$("#searchInput,#mjesto").attr("autocomplete","off");
// za carousel
$(".main .jCarouselLite").jCarouselLite({
        btnNext: ".main .next",
        btnPrev: ".main .prev"
    });
$(".vertical .jCarouselLite").jCarouselLite({
		vertical:true,
		visible: 1,
		btnGo:[".1", ".2", ".3", ".4", ".5", ".6", ".7", ".8"]
    });
$(".carousel img").click(function() {
    $(".aktivna").attr("src", $(".aktivna").attr("src").split("over.jpg").join(".jpg"));
	$(".aktivna").removeClass("aktivna");
	$(this).attr("src", $(this).attr("src").split(".jpg").join("over.jpg"));
	$(this).addClass("aktivna");
});
});
//za organigram
$(document).ready(function(){$(".clickme").cluetip({local:true,activation:"click",sticky:true,closePosition:"top",closeText:'<img class="zatvori_okvir" src="/images/cluetip/spacer.gif" alt="" />',cluetipClass:"rounded",dropShadow:false,width:350,positionBy:'bottomTop'})});


