(function($) { $.fn.corner = function(o) { var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent); function sz(el, p) { return parseInt($.css(el,p))||0;}; function hex2(s) { var s = parseInt(s).toString(16); return ( s.length < 2 ) ? '0'+s : s;}; function gpc(node) { for ( ; node && node.nodeName.toLowerCase() != 'html'; node = node.parentNode ) { var v = $.css(node,'backgroundColor'); if ( v.indexOf('rgb') >= 0 ) { if ($.browser.safari && v == 'rgba(0, 0, 0, 0)')
continue; var rgb = v.match(/\d+/g); return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);}
if ( v && v != 'transparent' )
return v;}
return '#ffffff';}; function getW(i) { switch(fx) { case 'round': return Math.round(width*(1-Math.cos(Math.asin(i/width)))); case 'cool': return Math.round(width*(1+Math.cos(Math.asin(i/width)))); case 'sharp': return Math.round(width*(1-Math.cos(Math.acos(i/width)))); case 'bite': return Math.round(width*(Math.cos(Math.asin((width-i-1)/width)))); case 'slide': return Math.round(width*(Math.atan2(i,width/i))); case 'jut': return Math.round(width*(Math.atan2(width,(width-i-1)))); case 'curl': return Math.round(width*(Math.atan(i))); case 'tear': return Math.round(width*(Math.cos(i))); case 'wicked': return Math.round(width*(Math.tan(i))); case 'long': return Math.round(width*(Math.sqrt(i))); case 'sculpt': return Math.round(width*(Math.log((width-i-1),width))); case 'dog': return (i&1) ? (i+1) : width; case 'dog2': return (i&2) ? (i+1) : width; case 'dog3': return (i&3) ? (i+1) : width; case 'fray': return (i%2)*width; case 'notch': return width; case 'bevel': return i+1;}
}; o = (o||"").toLowerCase(); var keep = /keep/.test(o); var cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]); var sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]); var width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10; var re = /round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/; var fx = ((o.match(re)||['round'])[0]); var edges = { T:0, B:1 }; var opts = { TL: /top|tl/.test(o), TR: /top|tr/.test(o), BL: /bottom|bl/.test(o), BR: /bottom|br/.test(o)
}; if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )
opts = { TL:1, TR:1, BL:1, BR:1 }; var strip = document.createElement('div'); strip.style.overflow = 'hidden'; strip.style.height = '1px'; strip.style.backgroundColor = sc || 'transparent'; strip.style.borderStyle = 'solid'; return this.each(function(index){ var pad = { T: parseInt($.css(this,'paddingTop'))||0, R: parseInt($.css(this,'paddingRight'))||0, B: parseInt($.css(this,'paddingBottom'))||0, L: parseInt($.css(this,'paddingLeft'))||0
}; if ($.browser.msie) this.style.zoom = 1; if (!keep) this.style.border = 'none'; strip.style.borderColor = cc || gpc(this.parentNode); var cssHeight = $.curCSS(this, 'height'); for (var j in edges) { var bot = edges[j]; if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) { strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none'); var d = document.createElement('div'); $(d).addClass('jquery-corner'); var ds = d.style; bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild); if (bot && cssHeight != 'auto') { if ($.css(this,'position') == 'static')
this.style.position = 'relative'; ds.position = 'absolute'; ds.bottom = ds.left = ds.padding = ds.margin = '0'; if ($.browser.msie)
ds.setExpression('width', 'this.parentNode.offsetWidth'); else
ds.width = '100%';}
else if (!bot && $.browser.msie) { if ($.css(this,'position') == 'static')
this.style.position = 'relative'; ds.position = 'absolute'; ds.top = ds.left = ds.right = ds.padding = ds.margin = '0'; var bw = 0; if (ie6 || !$.boxModel)
bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth'); ie6 ? ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"') : ds.width = '100%';}
else { ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' :
(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';}
for (var i=0; i < width; i++) { var w = Math.max(0,getW(i)); var e = strip.cloneNode(false); e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px'; bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);}
}
}
});}; $.fn.uncorner = function(o) { return $('.jquery-corner', this).remove();};})(jQuery); 
(function($) { $.fn.jHelperTip = function(options) { var opts = $.extend({}, $.fn.jHelperTip.defaults, options); if ($(opts.ttC).length == 0)
$('<div id="'+opts.ttC.slice(1)+'"></div>').appendTo("body"); if ($(opts.dC).length == 0)
$('<div id="'+opts.dC.slice(1)+'"></div>').appendTo("body"); if ($(opts.aC).length == 0)
$('<div id="'+opts.aC.slice(1)+'"></div>').appendTo("body"); $(opts.ttC).add(opts.aC).css({ position: "absolute", display: "inline"
}).hide(); $(opts.dC).hide(); var closeBox = function(){ if (opts.source == "attribute")
$(opts.aC).hide().empty(); else
$(opts.ttC).hide().empty();}; $(".jHelperTipClose").bind("click", closeBox); $(opts.ttC).bind("mouseover",function(){ $(opts.ttC).show(); return false;}); var getData = function(obj,e){ if (opts.source == "ajax") { getPosition(e); $(opts.ttC).html('<div><img src="'+opts.loadingImg+'"/> '+opts.loadingText+'</div>').show(); $.ajax({ type: opts.type, url: opts.url, data: opts.data, success: function(msg){ $(opts.ttC).html(msg); $(".jHelperTipClose").unbind("click", closeBox); $(".jHelperTipClose").bind("click", closeBox);}
});}
else if (opts.source == "container"){ $(opts.ttC).show().empty(); $(opts.dC).clone(true).show().appendTo(opts.ttC);}
if (opts.source == "attribute"){ $(opts.aC).html($(obj).attr(opts.attrName));}
}; var getPosition = function (e){ var top = e.pageY+opts.topOff; var left = e.pageX-opts.leftOff; if (opts.source == "attribute"){ $(opts.aC).css({ top: top, left: left, opacity: opts.opacity
}).show();}
else { $(opts.ttC).css({ top: top, left: left, opacity: opts.opacity
}).show();}
}; if (opts.trigger == "hover") { $(this).bind("mouseover", function(e){ e.preventDefault(); getData(this, e); return false;}); $(this).bind("mousemove", function(e){ getPosition(e); return false;}); $(this).bind("mouseout", function(e){ if (opts.source == "attribute")
$(opts.aC).hide().empty(); else
$(opts.ttC).hide().empty(); return false;});}
else if (opts.trigger == "click") { $(this).bind("click", function(e){ getData(this, e); getPosition(e); $(document).bind("click", function(e){ if (opts.autoClose) { if (opts.source == "attribute")
$(opts.aC).hide().empty(); else
$(opts.ttC).hide().empty();}
}); return false;});}
}; $.fn.jHelperTip.defaults = { trigger: "click", topOff: 6, leftOff: 204, source: "container", attrName: '', ttC: "#jHelperTipContainer", dC: "#jHelperTipDataContainer", aC: "#jHelperTipAttrContainer", opacity: 0.9, loadingImg: "img/template/loading.gif", loadingText: "Loading...", type: "GET", autoClose: true
};})(jQuery); jQuery.timer = function (interval, callback)
{ var interval = interval || 100; if (!callback)
return false; _timer = function (interval, callback) { this.stop = function () { clearInterval(self.id);}; this.internalCallback = function () { callback(self);}; this.reset = function (val) { if (self.id)
clearInterval(self.id); var val = val || 100; this.id = setInterval(this.internalCallback, val);}; this.interval = interval; this.id = setInterval(this.internalCallback, this.interval); var self = this;}; return new _timer(interval, callback);}; jQuery.preloadImages = function() { var a = (typeof arguments[0] == 'object')? arguments[0] : arguments; for(var i = a.length -1; i > 0; i--) { jQuery("<img>").attr("src", a[i]);}
}
function MM_swapImgRestore() { var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}
function MM_preloadImages() { var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x;}
function MM_swapImage() { var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_setTextOfTextfield(objName,x,newText) { var obj = MM_findObj(objName); if (obj) obj.value = newText;}
function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features);}
function MM_popupMsg(msg) { alert(msg);}
function printWindow(){ bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}
function eshowDropDown(parentEle, dropDownEle, dropDownWidth, dropDownHeight, offSetRight, offSetTop){ parentElement = document.getElementById(parentEle); dropDownElement = document.getElementById(dropDownEle)
dropDownElement.style.left = (egetOffsetLeft(parentElement) + offSetRight) + 'px'; dropDownElement.style.top = (egetOffsetTop(parentElement) + offSetTop) + 'px'; dropDownElement.style.width = dropDownWidth + 'px'; dropDownElement.style.height = dropDownHeight + 'px'; ehideDropDown(); dropDownElement.style.visibility = 'visible'; dropDownElement.style.zIndex= '100'; if(document.addEventListener){ document.addEventListener('mouseup', ehideDropDown, false);} else { document.onmouseup = ehideDropDown;}
}
function ehideDropDown(){ hide('div'); hide('iframe'); function hide(tag){ var classElements = new Array(); var els = document.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp('(^|\\s)dropDown(.*\)'); for (i = 0, j = 0; i < elsLen; i++){ if (pattern.test(els[i].className)){ els[i].style.visibility='hidden'; j++;}
}
}
}
function egetOffsetTop(elm){ var mOffsetTop = elm.offsetTop; var mOffsetParent = elm.offsetParent; while(mOffsetParent){ mOffsetTop += mOffsetParent.offsetTop; mOffsetParent = mOffsetParent.offsetParent;}
return mOffsetTop;}
function egetOffsetLeft(elm){ var mOffsetLeft = elm.offsetLeft; var mOffsetParent = elm.offsetParent; while(mOffsetParent){ mOffsetLeft += mOffsetParent.offsetLeft; mOffsetParent = mOffsetParent.offsetParent;}
return mOffsetLeft;}
$.fn.rater = function(options) { var opts = $.extend({}, $.fn.rater.defaults, options); return this.each(function() { var $this = $(this); var $on = $this.find('.ui-raterc-starsOn'); var $off = $this.find('.ui-raterc-starsOff'); opts.size = $on.height(); if (opts.rating == undefined) opts.rating = $on.width() / opts.size; if (opts.id == undefined) opts.id = $this.attr('id'); $off.mousemove(function(e) { var left = e.clientX - $off.offset().left; var width = $off.width() - ($off.width() - left); width = Math.ceil(width / (opts.size / opts.step)) * opts.size / opts.step; $on.width(width);}).hover(function(e) { $on.addClass('ui-raterc-starsHover');}, function(e) { $on.removeClass('ui-raterc-starsHover'); $on.width(opts.rating * opts.size);}).click(function(e) { var r = Math.round($on.width() / $off.width() * (opts.units * opts.step)) / opts.step; $off.unbind('click').unbind('mousemove').unbind('mouseenter').unbind('mouseleave'); $off.css('cursor', 'default'); $on.css('cursor', 'default'); $.fn.rater.rate($this, opts, r);}).css('cursor', 'pointer'); $on.css('cursor', 'pointer');});}; $.fn.rater.defaults = { postHref: location.href, units: 5, step: 1
}; $.fn.rater.rate = function($this, opts, rating) { var $on = $this.find('.ui-raterc-starsOn'); var $off = $this.find('.ui-raterc-starsOff'); $off.fadeTo(600, 0.4, function() { $.ajax({ url: opts.postHref, type: "POST", data: 'id=' + opts.id + '&rating=' + rating, complete: function(req) { if (req.status == 200) { opts.rating = parseFloat(req.responseText); $off.fadeTo(600, 0.1, function() { $on.removeClass('ui-raterc-starsHover').width(opts.rating * opts.size); var $count = $this.find('.ui-raterc-rateCount'); $count.text(parseInt($count.text()) + 1); $('input[name=comment_rating]:checked').removeAttr('checked'); $('input[name=comment_rating]:eq('+(rating-1)+')').attr('checked','checked'); $this.find('.ui-raterc-rating').text(opts.rating.toFixed(1)); $off.fadeTo(600, 1); $this.attr('title', 'prosjecna ocjena: ' + opts.rating.toFixed(1) + ', vasa ocjena: ' + rating.toFixed(1));});} else { alert(req.responseText); $on.removeClass('ui-raterc-starsHover').width(opts.rating * opts.size); $this.rater(opts); $off.fadeTo(2200, 1);}
}
});});}; jQuery.cookie = function(name, value, options) { if (typeof value != 'undefined') { options = options || {}; if (value === null) { value = ''; options.expires = -1;}
var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));} else { date = options.expires;}
expires = '; expires=' + date.toUTCString();}
var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');} else { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break;}
}
}
return cookieValue;}
}; (function(D){var A="Lite-1.0";D.fn.cycle=function(E){return this.each(function(){E=E||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var I=D(this);var J=E.slideExpr?D(E.slideExpr,this):I.children();var G=J.get();if(G.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+G.length)}return }var H=D.extend({},D.fn.cycle.defaults,E||{},D.metadata?I.metadata():D.meta?I.data():{});H.before=H.before?[H.before]:[];H.after=H.after?[H.after]:[];H.after.unshift(function(){H.busy=0});var F=this.className;H.width=parseInt((F.match(/w:(\d+)/)||[])[1])||H.width;H.height=parseInt((F.match(/h:(\d+)/)||[])[1])||H.height;H.timeout=parseInt((F.match(/t:(\d+)/)||[])[1])||H.timeout;if(I.css("position")=="static"){I.css("position","relative")}if(H.width){I.width(H.width)}if(H.height&&H.height!="auto"){I.height(H.height)}var K=0;J.css({position:"absolute",top:0,left:0}).hide().each(function(M){D(this).css("z-index",G.length-M)});D(G[K]).css("opacity",1).show();if(D.browser.msie){G[K].style.removeAttribute("filter")}if(H.fit&&H.width){J.width(H.width)}if(H.fit&&H.height&&H.height!="auto"){J.height(H.height)}if(H.pause){I.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}D.fn.cycle.transitions.fade(I,J,H);J.each(function(){var M=D(this);this.cycleH=(H.fit&&H.height)?H.height:M.height();this.cycleW=(H.fit&&H.width)?H.width:M.width()});J.not(":eq("+K+")").css({opacity:0});if(H.cssFirst){D(J[K]).css(H.cssFirst)}if(H.timeout){if(H.speed.constructor==String){H.speed={slow:600,fast:200}[H.speed]||400}if(!H.sync){H.speed=H.speed/2}while((H.timeout-H.speed)<250){H.timeout+=H.speed}}H.speedIn=H.speed;H.speedOut=H.speed;H.slideCount=G.length;H.currSlide=K;H.nextSlide=1;var L=J[K];if(H.before.length){H.before[0].apply(L,[L,L,H,true])}if(H.after.length>1){H.after[1].apply(L,[L,L,H,true])}if(H.click&&!H.next){H.next=H.click}if(H.next){D(H.next).bind("click",function(){return C(G,H,H.rev?-1:1)})}if(H.prev){D(H.prev).bind("click",function(){return C(G,H,H.rev?1:-1)})}if(H.timeout){this.cycleTimeout=setTimeout(function(){B(G,H,0,!H.rev)},H.timeout+(H.delay||0))}})};function B(J,E,I,K){if(E.busy){return }var H=J[0].parentNode,M=J[E.currSlide],L=J[E.nextSlide];if(H.cycleTimeout===0&&!I){return }if(I||!H.cyclePause){if(E.before.length){D.each(E.before,function(N,O){O.apply(L,[M,L,E,K])})}var F=function(){if(D.browser.msie){this.style.removeAttribute("filter")}D.each(E.after,function(N,O){O.apply(L,[M,L,E,K])})};if(E.nextSlide!=E.currSlide){E.busy=1;D.fn.cycle.custom(M,L,E,F)}var G=(E.nextSlide+1)==J.length;E.nextSlide=G?0:E.nextSlide+1;E.currSlide=G?J.length-1:E.nextSlide-1}if(E.timeout){H.cycleTimeout=setTimeout(function(){B(J,E,0,!E.rev)},E.timeout)}}function C(E,F,I){var H=E[0].parentNode,G=H.cycleTimeout;if(G){clearTimeout(G);H.cycleTimeout=0}F.nextSlide=F.currSlide+I;if(F.nextSlide<0){F.nextSlide=E.length-1}else{if(F.nextSlide>=E.length){F.nextSlide=0}}B(E,F,1,I>=0);return false}D.fn.cycle.custom=function(K,H,I,E){var J=D(K),G=D(H);G.css({opacity:0});var F=function(){G.animate({opacity:1},I.speedIn,I.easeIn,E)};J.animate({opacity:0},I.speedOut,I.easeOut,function(){J.css({display:"none"});if(!I.sync){F()}});if(I.sync){F()}};D.fn.cycle.transitions={fade:function(F,G,E){G.not(":eq(0)").css("opacity",0);E.before.push(function(){D(this).show()})}};D.fn.cycle.ver=function(){return A};D.fn.cycle.defaults={timeout:6000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:1,delay:0,slideExpr:null}})(jQuery)
jQuery.fn.anchorAnimate = function(settings) { settings = jQuery.extend({ speed : 1100
}, settings); return this.each(function(){ var caller = this
$(caller).click(function (event) { event.preventDefault()
var locationHref = window.location.href
var elementClick = $(caller).attr("href")
var destination = $(elementClick).offset().top; $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() { window.location.hash = elementClick
}); return false;})
})
}
jQuery.fn.preLoadImages = function() { var args_len = arguments.length; for (var i = args_len; i--;) { var cacheImage = document.createElement('img'); cacheImage.src = arguments[i]; cache.push(cacheImage);}
}
jQuery.fn.countdown = function(options) { if(!options) options = '()'; if(jQuery(this).length == 0) return false; var obj = this; if(options.seconds < 0 || options.seconds == 'undefined')
{ if(options.callback) eval(options.callback); return null;}
window.setTimeout( function() { jQuery(obj).html(String(options.seconds)); --options.seconds; jQuery(obj).countdown(options);} , 1000 ); return this;}

