(function(){var scripts=document.getElementsByTagName("script");var jsFolder="";for(var i=0;i0&&inst.options.skinsfolder[inst.options.skinsfolder.length-1]!="/")inst.options.skinsfolder+="/";if(inst.options.skinsfolder.charAt(0)!="/"&&inst.options.skinsfolder.substring(0,5)!="http:"&&inst.options.skinsfolder.substring(0,6)!="https:")inst.options.skinsfolder=inst.options.jsfolder+inst.options.skinsfolder;inst.options.types=["IMAGE","FLASH","VIDEO","YOUTUBE","VIMEO","PDF","MP3","WEB","FLV"];inst.elemArray=new Array;inst.options.curElem=-1;inst.options.flashInstalled=false;try{if(new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))inst.options.flashInstalled=true}catch(e){if(navigator.mimeTypes["application/x-shockwave-flash"])inst.options.flashInstalled=true}inst.options.html5VideoSupported=!!document.createElement("video").canPlayType;inst.options.isChrome=navigator.userAgent.match(/Chrome/i)!=null;inst.options.isFirefox=navigator.userAgent.match(/Firefox/i)!=null;inst.options.isOpera=navigator.userAgent.match(/Opera/i)!=null||navigator.userAgent.match(/OPR\//i)!=null;inst.options.isSafari=navigator.userAgent.match(/Safari/i)!=null;inst.options.isIE=navigator.userAgent.match(/MSIE/i)!=null&&!inst.options.isOpera;inst.options.isIE9=navigator.userAgent.match(/MSIE 9/i)!=null&&!inst.options.isOpera;inst.options.isIE8=navigator.userAgent.match(/MSIE 8/i)!=null&&!inst.options.isOpera;inst.options.isIE7=navigator.userAgent.match(/MSIE 7/i)!=null&&!inst.options.isOpera;inst.options.isIE6=navigator.userAgent.match(/MSIE 6/i)!=null&&!inst.options.isOpera;inst.options.isIE678=inst.options.isIE6||inst.options.isIE7||inst.options.isIE8;inst.options.isIE6789=inst.options.isIE6||inst.options.isIE7||inst.options.isIE8||inst.options.isIE9;inst.options.isAndroid=navigator.userAgent.match(/Android/i)!=null;inst.options.isIPad=navigator.userAgent.match(/iPad/i)!=null;inst.options.isIPhone=navigator.userAgent.match(/iPod/i)!=null||navigator.userAgent.match(/iPhone/i)!=null;inst.options.isMobile=inst.options.isAndroid||inst.options.isIPad||inst.options.isIPhone;inst.options.isIOSLess5=inst.options.isIPad&&inst.options.isIPhone&&(navigator.userAgent.match(/OS 4/i)!=null||navigator.userAgent.match(/OS 3/i)!=null);inst.options.supportCSSPositionFixed=!inst.options.isIE6&&!inst.options.isIOSLess5;inst.options.resizeTimeout=-1;var inst=this;inst.init=function(){inst.showing=false;inst.readData();inst.createMarkup();inst.supportKeyboard()};var ELEM_TYPE=0,ELEM_HREF=1,ELEM_TITLE=2,ELEM_GROUP=3,ELEM_WIDTH=4,ELEM_HEIGHT=5,ELEM_HREF_WEBM=6,ELEM_HREF_OGG=7;inst.readData=function(){inst.each(function(){if(this.nodeName.toLowerCase()!="a"&&this.nodeName.toLowerCase()!="area")return;var $this=$(this);var fileType=inst.checkType($this.attr("href"));if(fileType<0)return;for(var i=0;i"+styleCss+"");inst.$lightbox=jQuery("");inst.$lightbox.css({position:inst.options.supportCSSPositionFixed?"fixed":"absolute"});inst.$lightbox.appendTo("body");inst.$lightboxBox=$("#html5-lightbox-box",inst.$lightbox);inst.$elem=$("#html5-elem-box",inst.$lightbox);inst.$elemWrap=$("#html5-elem-wrap",inst.$lightbox);inst.$loading=$("#html5-loading",inst.$lightbox);inst.$error=$("#html5-error",inst.$lightbox);inst.$image=$("#html5-image",inst.$lightbox);inst.$next=$("#html5-next",inst.$lightbox);inst.$prev=$("#html5-prev",inst.$lightbox);var elemText="";if(inst.options.titlepos=="over")inst.$elemWrap.append(elemText);else inst.$lightboxBox.append(elemText);inst.$elemData=$("#html5-elem-data-box",inst.$lightbox);inst.$text=$("#html5-text",inst.$lightbox);if(inst.options.titlepos=="over"){inst.$elemData.css({position:"absolute",padding:inst.options.bordersize+"px",bottom:0,left:0});inst.$text.css({padding:inst.options.bordersize+"px","background-image":"url('"+inst.options.skinsfolder+inst.options.titlebgimage+"')"})}else{inst.$elemData.css({position:"relative",width:"100%",margin:"0px auto",height:inst.options.barheight+"px","background-color":inst.options.bgcolor});inst.$text.css({"margin-right":inst.options.closepos=="bottom"?"48px":inst.options.bordersize+"px","margin-left":inst.options.bordersize+"px"})}if(inst.options.closepos=="topright")inst.$elemWrap.append("");else inst.$elemData.append("
");inst.$close=$("#html5-close",inst.$lightbox);inst.$watermark=$("#html5-watermark",inst.$lightbox);if(inst.options.stamp)inst.$watermark.html("
"+inst.options.freemark+"
");else if(inst.options.watermark){var html="";if(inst.options.watermarklink)html=""+html+"";inst.$watermark.html(html)}$("#html5-lightbox-overlay",inst.$lightbox).click(inst.finish);inst.$close.click(inst.finish);inst.$next.click(function(){inst.gotoSlide(-1)});inst.$prev.click(function(){inst.gotoSlide(-2)});$(window).resize(function(){if(!inst.options.isMobile){clearTimeout(inst.options.resizeTimeout);inst.options.resizeTimeout=setTimeout(function(){inst.resizeWindow()},500)}});$(window).scroll(function(){inst.scrollBox()});$(window).bind("orientationchange",function(e){if(inst.options.isMobile)inst.resizeWindow()});inst.enableSwipe()};inst.calcNextPrevElem=function(){inst.options.nextElem=-1;inst.options.prevElem=-1;var j,curGroup=inst.elemArray[inst.options.curElem][ELEM_GROUP];if(curGroup!=undefined&&curGroup!=null){for(j=inst.options.curElem+1;j=0){for(j=inst.options.curElem-1;j>=0;j--)if(inst.elemArray[j][ELEM_GROUP]==curGroup){inst.options.prevElem=j;break}if(inst.options.prevElem<0)for(j=inst.elemArray.length-1;j>inst.options.curElem;j--)if(inst.elemArray[j][ELEM_GROUP]==curGroup){inst.options.prevElem=j;break}}}};inst.clickHandler=function(){if(inst.elemArray.length<=0)return true;var $this=$(this);inst.hideObjects();for(var i=0;i");inst.$elem.fadeIn(inst.options.fadespeed,function(){inst.showData()})})};inst.showSWF=function(elem){var dataW=elem[ELEM_WIDTH]?elem[ELEM_WIDTH]:480;var dataH=elem[ELEM_HEIGHT]?elem[ELEM_HEIGHT]:270;var sizeObj=inst.calcElemSize({w:dataW,h:dataH});dataW=sizeObj.w;dataH=sizeObj.h;inst.resizeLightbox(dataW,dataH,true,function(){inst.showTitle(sizeObj.w,elem[ELEM_TITLE]);inst.$image.html("
").show();inst.embedFlash($("#html5lightbox-swf"),dataW,dataH,elem[ELEM_HREF],"window",{width:dataW,height:dataH});inst.$elem.show();inst.showData()})};inst.showVideo=function(elem){var dataW=elem[ELEM_WIDTH]?elem[ELEM_WIDTH]:480;var dataH=elem[ELEM_HEIGHT]?elem[ELEM_HEIGHT]:270;var sizeObj=inst.calcElemSize({w:dataW,h:dataH});dataW=sizeObj.w;dataH=sizeObj.h;inst.resizeLightbox(dataW,dataH,true,function(){inst.showTitle(sizeObj.w,elem[ELEM_TITLE]);inst.$image.html("
").show();var isHTML5=false;if(inst.options.isIE6789||elem[ELEM_TYPE]==8)isHTML5=false;else if(inst.options.isMobile)isHTML5=true;else if((inst.options.html5player||!inst.options.flashInstalled)&&inst.options.html5VideoSupported)if(!inst.options.isFirefox&&!inst.options.isOpera||(inst.options.isFirefox||inst.options.isOpera)&&(elem[ELEM_HREF_OGG]||elem[ELEM_HREF_WEBM]))isHTML5=true;if(isHTML5){var videoSrc=elem[ELEM_HREF];if(inst.options.isFirefox||inst.options.isOpera||!videoSrc)videoSrc=elem[ELEM_HREF_WEBM]?elem[ELEM_HREF_WEBM]:elem[ELEM_HREF_OGG];inst.embedHTML5Video($("#html5lightbox-video"),dataW,dataH,videoSrc,inst.options.autoplay)}else{var videoFile=elem[ELEM_HREF];if(videoFile.charAt(0)!="/"&&videoFile.substring(0,5)!="http:"&&videoFile.substring(0,6)!="https:")videoFile=inst.options.htmlfolder+videoFile;inst.embedFlash($("#html5lightbox-video"),dataW,dataH,inst.options.jsfolder+"html5boxplayer.swf","transparent",{width:dataW,height:dataH,videofile:videoFile,autoplay:inst.options.autoplay?"1":"0",errorcss:".html5box-error"+inst.options.errorcss,id:0})}inst.$elem.show();inst.showData()})};inst.prepareYoutubeHref=function(href){var youtubeId="";var regExp=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\??v?=?))([^#\&\?]*).*/;var match=href.match(regExp);if(match&&match[7]&&match[7].length==11)youtubeId=match[7];return"http://www.youtube.com/embed/"+youtubeId};inst.showYoutubeVimeo=function(elem){var dataW=elem[ELEM_WIDTH]?elem[ELEM_WIDTH]:480;var dataH=elem[ELEM_HEIGHT]?elem[ELEM_HEIGHT]:270;var sizeObj=inst.calcElemSize({w:dataW,h:dataH});dataW=sizeObj.w;dataH=sizeObj.h;inst.resizeLightbox(dataW,dataH,true,function(){inst.showTitle(sizeObj.w,elem[ELEM_TITLE]);inst.$image.html("
").show();var href=elem[ELEM_HREF];if(elem[ELEM_TYPE]==3)href=inst.prepareYoutubeHref(href);if(inst.options.autoplay)if(href.indexOf("?")<0)href+="?autoplay=1";else href+="&autoplay=1";if(elem[ELEM_TYPE]==3)if(href.indexOf("?")<0)href+="?wmode=transparent&rel=0";else href+="&wmode=transparent&rel=0";$("#html5lightbox-video").html("");inst.$elem.show();inst.showData()})};inst.showPDF=function(elem){};inst.showMP3=function(elem){};inst.showWeb=function(elem){var winH=window.innerHeight?window.innerHeight:$(window).height();var dataW=elem[ELEM_WIDTH]?elem[ELEM_WIDTH]:$(window).width();var dataH=elem[ELEM_HEIGHT]?elem[ELEM_HEIGHT]:winH;var sizeObj=inst.calcElemSize({w:dataW,h:dataH});dataW=sizeObj.w;dataH=sizeObj.h;inst.resizeLightbox(dataW,dataH,true,function(){inst.$loading.hide();inst.showTitle(sizeObj.w,elem[ELEM_TITLE]);inst.$image.html("
").show();$("#html5lightbox-web").html("");inst.$elem.show();inst.showData()})};inst.scrollBox=function(){if(!inst.options.supportCSSPositionFixed)inst.$lightbox.css("top",$(window).scrollTop())};inst.resizeWindow=function(){var winH=window.innerHeight?window.innerHeight:$(window).height();var boxT=Math.round(winH/2-inst.$lightboxBox.height()/2);if(inst.options.titlepos!="over")boxT-=Math.round(inst.options.barheight/2);inst.$lightboxBox.animate({"margin-top":boxT},inst.options.resizespeed)};inst.calcElemSize=function(sizeObj){var winH=window.innerHeight?window.innerHeight:$(window).height();var h0=winH-2*inst.options.bordersize-($(window).width()>600?36:0);if(inst.options.titlepos!="over")h0-=inst.options.barheight;if(sizeObj.h>h0){sizeObj.w=Math.round(sizeObj.w*h0/sizeObj.h);sizeObj.h=h0}var w0=$(window).width()-2*inst.options.bordersize;if(sizeObj.w>w0){sizeObj.h=Math.round(sizeObj.h*w0/sizeObj.w);sizeObj.w=w0}return sizeObj};inst.showData=function(){if(inst.$text.text().length>0||inst.options.closepos=="bottom")inst.$elemData.show();if(inst.options.closepos=="bottom"||inst.$text.text().length>0&&inst.options.titlepos!="over")inst.$lightboxBox.css({height:String(inst.$lightboxBox.height()+inst.options.barheight)+"px"})};inst.resizeLightbox=function(elemW,elemH,bAnimate,onFinish){var winH=window.innerHeight?window.innerHeight:$(window).height();var speed=bAnimate?inst.options.resizespeed:0;var boxW=elemW+2*inst.options.bordersize;var boxH=elemH+2*inst.options.bordersize;var boxT=Math.round(winH/2-boxH/2);if(inst.options.titlepos!="over")boxT-=Math.round(inst.options.barheight/2);if(boxW==inst.$elemWrap.width()&&boxH==inst.$elemWrap.height())speed=0;inst.$loading.hide();inst.$watermark.hide();inst.$elem.bind("mouseenter mousemove",function(){if(inst.options.prevElem>=0||inst.options.nextElem>=0){inst.$next.fadeIn();inst.$prev.fadeIn()}});inst.$elem.bind("mouseleave",function(){inst.$next.fadeOut();inst.$prev.fadeOut()});inst.$lightboxBox.css({"margin-top":boxT});inst.$lightboxBox.css({"width":boxW,"height":boxH});inst.$elemWrap.animate({width:boxW},speed).animate({height:boxH},speed,function(){inst.$loading.show();inst.$watermark.show();inst.$close.show();onFinish()})};inst.reset=function(){if(inst.options.stamp)inst.$watermark.hide();inst.showing=false;inst.$image.empty();inst.$text.empty();inst.$error.hide();inst.$loading.hide();inst.$image.hide();inst.$elemData.hide();inst.$close.hide()};inst.finish=function(){inst.reset();inst.$lightbox.hide();inst.showObjects()};inst.pauseSlide=function(){};inst.playSlide=function(){};inst.gotoSlide=function(slide){if(slide==-1){if(inst.options.nextElem<0)return;inst.options.curElem=inst.options.nextElem}else if(slide==-2){if(inst.options.prevElem<0)return;inst.options.curElem=inst.options.prevElem}inst.calcNextPrevElem();inst.reset();inst.loadCurElem()};inst.supportKeyboard=function(){$(document).keyup(function(e){if(!inst.showing)return;if(inst.options.supportesckey&&e.keyCode==27)inst.finish();else if(inst.options.supportarrowkeys)if(e.keyCode==39)inst.gotoSlide(-1);else if(e.keyCode==37)inst.gotoSlide(-2)})};inst.enableSwipe=function(){inst.$elem.touchSwipe({preventWebBrowser:true,swipeLeft:function(){inst.gotoSlide(-1)},swipeRight:function(){inst.gotoSlide(-2)}})};inst.hideObjects=function(){$("select, embed, object").css({"visibility":"hidden"})};inst.showObjects=function(){$("select, embed, object").css({"visibility":"visible"})};inst.embedHTML5Video=function($container,w,h,src,autoplay){$container.html("
");if(inst.options.isAndroid){var $play=$("
").appendTo($container);$play.unbind("click").click(function(){$("video",$(this).parent())[0].play()})}};inst.embedFlash=function($container,w,h,src,wmode,flashVars){if(inst.options.flashInstalled){var htmlOptions={pluginspage:"http://www.adobe.com/go/getflashplayer",quality:"high",allowFullScreen:"true",allowScriptAccess:"always",type:"application/x-shockwave-flash"};htmlOptions.width=w;htmlOptions.height=h;htmlOptions.src=src;htmlOptions.flashVars=$.param(flashVars);htmlOptions.wmode=wmode;var htmlString="";for(var key in htmlOptions)htmlString+=key+"="+htmlOptions[key]+" ";$container.html("")}else $container.html("
The required Adobe Flash Player plugin is not installed

Get Adobe Flash player
")};inst.checkType=function(href){if(!href)return-1;if(href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i))return 0;if(href.match(/[^\.]\.(swf)\s*$/i))return 1;if(href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i))return 2;if(href.match(/\:\/\/.*(youtube\.com)/i)||href.match(/\:\/\/.*(youtu\.be)/i))return 3;if(href.match(/\:\/\/.*(vimeo\.com)/i))return 4;if(href.match(/[^\.]\.(pdf)\s*$/i))return 5;if(href.match(/[^\.]\.(mp3)\s*$/i))return 6;if(href.match(/[^\.]\.(flv)\s*$/i))return 8;return 7};inst.showLightbox=function(type,href,title,width,height,webm,ogg){inst.$next.hide();inst.$prev.hide();inst.reset();inst.$lightbox.show();if(!inst.options.supportCSSPositionFixed)inst.$lightbox.css("top",$(window).scrollTop());var winH=window.innerHeight?window.innerHeight:$(window).height();var boxW=inst.options.loadingwidth+2*inst.options.bordersize;var boxH=inst.options.loadingheight+2*inst.options.bordersize;var boxT=Math.round(winH/2-boxH/2);if(inst.options.titlepos!="over")boxT-=Math.round(inst.options.barheight/2);inst.$lightboxBox.css({"margin-top":boxT,"width":boxW,"height":boxH});inst.$elemWrap.css({"width":boxW,"height":boxH});inst.loadElem(new Array(type,href,title,null,width,height,webm,ogg))};inst.addItem=function(href,title,group,width,height,webm,ogg){type=inst.checkType(href);inst.elemArray.push(new Array(type,href,title,group,width,height,webm,ogg))};inst.showItem=function(href){if(inst.elemArray.length<=0)return true;inst.hideObjects();for(var i=0;i=1){startX=e.targetTouches[0].pageX;startY=e.targetTouches[0].pageY}else touchCancel(event)}function touchMove(event){if(defaults.preventWebBrowser)event.preventDefault();var e=event.originalEvent;if(e.targetTouches.length>=1){curX=e.targetTouches[0].pageX;curY=e.targetTouches[0].pageY}else touchCancel(event)}function touchEnd(event){if(curX>0||curY>0){triggerHandler();touchCancel(event)}else touchCancel(event)}function touchCancel(event){startX=-1;startY=-1;curX=-1;curY=-1}function triggerHandler(){if(curX>startX){if(defaults.swipeRight)defaults.swipeRight.call()}else if(defaults.swipeLeft)defaults.swipeLeft.call();if(curY>startY){if(defaults.swipeBottom)defaults.swipeBottom.call()}else if(defaults.swipeTop)defaults.swipeTop.call()}try{$(this).bind("touchstart",touchStart);$(this).bind("touchmove",touchMove);$(this).bind("touchend",touchEnd);$(this).bind("touchcancel",touchCancel)}catch(e){}})}})(jQuery);jQuery(document).ready(function(){if(typeof html5Lightbox==="undefined")html5Lightbox=jQuery(".html5lightbox").html5lightbox()})};