jQuery(document).ready(function(){jQuery("a.main-menu-navitem").click(function(){jQuery(this).next("ul").slideDown(200);jQuery(this).toggleClass("open");jQuery(this).next("ul").toggleClass("subopen")})});jQuery(function(){jQuery("a[@rel*=lightbox]").lightBox()});(function(b){b.fn.lightBox=function(v){v=b.extend({overlayBgColor:"#000",overlayOpacity:0.8,fixedNavigation:false,imageLoading:"loading.gif",imageBtnPrev:"previous.png",imageBtnNext:"next.png",imageBtnClose:"close.png",imageBlank:"lightbox-blank.gif",containerResizeSpeed:400,txtImage:"",txtOf:"/",keyToClose:"c",keyToPrev:"p",keyToNext:"n",imageArray:[],activeImage:0},v);var C=this;function t(){w(this,C);return false}function w(c,d){b("embed, object, select").css({visibility:"hidden"});I();v.imageArray.length=0;v.activeImage=0;if(d.length==1){v.imageArray.push(new Array(c.getAttribute("href"),c.getAttribute("title")))}else{for(var e=0;e<d.length;e++){v.imageArray.push(new Array(d[e].getAttribute("href"),d[e].getAttribute("title")))}}while(v.imageArray[v.activeImage][0]!=c.getAttribute("href")){v.activeImage++}z()}function I(){b("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="'+Liferay.ThemeDisplay.getPathThemeImages()+"/"+v.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="'+Liferay.ThemeDisplay.getPathThemeImages()+"/"+v.imageBtnClose+'"></a></div></div></div></div>');var d=F();b("#jquery-overlay").css({backgroundColor:v.overlayBgColor,opacity:v.overlayOpacity,width:d[0],height:d[1]}).fadeIn();var c=D();b("#jquery-lightbox").css({top:c[1]+(d[3]/10),left:c[0]}).show();b("#jquery-overlay,#jquery-lightbox").click(function(){J()});b("#lightbox-loading-link,#lightbox-secNav-btnClose").click(function(){J();return false});b(window).resize(function(){var f=F();b("#jquery-overlay").css({width:f[0],height:f[1]});var e=D();b("#jquery-lightbox").css({top:e[1]+(f[3]/10),left:e[0]})})}function z(){b("#lightbox-loading").show();if(v.fixedNavigation){b("#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide()}else{b("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide()}var c=new Image();c.onload=function(){b("#lightbox-image").attr("src",v.imageArray[v.activeImage][0]);B(c.width,c.height);c.onload=function(){}};c.src=v.imageArray[v.activeImage][0]}function B(e,i){var h=b("#lightbox-container-image-box").width();var j=b("#lightbox-container-image-box").height();var d=(e);var f=(i);var g=h-d;var c=j-f;b("#lightbox-container-image-box").animate({width:d,height:f},v.containerResizeSpeed,function(){E()});if((g==0)&&(c==0)){if(b.browser.msie){x(250)}else{x(100)}}b("#lightbox-container-image-data-box").css({width:e});b("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({height:i})}function E(){b("#lightbox-loading").hide();b("#lightbox-image").fadeIn(function(){A();a()});u()}function A(){b("#lightbox-container-image-data-box").slideDown("fast");b("#lightbox-image-details-caption").hide();if(v.imageArray[v.activeImage][1]){b("#lightbox-image-details-caption").html(v.imageArray[v.activeImage][1]).show()}if(v.imageArray.length>1){b("#lightbox-image-details-currentNumber").html(v.txtImage+" "+(v.activeImage+1)+" "+v.txtOf+" "+v.imageArray.length).show()}}function a(){b("#lightbox-nav").show();b("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({background:"transparent url("+Liferay.ThemeDisplay.getPathThemeImages()+"/"+v.imageBlank+") no-repeat"});if(v.activeImage!=0){if(v.fixedNavigation){b("#lightbox-nav-btnPrev").css({background:"url("+Liferay.ThemeDisplay.getPathThemeImages()+"/"+v.imageBtnPrev+") 10% 15% no-repeat"}).unbind().bind("click",function(){v.activeImage=v.activeImage-1;z();return false})}else{b("#lightbox-nav-btnPrev").unbind().hover(function(){b(this).css({background:"url("+Liferay.ThemeDisplay.getPathThemeImages()+"/"+v.imageBtnPrev+") 10% 15% no-repeat"})},function(){b(this).css({background:"transparent url("+Liferay.ThemeDisplay.getPathThemeImages()+"/"+v.imageBlank+") no-repeat"})}).show().bind("click",function(){v.activeImage=v.activeImage-1;z();return false})}}if(v.activeImage!=(v.imageArray.length-1)){if(v.fixedNavigation){b("#lightbox-nav-btnNext").css({background:"url("+Liferay.ThemeDisplay.getPathThemeImages()+"/"+v.imageBtnNext+") 90% 15% no-repeat"}).unbind().bind("click",function(){v.activeImage=v.activeImage+1;z();return false})}else{b("#lightbox-nav-btnNext").unbind().hover(function(){b(this).css({background:"url("+Liferay.ThemeDisplay.getPathThemeImages()+"/"+v.imageBtnNext+") 90% 15% no-repeat"})},function(){b(this).css({background:"transparent url("+Liferay.ThemeDisplay.getPathThemeImages()+"/"+v.imageBlank+") no-repeat"})}).show().bind("click",function(){v.activeImage=v.activeImage+1;z();return false})}}y()}function y(){b(document).keydown(function(c){H(c)})}function G(){b(document).unbind()}function H(c){if(c==null){keycode=event.keyCode;escapeKey=27}else{keycode=c.keyCode;escapeKey=c.DOM_VK_ESCAPE}key=String.fromCharCode(keycode).toLowerCase();if((key==v.keyToClose)||(key=="x")||(keycode==escapeKey)){J()}if((key==v.keyToPrev)||(keycode==37)){if(v.activeImage!=0){v.activeImage=v.activeImage-1;z();G()}}if((key==v.keyToNext)||(keycode==39)){if(v.activeImage!=(v.imageArray.length-1)){v.activeImage=v.activeImage+1;z();G()}}}function u(){if((v.imageArray.length-1)>v.activeImage){objNext=new Image();objNext.src=v.imageArray[v.activeImage+1][0]}if(v.activeImage>0){objPrev=new Image();objPrev.src=v.imageArray[v.activeImage-1][0]}}function J(){b("#jquery-lightbox").remove();b("#jquery-overlay").fadeOut(function(){b("#jquery-overlay").remove()});b("embed, object, select").css({visibility:"visible"})}function F(){var d,f;if(window.innerHeight&&window.scrollMaxY){d=window.innerWidth+window.scrollMaxX;f=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){d=document.body.scrollWidth;f=document.body.scrollHeight}else{d=document.body.offsetWidth;f=document.body.offsetHeight}}var e,c;if(self.innerHeight){if(document.documentElement.clientWidth){e=document.documentElement.clientWidth}else{e=self.innerWidth}c=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){e=document.documentElement.clientWidth;c=document.documentElement.clientHeight}else{if(document.body){e=document.body.clientWidth;c=document.body.clientHeight}}}if(f<c){pageHeight=c}else{pageHeight=f}if(d<e){pageWidth=d}else{pageWidth=e}arrayPageSize=new Array(pageWidth,pageHeight,e,c);return arrayPageSize}function D(){var c,d;if(self.pageYOffset){d=self.pageYOffset;c=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){d=document.documentElement.scrollTop;c=document.documentElement.scrollLeft}else{if(document.body){d=document.body.scrollTop;c=document.body.scrollLeft}}}arrayPageScroll=new Array(c,d);return arrayPageScroll}function x(c){var d=new Date();e=null;do{var e=new Date()}while(e-d<c)}return this.unbind("click").click(t)}})(jQuery);