/** HTML5 LightBox - jQuery Image and Video LightBox Plugin * Copyright 2013 Magic Hills Pty Ltd All Rights Reserved * Website: http://html5box.com * Version 2.1 */ (function () { var scripts = document.getElementsByTagName("script"); var jsFolder = ""; for (var i = 0; i < scripts.length; i++) if (scripts[i].src && scripts[i].src.match(/html5lightbox\.js/i)) jsFolder = scripts[i].src.substr(0, scripts[i].src.lastIndexOf("/") + 1); if (typeof jQuery == "undefined" || parseFloat(/^\d\.\d+/i.exec(jQuery.fn.jquery)) < 1.6) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.setAttribute("type", "text/javascript"); if (script.readyState) script.onreadystatechange = function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;loadHtml5LightBox(jsFolder)}};else script.onload=function(){loadHtml5LightBox(jsFolder)};script.setAttribute("src",jsFolder+"jquery.js");head.appendChild(script)}else loadHtml5LightBox(jsFolder)})(); function loadHtml5LightBox(jsFolder){(function($){$.fn.html5lightbox=function(options){var inst=this;inst.options=jQuery.extend({autoplay:true,html5player:true,overlaybgcolor:"#000000",overlayopacity:0.9,bgcolor:"#ffffff",bordersize:8,barheight:36,loadingwidth:64,loadingheight:64,resizespeed:400,fadespeed:400,skinfolder:"skins/default/",titlecss:"{color:#333333; font-size:16px; font-family:Armata,sans-serif,Arial; overflow:hidden; white-space:nowrap;}",errorwidth:280,errorheight:48,errorcss:"{text-align:center; color:#ff0000; font-size:14px; font-family:Arial, sans-serif;}", version:"2.1",stamp:false,freemark:"html5box.com",freelink:"http://html5box.com/",watermark:"",watermarklink:""},options);if(typeof html5lightbox_options!="undefined"&&html5lightbox_options)jQuery.extend(inst.options,html5lightbox_options);inst.options.htmlfolder=window.location.href.substr(0,window.location.href.lastIndexOf("/")+1);inst.options.jsfolder=jsFolder;if(inst.options.skinfolder.charAt(0)!="/"&&inst.options.skinfolder.substring(0,5)!="http:"&&inst.options.skinfolder.substring(0,6)!="https:")inst.options.skinfolder= jsFolder+inst.options.skinfolder;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;inst.options.isSafari=navigator.userAgent.match(/Safari/i)!=null;inst.options.isIE=navigator.userAgent.match(/MSIE/i)!=null&&!inst.options.isOpera;inst.options.isIE9=inst.options.isIE&&inst.options.html5VideoSupported;inst.options.isIE678=inst.options.isIE&&!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.resizeTimeout=-1;var inst=this;inst.init=function(){inst.readData();inst.createMarkup()};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")return; var $this=$(this);var fileType=inst.checkType($this.attr("href"));if(fileType<0)return;inst.elemArray.push(new Array(fileType,$this.attr("href"),$this.attr("title"),$this.data("group"),$this.data("width"),$this.data("height"),$this.data("webm"),$this.data("ogg")))})};inst.createMarkup=function(){var fontRef=("https:"==document.location.protocol?"https":"http")+"://fonts.googleapis.com/css?family=Armata";var fontLink=document.createElement("link");fontLink.setAttribute("rel","stylesheet");fontLink.setAttribute("type", "text/css");fontLink.setAttribute("href",fontRef);document.getElementsByTagName("head")[0].appendChild(fontLink);var styleCss="#html5-text "+inst.options.titlecss;styleCss+=".html5-error "+inst.options.errorcss;$("head").append("");inst.$lightbox=jQuery("");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.$elemData=$("#html5-elem-data-box",inst.$lightbox);inst.$text= $("#html5-text",inst.$lightbox);inst.$next=$("#html5-next",inst.$lightbox);inst.$prev=$("#html5-prev",inst.$lightbox);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.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;i0||inst.options.nextElem>0)textW-=36;return textW};inst.showImage=function(elem,imgW,imgH){var elemW,elemH;if(elem[ELEM_WIDTH])elemW=elem[ELEM_WIDTH];else{elemW=imgW;elem[ELEM_WIDTH]=imgW}if(elem[ELEM_HEIGHT])elemH=elem[ELEM_HEIGHT];else{elemH=imgH;elem[ELEM_HEIGHT]=imgH}var sizeObj=inst.calcElemSize({w:elemW, h:elemH});inst.resizeLightbox(sizeObj.w,sizeObj.h,true,function(){inst.$text.css({width:inst.calcTextWidth(sizeObj.w)});inst.$text.html(elem[ELEM_TITLE]);inst.$image.show().css({width:sizeObj.w,height:sizeObj.h});inst.$image.html("");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.$text.css({width:inst.calcTextWidth(dataW)});inst.$text.html(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.$text.css({width:inst.calcTextWidth(dataW)});inst.$text.html(elem[ELEM_TITLE]);inst.$image.html("
").show();var isHTML5=false;if(elem[ELEM_TYPE]==2)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.$text.css({width:inst.calcTextWidth(dataW)}); inst.$text.html(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";if(inst.options.html5player)href+="&html5=1"}$("#html5lightbox-video").html("");inst.$elem.show();inst.showData()})};inst.showPDF=function(elem){};inst.showMP3=function(elem){};inst.showWeb=function(elem){var dataW=elem[ELEM_WIDTH]?elem[ELEM_WIDTH]:$(window).width();var dataH=elem[ELEM_HEIGHT]?elem[ELEM_HEIGHT]:$(window).height();var sizeObj=inst.calcElemSize({w:dataW,h:dataH});dataW=sizeObj.w;dataH=sizeObj.h;inst.resizeLightbox(dataW,dataH,true,function(){inst.$text.css({width:inst.calcTextWidth(dataW)}); inst.$text.html(elem[ELEM_TITLE]);inst.$image.html("
").show();$("#html5lightbox-web").html("");inst.$elem.show();inst.showData()})};inst.scrollBox=function(){inst.$lightbox.css("top",$(window).scrollTop())};inst.resizeWindow=function(){var boxT=Math.round($(window).height()/2-(inst.$lightboxBox.height()+inst.options.barheight)/ 2);inst.$lightboxBox.animate({"margin-top":boxT},inst.options.resizespeed)};inst.calcElemSize=function(sizeObj){var h0=$(window).height()-inst.options.barheight-2*inst.options.bordersize;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(){inst.$elemData.show();inst.$lightboxBox.animate({height:inst.$lightboxBox.height()+ inst.options.barheight},{queue:true,duration:inst.options.resizespeed})};inst.resizeLightbox=function(elemW,elemH,bAnimate,onFinish){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($(window).height()/2-(boxH+inst.options.barheight)/2);if(boxW==inst.$elemWrap.width()&&boxH==inst.$elemWrap.height())speed=0;inst.$loading.hide();inst.$watermark.hide();inst.$lightboxBox.animate({"margin-top":boxT},speed, function(){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.$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()});onFinish()})})};inst.reset=function(){if(inst.options.stamp)inst.$watermark.hide(); inst.$image.empty();inst.$text.empty();inst.$error.hide();inst.$loading.hide();inst.$image.hide();inst.$elemData.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.enableKeyboard=function(){};inst.enableSwipe=function(){};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(){$(this).hide();$("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(); inst.$lightbox.css("top",$(window).scrollTop());var boxW=inst.options.loadingwidth+2*inst.options.bordersize;var boxH=inst.options.loadingheight+2*inst.options.bordersize;var boxT=Math.round($(window).height()/2-(boxH+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