(function($){
$.fn.lightBox=function(settings){
settings=jQuery.extend({
overlayBgColor:
'#000'
,
overlayOpacity:0.8,
fixedNavigation:false,
imageLoading:
'http://www.ak-dinamo.hr/wp-content/themes/akdinamo/js/lightbox/images/lightbox-ico-loading.gif'
,
imageBtnPrev:
'http://www.ak-dinamo.hr/wp-content/themes/akdinamo/js/lightbox/images/lightbox-btn-prev.gif'
,
imageBtnNext:
'http://www.ak-dinamo.hr/wp-content/themes/akdinamo/js/lightbox/images/lightbox-btn-next.gif'
,
imageBtnClose:
'http://www.ak-dinamo.hr/wp-content/themes/akdinamo/js/lightbox/images/lightbox-btn-close.gif'
,
imageBlank:
'http://www.ak-dinamo.hr/wp-content/themes/akdinamo/js/lightbox/images/lightbox-blank.gif'
,
containerBorderSize:10,
containerResizeSpeed:400,
txtImage:
'Fotografija'
,
txtOf:
'od'
,
keyToClose:
'c'
,
keyToPrev:
'p'
,
keyToNext:
'n'
,
imageArray:[],activeImage:0},settings);
var jQueryMatchedObj=this;
function _initialize(){_start(this,jQueryMatchedObj);
return false;
}
function _start(objClicked,jQueryMatchedObj){
$(
'embed, object, select'
).css({
'visibility'
:
'hidden'
});
_set_interface();
settings.imageArray.length=0;
settings.activeImage=0;
if (jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute(
'href'
),objClicked.getAttribute(
'title'
)));} else {
for (var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute(
'href'
),jQueryMatchedObj[i].getAttribute(
'title'
)));}}
while (settings.imageArray[settings.activeImage][0] !=objClicked.getAttribute(
'href'
)){settings.activeImage++;}
_set_image_to_view();}
function _set_interface(){
$(
'body'
).append(
'<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'
+settings.imageLoading+
'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'
+settings.imageBtnClose+
'"></a></div></div></div></div>'
);
var arrPageSizes=___getPageSize();
$(
'#jquery-overlay'
).css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();
var arrPageScroll=___getPageScroll();
$(
'#jquery-lightbox'
).css({top:arrPageScroll[1]+(arrPageSizes[3] / 10),left:arrPageScroll[0]}).show();
$(
'#jquery-overlay,#jquery-lightbox'
).click(function(){_finish();});
$(
'#lightbox-loading-link,#lightbox-secNav-btnClose'
).click(function(){_finish();return false;});
$(window).resize(function(){
var arrPageSizes=___getPageSize();
$(
'#jquery-overlay'
).css({width:arrPageSizes[0],height:arrPageSizes[1]});
var arrPageScroll=___getPageScroll();
$(
'#jquery-lightbox'
).css({top:arrPageScroll[1]+(arrPageSizes[3] / 10),left:arrPageScroll[0]});});}
function _set_image_to_view(){
$(
'#lightbox-loading'
).show();if (settings.fixedNavigation){$(
'#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber'
).hide();} else {
$(
'#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber'
).hide();}
var objImagePreloader=new Image();objImagePreloader.onload=function(){$(
'#lightbox-image'
).attr(
'src'
,settings.imageArray[settings.activeImage][0]);
_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};
function _resize_container_image_box(intImageWidth,intImageHeight){
var intCurrentWidth=$(
'#lightbox-container-image-box'
).width();var intCurrentHeight=$(
'#lightbox-container-image-box'
).height();
var intWidth=(intImageWidth+(settings.containerBorderSize * 2));
var intHeight=(intImageHeight+(settings.containerBorderSize * 2));
var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;
$(
'#lightbox-container-image-box'
).animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if ((intDiffW==0)&&(intDiffH==0)){if ($.browser.msie){___pause(250);} else {___pause(100);}}
 $(
'#lightbox-container-image-data-box'
).css({width:intImageWidth});$(
'#lightbox-nav-btnPrev,#lightbox-nav-btnNext'
).css({height:intImageHeight+(settings.containerBorderSize * 2)});};
function _show_image(){$(
'#lightbox-loading'
).hide();$(
'#lightbox-image'
).fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};
function _show_image_data(){$(
'#lightbox-container-image-data-box'
).slideDown(
'fast'
);$(
'#lightbox-image-details-caption'
).hide();if (settings.imageArray[settings.activeImage][1]){$(
'#lightbox-image-details-caption'
).html(settings.imageArray[settings.activeImage][1]).show();}
if (settings.imageArray.length>1){$(
'#lightbox-image-details-currentNumber'
).html(settings.txtImage+
' '
+(settings.activeImage+1)+
' '
+settings.txtOf+
' '
+settings.imageArray.length).show();}}
function _set_navigation(){$(
'#lightbox-nav'
).show();
$(
'#lightbox-nav-btnPrev,#lightbox-nav-btnNext'
).css({
'background'
:
'transparent url('
+settings.imageBlank+
') no-repeat'
});
if (settings.activeImage !=0){if (settings.fixedNavigation){$(
'#lightbox-nav-btnPrev'
).css({
'background'
:
'url('
+settings.imageBtnPrev+
') left 15% no-repeat'
})
.unbind()
.bind(
'click'
,function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});} else {
$(
'#lightbox-nav-btnPrev'
).unbind().hover(function(){$(this).css({
'background'
:
'url('
+settings.imageBtnPrev+
') left 15% no-repeat'
});},function(){$(this).css({
'background'
:
'transparent url('
+settings.imageBlank+
') no-repeat'
});}).show().bind(
'click'
,function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
if (settings.activeImage !=(settings.imageArray.length-1)){if (settings.fixedNavigation){$(
'#lightbox-nav-btnNext'
).css({
'background'
:
'url('
+settings.imageBtnNext+
') right 15% no-repeat'
})
.unbind()
.bind(
'click'
,function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});} else {
$(
'#lightbox-nav-btnNext'
).unbind().hover(function(){$(this).css({
'background'
:
'url('
+settings.imageBtnNext+
') right 15% no-repeat'
});},function(){$(this).css({
'background'
:
'transparent url('
+settings.imageBlank+
') no-repeat'
});}).show().bind(
'click'
,function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
_enable_keyboard_navigation();}
function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
function _disable_keyboard_navigation(){$(document).unbind();}
function _keyboard_action(objEvent){
if (objEvent==null){keycode=event.keyCode;escapeKey=27;
} else {keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();
if ((key==settings.keyToClose)||(key==
'x'
)||(keycode==escapeKey)){_finish();}
if ((key==settings.keyToPrev)||(keycode==37)){
if (settings.activeImage !=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
if ((key==settings.keyToNext)||(keycode==39)){
if (settings.activeImage !=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
function _preload_neighbor_images(){if ((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
if (settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
function _finish(){$(
'#jquery-lightbox'
).remove();$(
'#jquery-overlay'
).fadeOut(function(){$(
'#jquery-overlay'
).remove();});
$(
'embed, object, select'
).css({
'visibility'
:
'visible'
});}
function ___getPageSize(){var xScroll,yScroll;if (window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;} else if (document.body.scrollHeight>document.body.offsetHeight){
xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;} else {
xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if (self.innerHeight){
if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;} else {windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;} else if (document.documentElement&&document.documentElement.clientHeight){
windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;} else if (document.body){
windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;} else {pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;} else {pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};
function ___getPageScroll(){var xScroll,yScroll;if (self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;} else if (document.documentElement&&document.documentElement.scrollTop){
yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;} else if (document.body){
yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};
function ___pause(ms){var date=new Date();curDate=null;do {var curDate=new Date();}
while (curDate-date<ms);};
return this.unbind(
'click'
).click(_initialize);};})(jQuery);
;(function($){var ver=
'Lite-1.0'
;$.fn.cycle=function(options){return this.each(function(){options=options||{};if (this.cycleTimeout) clearTimeout(this.cycleTimeout);this.cycleTimeout=0;this.cyclePause=0;var $cont=$(this);var $slides=options.slideExpr?$(options.slideExpr,this):$cont.children();var els=$slides.get();if (els.length<2){if (window.console&&window.console.log)
window.console.log(
'terminating; too few slides: '
+els.length);return;
}
var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});
var cls=this.className;opts.width=parseInt((cls.match(
/w:(\d+)/)||[])[1])||opts.width;opts.height=parseInt((cls.match(
/h:(\d+)/)||[])[1])||opts.height;opts.timeout=parseInt((cls.match(
/t:(\d+)/)||[])[1])||opts.timeout;if ($cont.css(
'position'
)==
'static'
)
 $cont.css(
'position'
,
'relative'
);if (opts.width)
 $cont.width(opts.width);if (opts.height&&opts.height !=
'auto'
)
 $cont.height(opts.height);var first=0;$slides.css({position:
'absolute'
,top:0,left:0}).hide().each(function(i){$(this).css(
'z-index'
,els.length-i)});$(els[first]).css(
'opacity'
,1).show();
if ($.browser.msie) els[first].style.removeAttribute(
'filter'
);if (opts.fit&&opts.width)
 $slides.width(opts.width);if (opts.fit&&opts.height&&opts.height !=
'auto'
)
 $slides.height(opts.height);if (opts.pause)
 $cont.hover(function(){this.cyclePause=1;},function(){this.cyclePause=0;});$.fn.cycle.transitions.fade($cont,$slides,opts);$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width();});$slides.not(
':eq('
+first+
')'
).css({opacity:0});if (opts.cssFirst)
$($slides[first]).css(opts.cssFirst);if (opts.timeout){
if (opts.speed.constructor==String)
opts.speed={slow:600,fast:200}[opts.speed]||400;if (!opts.sync)
opts.speed=opts.speed / 2;while((opts.timeout-opts.speed)<250)
opts.timeout+=opts.speed;}
opts.speedIn=opts.speed;opts.speedOut=opts.speed;opts.slideCount=els.length;opts.currSlide=first;opts.nextSlide=1;
var e0=$slides[first];if (opts.before.length)
opts.before[0].apply(e0,[e0,e0,opts,true]);if (opts.after.length>1)
opts.after[1].apply(e0,[e0,e0,opts,true]);if (opts.click&&!opts.next)
opts.next=opts.click;if (opts.next)
$(opts.next).bind(
'click'
,function(){return advance(els,opts,opts.rev?-1:1)});if (opts.prev)
$(opts.prev).bind(
'click'
,function(){return advance(els,opts,opts.rev?1:-1)});if (opts.timeout)
this.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.timeout+(opts.delay||0));});};function go(els,opts,manual,fwd){if (opts.busy) return;var p=els[0].parentNode,curr=els[opts.currSlide],next=els[opts.nextSlide];if (p.cycleTimeout===0&&!manual)
 return;if (manual||!p.cyclePause){if (opts.before.length)
$.each(opts.before,function(i,o){o.apply(next,[curr,next,opts,fwd]);});var after=function(){if ($.browser.msie)
this.style.removeAttribute(
'filter'
);$.each(opts.after,function(i,o){o.apply(next,[curr,next,opts,fwd]);});};if (opts.nextSlide !=opts.currSlide){opts.busy=1;$.fn.cycle.custom(curr,next,opts,after);}
var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}
if (opts.timeout)
p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.timeout);};
function advance(els,opts,val){var p=els[0].parentNode,timeout=p.cycleTimeout;if (timeout){clearTimeout(timeout);p.cycleTimeout=0;}
opts.nextSlide=opts.currSlide+val;if (opts.nextSlide<0){opts.nextSlide=els.length-1;}
else if (opts.nextSlide>=els.length){opts.nextSlide=0;}
go(els,opts,1,val>=0);return false;};$.fn.cycle.custom=function(curr,next,opts,cb){var $l=$(curr),$n=$(next);$n.css({opacity:0});var fn=function(){$n.animate({opacity:1},opts.speedIn,opts.easeIn,cb)};$l.animate({opacity:0},opts.speedOut,opts.easeOut,function(){$l.css({display:
'none'
});if (!opts.sync) fn();});if (opts.sync) fn();};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(
':eq(0)'
).css(
'opacity'
,0);opts.before.push(function(){$(this).show()});}};$.fn.cycle.ver=function(){return ver;};
$.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:
'auto'
,sync:1,fit:0,pause:0,delay:0,slideExpr:null};})(jQuery);
(function($){$.fn.pngfix=function(options){
var elements=this;var settings=$.extend({imageFixSrc:false,sizingMethod:false},options);if(!$.browser.msie||($.browser.msie&&$.browser.version>=7)){return(elements);}
function setFilter(el,path,mode){var fs=el.attr(
"filters"
);var alpha=
"DXImageTransform.Microsoft.AlphaImageLoader"
;if (fs[alpha]){fs[alpha].enabled=true;fs[alpha].src=path;fs[alpha].sizingMethod=mode;} else {el.css(
"filter"
,
'progid:'
+alpha+
'(enabled="true", sizingMethod="'
+mode+
'", src="'
+path+
'")'
);}}
function setDOMElementWidth(el){if(el.css(
"width"
)==
"auto"
&el.css(
"height"
)==
"auto"
){el.css(
"width"
,el.attr(
"offsetWidth"
)+
"px"
);}}
return(elements.each(function(){
var el=$(this);if(el.attr(
"tagName"
).toUpperCase()==
"IMG"
&&(
/\.png/i).test(el.attr(
"src"
))){if(!settings.imageFixSrc){
el.wrap(
"<span></span>"
);var par=el.parent();par.css({height:el.height(),width:el.width(),display:
"inline-block"
});setFilter(par,el.attr(
"src"
),
"scale"
);el.remove();} else if((
/\.gif/i).test(settings.imageFixSrc)){
setDOMElementWidth(el);setFilter(el,el.attr(
"src"
),
"image"
);el.attr(
"src"
,settings.imageFixSrc);}} else {var bg=new String(el.css(
"backgroundImage"
));var matches=bg.match(
/^url\("(.*)"\)$/);if(matches&&matches.length){
setDOMElementWidth(el);el.css(
"backgroundImage"
,
"none"
);
var sc=
"crop"
;if(settings.sizingMethod){sc=settings.sizingMethod;}
setFilter(el,matches[1],sc);
el.find(
"a"
).each(function(){$(this).css(
"position"
,
"relative"
);});}}}));}})(jQuery)
function microAjax(url,cF){this.bF=function(caller,object){return function(){return caller.apply(object,new Array(object));}}
this.sC=function(object){if (this.r.readyState==4){this.cF(this.r.responseText);}}
this.gR=function(){if (window.ActiveXObject)
return new ActiveXObject(
'Microsoft.XMLHTTP'
);else if (window.XMLHttpRequest)
return new XMLHttpRequest();else
return false;}
if (arguments[2]) this.pb=arguments[2];else this.pb=
""
;this.cF=cF;this.url=url;this.r=this.gR();if(this.r){this.r.onreadystatechange=this.bF(this.sC,this);if(this.pb!=
""
){this.r.open(
"POST"
,url,true);this.r.setRequestHeader(
'Content-type'
,
'application/x-www-form-urlencoded'
);this.r.setRequestHeader(
'Connection'
,
'close'
);}else{this.r.open(
"GET"
,url,true);}
this.r.send(this.pb);}}
function calendar (year,month,full,day){if (day==undefined){var day=
''
;}
microAjax (
'http://www.ak-dinamo.hr/wp-content/plugins/ajax-calendar2/ajax.php?full='
+full+
'&month='
+month+
'&day='
+day+
'&year='
+year,function(response){document.getElementById (
'giraffe_calendar'
).innerHTML=response});return false;}
$(document).ready(function(){$(
'#slideshow'
).cycle();$(
'#slideshow-right'
).cycle();$('a[@rel*=lightbox]'
).lightBox();$(
'#name-slideshow-shadow'
).pngfix();$(
'a[rel="external"]'
).click(function(){window.open($(this).attr(
'href'
));return false;});$.browser.msie6=$.browser.msie&&
/MSIE 6\.0/i.test(window.navigator.userAgent)&&!
/MSIE 7\.0/i.test(window.navigator.userAgent);if ($.browser.msie6){$(
'#nav li:has(ul)'
).hover(function(){$(this).css({height:
"23px"
,marginBottom:
"-2px"
}).children(
'ul'
).css({display:
"block"
,marginTop:
"1px"
});},function(){$(this).css({height:
"23px"
,marginBottom:
"0px"
}).children(
'ul'
).css({display:
"none"
,marginTop:
"0px"
});});}
$(
'#main ul.links li a'
).click(function(){window.open($(this).attr(
'href'
));return false;});});