function setStylesheet(){selectCSS=document.createElement("link");selectCSS.setAttribute("type","text/css");selectCSS.setAttribute("rel","stylesheet");selectCSS.setAttribute("media","screen");selectCSS.setAttribute("href","static/css/js.css");document.getElementsByTagName("head")[0].appendChild(selectCSS)}$(document).ready(function(){if($(".prefilled").length>0){$(".prefilled").example(function(){return $(this).attr("title")})}if($("ul.search-list").length>0){$("ul.search-list li:last").css("margin-right","0px")}if($(".search-location-holder").length>0){$(".search-location-holder ul li:last").css("margin-right","0");$(".location-trigger").toggle(function(){$(".search-location-holder").slideDown("medium")},function(){$(".search-location-holder").slideUp("medium")})}if($("#breadcrumbs").length>0){$("#breadcrumbs ul li:last a").each(function(i){$(this).replaceWith("<span>"+$(this).text()+"</span>")});$("#breadcrumbs ul li:first").css("background","none");$("#breadcrumbs ul li:first").css("padding-left","0px")}if($(".paginator-list").length>0){$(".paginator-list ul li:first").addClass("prev");$(".paginator-list ul li:last").addClass("next")}if($(".search-paginator-list").length>0){$(".search-paginator-list-top ul li:first").addClass("prev");$(".search-paginator-list-top ul li:last").addClass("next")}if($(".search-paginator-list").length>0){$(".search-paginator-list-bottom ul li:last").removeClass("next");$(".search-paginator-list-bottom ul li:first").addClass("first");$(".search-paginator-list-bottom ul li:last").addClass("last")}if($(".image-list").length>0){$(".image-list").bxGallery({thumbwidth:41.8,maxwidth:301,thumbcrop:false,croppercent:0.5,thumbplacement:"bottom",wrapperclass:"image-gallery-holder"})}if($(".tabs").length>0){$(".tabs").tabs()}if($(".category").length>0){$("ul li.category:last").css("padding-bottom","0px")}if($(".fancybox").length>0){$("a[rel=image-gallery]").fancybox({type:"image",titlePosition:"over",titleFormat:function(title,currentArray,currentIndex,currentOpts){return'<span id="fancybox-title-over">Slika '+(currentIndex+1)+" od "+currentArray.length+(title.length?" &nbsp; "+title:"")+"</span>"}})}if($("#image-tab").length>0){$("a[rel=firm-gallery]").fancybox({type:"image",titlePosition:"over",titleFormat:function(title,currentArray,currentIndex,currentOpts){return'<span id="fancybox-title-over">Slika '+(currentIndex+1)+" od "+currentArray.length+(title.length?" &nbsp; "+title:"")+"</span>"}})}if($(".images-trigger").length>0){$(".images-trigger").click(function(){$(".tabs").tabs({selected:4});return false})}if($("#step-holder").length>0){$("#step-1").show();$(".step-1").addClass("active");$("#step-2-trigger").click(function(){$("#step-1").hide();$("#step-2").show();$("#step-3").hide();$(".step-1").removeClass("active");$(".step-2").addClass("active");$(".step-3").removeClass("active");return false});$("#step-3-trigger").click(function(){$("#step-1").hide();$("#step-2").hide();$("#step-3").show();$(".step-1").removeClass("active");$(".step-2").removeClass("active");$(".step-3").addClass("active");return false});$("#step-1-back-trigger").click(function(){$("#step-1").show();$("#step-2").hide();$("#step-3").hide();$(".step-1").addClass("active");$(".step-2").removeClass("active");$(".step-3").removeClass("active");return false});$("#step-2-back-trigger").click(function(){$("#step-1").hide();$("#step-2").show();$("#step-3").hide();$(".step-1").removeClass("active");$(".step-2").addClass("active");$(".step-3").removeClass("active");return false})}if($("#saved-2").length>0){$("#saved-2").click(function(){$(this).parent().parent().next().slideDown("fast");return false})}if($(".wrapped").length>0){$(".wrapped").each(function(index){if($(this).children("li").length>5){$(this).after('<p class="more-wrapped"><a class="wrapped-trigger" href="#">vidi sve</a></p>');$(this).children("li:gt(4)").hide()}});$(".wrapped-trigger").toggle(function(){$(this).parent().prev().find("li").slideDown("slow");$(this).text("vidi manje")},function(){$(this).parent().prev().children("li:gt(4)").slideUp("slow");$(this).text("vidi sve")})}$(".edit-trigger").parent().parent().next().children(".edit").hide("fast");if($(".edit-trigger").length>0){$(".edit-trigger").click(function(){$(this).parent().parent().next().children(".current").hide("fast");$(this).parent().parent().next().children(".edit").fadeIn("fast");$(this).parent().parent().next().children(".segment-button-holder").fadeIn("fast");return false});$(".save-trigger").click(function(){$("#formUser").submit();return false});$(".reset-trigger").click(function(){$(this).parent().parent().hide("fast");$(this).parent().parent().prev().hide("fast");$(this).parent().parent().prev().prev().fadeIn("fast");return false})}});function createSeo(brzaPretraga,idKat,nazivKat){var katId=0;var lokId=0;var kat="";var lok="";if(brzaPretraga){if(idKat!=null){katId=idKat}else{if($("#kategorija").val()){katId=$("#kategorija").val()}}if(nazivKat!=null){kat=nazivKat}else{kat=$("#kategorija option:selected").text()}}else{if($("#kategorijaSearch").val()){katId=$("#kategorijaSearch").val()}if(nazivKat!=null){kat=nazivKat}else{kat=$("#kategorijaNaziv").val()}if(!($("#lokacijaDeo").val()=="0")){lokId=$("#lokacijaDeo").val();lok=$("#lokacijaDeo option:selected").text()}else{if(!($("#lokacijaPod").val()=="0")){lokId=$("#lokacijaPod").val();lok=$("#lokacijaPod option:selected").text()}else{if(!($("#lokacija").val()=="0")){lokId=$("#lokacija").val();lok=$("#lokacija option:selected").text()}}}}var param="";var par=$("#parametar");if(par[0].title!=par[0].value){param=$("#parametar").val()}var seo="/"+katId+"/"+lokId+"/";if(katId!=0){seo+=kat}if(lokId!=0){if(katId!=0){seo+="+"}seo+=lok}if(param.length!=0){seo+="+"+param}seo=decodeURI(seo);seo=seo.replace(/(,\s)|,|\s/g,"+");return seo}function createSeoFirma(brzaPretraga,idKat,nazivKat){var katId=0;var lokId=0;var kat="";var lok="";if(brzaPretraga){if(idKat!=null){katId=idKat}else{if($("#kategorija").val()){katId=$("#kategorija").val()}}if(nazivKat!=null){kat=nazivKat}else{kat=$("#kategorija option:selected").text()}}else{if($("#kategorijaSearch").val()){katId=$("#kategorijaSearch").val()}if(nazivKat!=null){kat=nazivKat}else{kat=$("#kategorijaNaziv").val()}}if(!($("#lokacijaDeo").val()=="0")){lokId=$("#lokacijaDeo").val();lok=$("#lokacijaDeo option:selected").text()}else{if(!($("#lokacijeGrd").val()=="0")){lokId=$("#lokacijeGrd").val();lok=$("#lokacijeGrd option:selected").text()}else{if(!($("#lokacijeReg").val()=="0")){lokId=$("#lokacijeReg").val();lok=$("#lokacijeReg option:selected").text()}}}var param="";var par=$("#parametar");if(par[0].title!=par[0].value){param=$("#parametar").val()}var seo="/"+katId+"/"+lokId+"/";if(katId!=0){seo+=kat}if(lokId!=0){if(katId!=0){seo+="+"}seo+=lok}if(param.length!=0){seo+="+"+param}seo=decodeURI(seo);seo=seo.replace(/(,\s)|,|\s/g,"+");return seo};
