').css('line-height',$(window).height()+"px").appendTo($("body"));var closeBtn=$('
').click(close);closeBtn.appendTo(imgContainer);showArrows();}move(current);});};function move(index){if(index<0||index>=images.length){return;}showError(false);current=index;$(".art-lightbox-wrapper .art-lightbox-image:not(.active)").remove();var active=$(".art-lightbox-wrapper .active");var target=$('').click(function(){if($(this).hasClass("active")){move(current+1);}});if(active.length>0){active.after(target);}else{$(".art-lightbox-wrapper").append(target);}showArrows();showLoader(true);bindMouse($(".art-lightbox-wrapper").add(target));target.load(function(){showLoader(false);active.removeClass("active");target.addClass("active");});target.error(function(){showLoader(false);active.removeClass("active");target.addClass("active");target.attr("src",$(images[current]).attr("src"));});}function showArrows(){if($(".art-lightbox-wrapper .arrow").length===0){$(".art-lightbox-wrapper").append($('
').css("top",$(window).height()/2-40).click(function(){if(!$(this).hasClass("disabled")){move(current-1);}}));$(".art-lightbox-wrapper").append($('
').css("top",$(window).height()/2-40).click(function(){if(!$(this).hasClass("disabled")){move(current+1);}}));}if(current===0){$(".art-lightbox-wrapper .arrow.left").addClass("disabled");}else{$(".art-lightbox-wrapper .arrow.left").removeClass("disabled");}if(current===images.length-1){$(".art-lightbox-wrapper .arrow.right").addClass("disabled");}else{$(".art-lightbox-wrapper .arrow.right").removeClass("disabled");}}function showError(enable){if(enable){$(".art-lightbox-wrapper").append($('
The requested content cannot be loaded.
Please try again later.
').css({"top":$(window).height()/2-60,"left":$(window).width()/2-170}));}else{$(".art-lightbox-wrapper .lightbox-error").remove();}}function showLoader(enable){if(!enable){$(".art-lightbox-wrapper .loading").remove();}else{$('
').css({"top":$(window).height()/2-16,"left":$(window).width()/2-16}).appendTo($(".art-lightbox-wrapper"));}}var close=function(){$(".art-lightbox-wrapper").remove();};function bindMouse(img){img.bind('mousewheel DOMMouseScroll',function(e){var orgEvent=window.event||e.originalEvent;var delta=(orgEvent.wheelDelta?orgEvent.wheelDelta:orgEvent.detail*-1)>0?1:-1;move(current+delta);e.preventDefault();}).mousedown(function(e){if(e.which===2){close();}e.preventDefault();});}function getFullImgSrc(src){var fileName=src.substring(0,src.lastIndexOf('.'));var ext=src.substring(src.lastIndexOf('.'));return fileName+"-large"+ext;}});})(jQuery);jQuery(function(){'use strict';new ThemeLightbox().init();});(function($){'use strict';$.support.transition=(function(){var thisBody=document.body||document.documentElement,thisStyle=thisBody.style,support=thisStyle.transition!==undefined||thisStyle.WebkitTransition!==undefined||thisStyle.MozTransition!==undefined||thisStyle.MsTransition!==undefined||thisStyle.OTransition!==undefined;return support&&{event:(function(){var e="transitionend";if(browser.opera){var version=browser.version;e=version>=12?(version<12.50?"otransitionend":"transitionend"):"oTransitionEnd";}else if(browser.chrome||browser.safari){e="webkitTransitionEnd";}return e;})(),prefix:(function(){return({opera:"-o-",firefox:"-moz-",chrome:"-webkit-",safari:"-webkit-",ie:"-ms-"}[browser.name]);})()};})();window.BackgroundHelper=function(){var slides=[];var direction="next";var motion="horizontal";var width=0;var height=0;var multiplier=1;var transitionDuration="";this.init=function(motionType,dir,duration){direction=dir;motion=motionType;slides=[];width=0;height=0;multiplier=1;transitionDuration=duration;};this.processSlide=function(element,modify){this.updateSize(element,null);var pos=[];var bgPosition=element.css("background-position");var positions=bgPosition.split(",");$.each(positions,function(i){var position=$.trim(this);var point=position.split(" ");if(point.length>1){var x=parseInt(point[0],10);var y=parseInt(point[1],10);pos.push({x:x,y:y});}});slides.push({"images":element.css("background-image"),"sizes":element.css("background-size"),"positions":pos});if(modify)element.css("background-image","none");};this.updateSize=function(element,initialSize){width=element.outerWidth(false);height=element.outerHeight();if(initialSize&&parseInt(initialSize.width,10)!==0){multiplier=width/initialSize.width;if(motion==="fade"){$.each(element.children(),function(i){$(this).css("background-position",getCssPositions(slides[i].positions,{x:0,y:0}));});}}};this.setBackground=function(element,items){var bg=[];var sizes=[];$.each(items,function(i,o){bg.push(o.images);sizes.push(o.sizes);});element.css({"background-image":bg.join(", "),"background-size":sizes.join(", "),"background-repeat":"no-repeat"});};this.setPosition=function(element,items){var pos=[];$.each(items,function(i,o){pos.push(o.positions);});element.css({"background-position":pos.join(", ")});};this.current=function(index){return slides[index]||null;};this.next=function(index){var next;if(direction==="next"){next=(index+1)%slides.length;}else{next=index-1;if(next<0){next=slides.length-1;}}return slides[next];};this.items=function(prev,next,move){var prevItem={x:0,y:0};var nextItem={x:0,y:0};var isDirectionNext=direction==="next";if(motion==="horizontal"){nextItem.x=isDirectionNext?width:-width;nextItem.y=0;if(move){prevItem.x+=isDirectionNext?-width:width;nextItem.x+=isDirectionNext?-width:width;}}else if(motion==="vertical"){nextItem.x=0;nextItem.y=isDirectionNext?height:-height;if(move){prevItem.y+=isDirectionNext?-height:height;nextItem.y+=isDirectionNext?-height:height;}}var result=[];if(!!prev){result.push({images:prev.images,positions:getCssPositions(prev.positions,prevItem),sizes:prev.sizes});}if(!!next){result.push({images:next.images,positions:getCssPositions(next.positions,nextItem),sizes:next.sizes});}if(direction==="next"){result.reverse();}return result;};this.transition=function(container,on){container.css($.support.transition.prefix+"transition",on?transitionDuration+" ease-in-out background-position":"");};function getCssPositions(positions,offset){var result=[];if(positions===undefined){return"";}offset.x=offset.x||0;offset.y=offset.y||0;for(var i=0;i(children.length-1)||index<0){return;}if(active){return element.one("afterSlide",function(){slider.to(index);});}if(activeIndex===index){return;}this.move(index>activeIndex?"next":"prev",$(children[index]));};this.next=function(){if(!active){if(last){this.stop();return;}this.move("next");}};this.prev=function(){if(!active){if(last){this.stop();return;}this.move("prev");}};this.start=function(force){if(!!force){setTimeout($.proxy(this.next,this),10);}interval=setInterval($.proxy(this.next,this),this.settings.pause);running=true;};this.stop=function(pause){clearInterval(interval);interval=null;running=!!pause;active=false;};this.active=function(){return running;};this.moving=function(){return active;};this.navigate(children.filter(".active"));if(this.settings.clickevents){$(this.settings.navigator).on("click","a",{slider:this},function(event){var activeIndex=children.index(children.filter(".active"));var index=$(this).parent().children().index($(this));if(activeIndex!==index){event.data.slider.to(index);}event.preventDefault();});}if(this.settings.hover){var slider=this;element.add(this.settings.navigator).add(element.siblings(".art-shapes")).hover(function(){if(element.is(":visible")&&!last){slider.stop(true);}},function(){if(element.is(":visible")&&!last){slider.start();}});}};$.fn.slider=function(arg){return this.each(function(){var element=$(this),data=element.data("slider"),options=typeof arg==="object"&&arg;if(!data){data=new Slider(element,options);element.data("slider",data);}if(typeof arg==="string"&&data[arg]){data[arg]();}else if(data.settings.auto&&element.is(":visible")){data.start();}});};})(jQuery);jQuery(function($){"use strict";if(!browser.ie||browser.version>8)return;var path="";var scripts=$("script[src*='script.js']");if(scripts.length>0){var src=scripts.last().attr('src');path=src.substr(0,src.indexOf("script.js"));}processHeaderMultipleBg(path);});var processHeaderMultipleBg=(function($){"use strict";return(function(path){var header=$(".art-header");var bgimages="".split(",");var bgpositions="".split(",");for(var i=bgimages.length-1;i>=0;i--){var bgimage=$.trim(bgimages[i]);if(bgimage==="")continue;if(path!==""){bgimage=bgimage.replace(/(url\(['"]?)/i,"$1"+path);}header.append("
");}header.css('background-image',"url('images/header.jpg')".replace(/(url\(['"]?)/i,"$1"+path));header.css('background-position',"center top");});})(jQuery);(function($){'use strict';$(function(){artButtonSetup("btn-primary");artButtonSetup("button");artButtonSetup("readon");artButtonSetup("readmore");});$(function($){var links=$('a.art-rss-tag-icon[href="#"], a.art-rss-tag-icon[href=""]'),href=$('head link[type="application/rss+xml"]').attr('href');if(href){links.attr('href',href);}else{links.hide();}});$(function($){$('.art-messages').each(function(){$(this).css('display',$(this).find('dl, .alert').length?'':'none');});});$(function($){$('.art-search-button').each(function(i,val){var element=$(val),background=element.css('background-image');if(-1!==background.indexOf('url')){element.val('');}if(element.hasClass('art-button')){element.removeClass('art-button');}});});$(function($){if(!browser.ie||browser.version>8){return;}var scriptSrc=jQuery('script[src*="script.js"]').last().attr('src'),pathToImages=scriptSrc.substr(0,scriptSrc.lastIndexOf('/')+1)+'data/images/';$('.art-slider .art-slide-item').each(function(){var bg=$(this).css('background-image');if(bg){bg=bg.replace(/url\(["'](.+)["']\)/,function(match,path){var imageName=path.substr(path.lastIndexOf('/')+1);return'url(\''+pathToImages+imageName+'\')';});$(this).css('background-image',bg);}});});}(jQuery));