/* * shadowbox.js, version 3.0.3 * http://shadowbox-js.com/ * * copyright 2007-2010, michael j. i. jackson * date: 2011-05-14 07:12:22 +0000 */ (function(au,k){var q={version:"3.0.3"};var j=navigator.useragent.tolowercase();if(j.indexof("windows")>-1||j.indexof("win32")>-1){q.iswindows=true}else{if(j.indexof("macintosh")>-1||j.indexof("mac os x")>-1){q.ismac=true}else{if(j.indexof("linux")>-1){q.islinux=true}}}q.isie=j.indexof("msie")>-1;q.isie6=j.indexof("msie 6")>-1;q.isie7=j.indexof("msie 7")>-1;q.isgecko=j.indexof("gecko")>-1&&j.indexof("safari")==-1;q.iswebkit=j.indexof("applewebkit/")>-1;var ab=/#(.+)$/,af=/^(light|shadow)box\[(.*?)\]/i,az=/\s*([a-z_]*?)\s*=\s*(.+)\s*/,f=/[0-9a-z]+$/i,ad=/(.+\/)shadowbox\.js/i;var a=false,a=false,l={},z=0,r,ap;q.current=-1;q.dimensions=null;q.ease=function(k){return 1+math.pow(k-1,3)};q.errorinfo={fla:{name:"flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"quicktime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"windows media player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"flip4mac",url:"http://www.flip4mac.com/wmv_download.htm"}};q.gallery=[];q.onready=aj;q.path=null;q.player=null;q.playerid="sb-player";q.options={animate:true,animatefade:true,autoplaymovies:true,continuous:false,enablekeys:true,flashparams:{bgcolor:"#000000",allowfullscreen:true},flashvars:{},flashversion:"9.0.115",handleoversize:"resize",handleunsupported:"link",onchange:aj,onclose:aj,onfinish:aj,onopen:aj,showmoviecontrols:true,skipsetup:false,slideshowdelay:0,viewportpadding:20};q.getcurrent=function(){return q.current>-1?q.gallery[q.current]:null};q.hasnext=function(){return q.gallery.length>1&&(q.current!=q.gallery.length-1||q.options.continuous)};q.isopen=function(){return a};q.ispaused=function(){return ap=="pause"};q.applyoptions=function(k){l=ac({},q.options);ac(q.options,k)};q.revertoptions=function(){ac(q.options,l)};q.init=function(ag,aj){if(a){return}a=true;if(q.skin.options){ac(q.options,q.skin.options)}if(ag){ac(q.options,ag)}if(!q.path){var ai,s=document.getelementsbytagname("script");for(var ah=0,k=s.length;ahaq){as=aq-am}var ag=2*ao+k;if(aj+ag>ar){aj=ar-ag}var s=(an-as)/an,ap=(ah-aj)/ah,ak=(s>0||ap>0);if(al&&ak){if(s>ap){aj=math.round((ah/an)*as)}else{if(ap>s){as=math.round((an/ah)*aj)}}}q.dimensions={height:as+ai,width:aj+k,innerheight:as,innerwidth:aj,top:math.floor((aq-(as+am))/2+ao),left:math.floor((ar-(aj+ag))/2+ao),oversized:ak};return q.dimensions};q.makegallery=function(ai){var k=[],ah=-1;if(typeof ai=="string"){ai=[ai]}if(typeof ai.length=="number"){af(ai,function(ak,al){if(al.content){k[ak]=al}else{k[ak]={content:al}}});ah=0}else{if(ai.tagname){var s=q.getcache(ai);ai=s?s:q.makeobject(ai)}if(ai.gallery){k=[];var aj;for(var ag in q.cache){aj=q.cache[ag];if(aj.gallery&&aj.gallery==ai.gallery){if(ah==-1&&aj.content==ai.content){ah=k.length}k.push(aj)}}if(ah==-1){k.unshift(ai);ah=0}}else{k=[ai];ah=0}}af(k,function(ak,al){k[ak]=ac({},al)});return[k,ah]};q.makeobject=function(ah,ag){var ai={content:ah.href,title:ah.getattribute("title")||"",link:ah};if(ag){ag=ac({},ag);af(["player","title","height","width","gallery"],function(aj,ak){if(typeof ag[ak]!="undefined"){ai[ak]=ag[ak];delete ag[ak]}});ai.options=ag}else{ai.options={}}if(!ai.player){ai.player=q.getplayer(ai.content)}var k=ah.getattribute("rel");if(k){var s=k.match(af);if(s){ai.gallery=escape(s[2])}af(k.split(";"),function(aj,ak){s=ak.match(az);if(s){ai[s[1]]=s[2]}})}return ai};q.getplayer=function(ag){if(ag.indexof("#")>-1&&ag.indexof(document.location.href)==0){return"inline"}var ah=ag.indexof("?");if(ah>-1){ag=ag.substring(0,ah)}var s,k=ag.match(f);if(k){s=k[0].tolowercase()}if(s){if(q.img&&q.img.ext.indexof(s)>-1){return"img"}if(q.swf&&q.swf.ext.indexof(s)>-1){return"swf"}if(q.flv&&q.flv.ext.indexof(s)>-1){return"flv"}if(q.qt&&q.qt.ext.indexof(s)>-1){if(q.wmp&&q.wmp.ext.indexof(s)>-1){return"qtwmp"}else{return"qt"}}if(q.wmp&&q.wmp.ext.indexof(s)>-1){return"wmp"}}return"iframe"};function g(){var ah=q.errorinfo,ai=q.plugins,ak,al,ao,ag,an,s,am,k;for(var aj=0;aj'+s(q.lang.errors[an],s)+""}else{al=true}}else{if(ak.player=="inline"){ag=ab.exec(ak.content);if(ag){am=ad(ag[1]);if(am){ak.content=am.innerhtml}else{al=true}}else{al=true}}else{if(ak.player=="swf"||ak.player=="flv"){k=(ak.options&&ak.options.flashversion)||q.options.flashversion;if(q.flash&&!q.flash.hasflashplayerversion(k)){ak.width=310;ak.height=177}}}}if(al){q.gallery.splice(aj,1);if(aj0?aj-1:aj}}--aj}}}function aq(k){if(!q.options.enablekeys){return}(k?f:m)(document,"keydown",an)}function an(ag){if(ag.metakey||ag.shiftkey||ag.altkey||ag.ctrlkey){return}var s=v(ag),k;switch(s){case 81:case 88:case 27:k=q.close;break;case 37:k=q.previous;break;case 39:k=q.next;break;case 32:k=typeof ap=="number"?q.pause:q.play;break}if(k){n(ag);k()}}function c(ak){aq(false);var aj=q.getcurrent();var ag=(aj.player=="inline"?"html":aj.player);if(typeof q[ag]!="function"){throw"unknown player "+ag}if(ak){q.player.remove();q.revertoptions();q.applyoptions(aj.options||{})}q.player=new q[ag](aj,q.playerid);if(q.gallery.length>1){var ah=q.gallery[q.current+1]||q.gallery[0];if(ah.player=="img"){var s=new image();s.src=ah.content}var ai=q.gallery[q.current-1]||q.gallery[q.gallery.length-1];if(ai.player=="img"){var k=new image();k.src=ai.content}}q.skin.onload(ak,w)}function w(){if(!a){return}if(typeof q.player.ready!="undefined"){var k=setinterval(function(){if(a){if(q.player.ready){clearinterval(k);k=null;q.skin.onready(e)}}else{clearinterval(k);k=null}},10)}else{q.skin.onready(e)}}function e(){if(!a){return}q.player.append(q.skin.body,q.dimensions);q.skin.onshow(i)}function i(){if(!a){return}if(q.player.onload){q.player.onload()}q.options.onfinish(q.getcurrent());if(!q.ispaused()){q.play()}aq(true)}if(!array.prototype.indexof){array.prototype.indexof=function(s,ag){var k=this.length>>>0;ag=ag||0;if(ag<0){ag+=k}for(;ag-1;q.plugins={fla:w.indexof("shockwave flash")>-1,qt:w.indexof("quicktime")>-1,wmp:!ai&&w.indexof("windows media")>-1,f4m:ai}}else{var p=function(k){var s;try{s=new activexobject(k)}catch(ag){}return !!s};q.plugins={fla:p("shockwaveflash.shockwaveflash"),qt:p("quicktime.quicktime"),wmp:p("wmplayer.ocx"),f4m:false}}var x=/^(light|shadow)box/i,am="shadowboxcachekey",b=1;q.cache={};q.select=function(s){var ag=[];if(!s){var k;af(document.getelementsbytagname("a"),function(aj,ak){k=ak.getattribute("rel");if(k&&x.test(k)){ag.push(ak)}})}else{var ai=s.length;if(ai){if(typeof s=="string"){if(q.find){ag=q.find(s)}}else{if(ai==2&&typeof s[0]=="string"&&s[1].nodetype){if(q.find){ag=q.find(s[0],s[1])}}else{for(var ah=0;ah+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,aq=0,as=object.prototype.tostring,ak=false,aj=true;[0,0].sort(function(){aj=false;return 0});var ag=function(a1,aw,a4,a5){a4=a4||[];var a7=aw=aw||document;if(aw.nodetype!==1&&aw.nodetype!==9){return[]}if(!a1||typeof a1!=="string"){return a4}var a2=[],ay,a9,bc,ax,a0=true,az=ah(aw),a6=a1;while((ap.exec(""),ay=ap.exec(a6))!==null){a6=ay[3];a2.push(ay[1]);if(ay[2]){ax=ay[3];break}}if(a2.length>1&&al.exec(a1)){if(a2.length===2&&am.relative[a2[0]]){a9=at(a2[0]+a2[1],aw)}else{a9=am.relative[a2[0]]?[aw]:ag(a2.shift(),aw);while(a2.length){a1=a2.shift();if(am.relative[a1]){a1+=a2.shift()}a9=at(a1,a9)}}}else{if(!a5&&a2.length>1&&aw.nodetype===9&&!az&&am.match.id.test(a2[0])&&!am.match.id.test(a2[a2.length-1])){var a8=ag.find(a2.shift(),aw,az);aw=a8.expr?ag.filter(a8.expr,a8.set)[0]:a8.set[0]}if(aw){var a8=a5?{expr:a2.pop(),set:ao(a5)}:ag.find(a2.pop(),a2.length===1&&(a2[0]==="~"||a2[0]==="+")&&aw.parentnode?aw.parentnode:aw,az);a9=a8.expr?ag.filter(a8.expr,a8.set):a8.set;if(a2.length>0){bc=ao(a9)}else{a0=false}while(a2.length){var bb=a2.pop(),ba=bb;if(!am.relative[bb]){bb=""}else{ba=a2.pop()}if(ba==null){ba=aw}am.relative[bb](bc,ba,az)}}else{bc=a2=[]}}if(!bc){bc=a9}if(!bc){throw"syntax error, unrecognized expression: "+(bb||a1)}if(as.call(bc)==="[object array]"){if(!a0){a4.push.apply(a4,bc)}else{if(aw&&aw.nodetype===1){for(var a3=0;bc[a3]!=null;a3++){if(bc[a3]&&(bc[a3]===true||bc[a3].nodetype===1&&an(aw,bc[a3]))){a4.push(a9[a3])}}}else{for(var a3=0;bc[a3]!=null;a3++){if(bc[a3]&&bc[a3].nodetype===1){a4.push(a9[a3])}}}}}else{ao(bc,a4)}if(ax){ag(ax,a7,a4,a5);ag.uniquesort(a4)}return a4};ag.uniquesort=function(ax){if(ar){ak=aj;ax.sort(ar);if(ak){for(var aw=1;aw":function(a2,ax){var a0=typeof ax==="string";if(a0&&!/\w/.test(ax)){ax=ax.tolowercase();for(var ay=0,aw=a2.length;ay=0)){if(!ay){aw.push(a1)}}else{if(ay){ax[a0]=false}}}}return false},id:function(aw){return aw[1].replace(/\\/g,"")},tag:function(ax,aw){return ax[1].tolowercase()},child:function(aw){if(aw[1]==="nth"){var ax=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(aw[2]==="even"&&"2n"||aw[2]==="odd"&&"2n+1"||!/\d/.test(aw[2])&&"0n+"+aw[2]||aw[2]);aw[2]=(ax[1]+(ax[2]||1))-0;aw[3]=ax[3]-0}aw[0]=aq++;return aw},attr:function(a0,ax,ay,aw,a1,a2){var az=a0[1].replace(/\\/g,"");if(!a2&&am.attrmap[az]){a0[1]=am.attrmap[az]}if(a0[2]==="~="){a0[4]=" "+a0[4]+" "}return a0},pseudo:function(a0,ax,ay,aw,a1){if(a0[1]==="not"){if((ap.exec(a0[3])||"").length>1||/^\w/.test(a0[3])){a0[3]=ag(a0[3],null,null,ax)}else{var az=ag.filter(a0[3],ax,ay,true^a1);if(!ay){aw.push.apply(aw,az)}return false}}else{if(am.match.pos.test(a0[0])||am.match.child.test(a0[0])){return true}}return a0},pos:function(aw){aw.unshift(true);return aw}},filters:{enabled:function(aw){return aw.disabled===false&&aw.type!=="hidden"},disabled:function(aw){return aw.disabled===true},checked:function(aw){return aw.checked===true},selected:function(aw){aw.parentnode.selectedindex;return aw.selected===true},parent:function(aw){return !!aw.firstchild},empty:function(aw){return !aw.firstchild},has:function(ay,ax,aw){return !!ag(aw[3],ay).length},header:function(aw){return/h\d/i.test(aw.nodename)},text:function(aw){return"text"===aw.type},radio:function(aw){return"radio"===aw.type},checkbox:function(aw){return"checkbox"===aw.type},file:function(aw){return"file"===aw.type},password:function(aw){return"password"===aw.type},submit:function(aw){return"submit"===aw.type},image:function(aw){return"image"===aw.type},reset:function(aw){return"reset"===aw.type},button:function(aw){return"button"===aw.type||aw.nodename.tolowercase()==="button"},input:function(aw){return/input|select|textarea|button/i.test(aw.nodename)}},setfilters:{first:function(ax,aw){return aw===0},last:function(ay,ax,aw,az){return ax===az.length-1},even:function(ax,aw){return aw%2===0},odd:function(ax,aw){return aw%2===1},lt:function(ay,ax,aw){return axaw[3]-0},nth:function(ay,ax,aw){return aw[3]-0===ax},eq:function(ay,ax,aw){return aw[3]-0===ax}},filter:{pseudo:function(a2,ay,az,a3){var ax=ay[1],a0=am.filters[ax];if(a0){return a0(a2,az,ay,a3)}else{if(ax==="contains"){return(a2.textcontent||a2.innertext||s([a2])||"").indexof(ay[3])>=0}else{if(ax==="not"){var a1=ay[3];for(var az=0,aw=a1.length;az=0)}}},id:function(ax,aw){return ax.nodetype===1&&ax.getattribute("id")===aw},tag:function(ax,aw){return(aw==="*"&&ax.nodetype===1)||ax.nodename.tolowercase()===aw},class:function(ax,aw){return(" "+(ax.classname||ax.getattribute("class"))+" ").indexof(aw)>-1},attr:function(a1,az){var ay=az[1],aw=am.attrhandle[ay]?am.attrhandle[ay](a1):a1[ay]!=null?a1[ay]:a1.getattribute(ay),a2=aw+"",a0=az[2],ax=az[4];return aw==null?a0==="!=":a0==="="?a2===ax:a0==="*="?a2.indexof(ax)>=0:a0==="~="?(" "+a2+" ").indexof(ax)>=0:!ax?a2&&aw!==false:a0==="!="?a2!==ax:a0==="^="?a2.indexof(ax)===0:a0==="$="?a2.substr(a2.length-ax.length)===ax:a0==="|="?a2===ax||a2.substr(0,ax.length+1)===ax+"-":false},pos:function(a0,ax,ay,a1){var aw=ax[2],az=am.setfilters[aw];if(az){return az(a0,ay,ax,a1)}}}};var al=am.match.pos;for(var ai in am.match){am.match[ai]=new regexp(am.match[ai].source+/(?![^\[]*\])(?![^\(]*\))/.source);am.leftmatch[ai]=new regexp(/(^(?:.|\r|\n)*?)/.source+am.match[ai].source)}var ao=function(ax,aw){ax=array.prototype.slice.call(ax,0);if(aw){aw.push.apply(aw,ax);return aw}return ax};try{array.prototype.slice.call(document.documentelement.childnodes,0)}catch(av){ao=function(a0,az){var ax=az||[];if(as.call(a0)==="[object array]"){array.prototype.push.apply(ax,a0)}else{if(typeof a0.length==="number"){for(var ay=0,aw=a0.length;ay";var aw=document.documentelement;aw.insertbefore(ax,aw.firstchild);if(document.getelementbyid(ay)){am.find.id=function(a0,a1,a2){if(typeof a1.getelementbyid!=="undefined"&&!a2){var az=a1.getelementbyid(a0[1]);return az?az.id===a0[1]||typeof az.getattributenode!=="undefined"&&az.getattributenode("id").nodevalue===a0[1]?[az]:k:[]}};am.filter.id=function(a1,az){var a0=typeof a1.getattributenode!=="undefined"&&a1.getattributenode("id");return a1.nodetype===1&&a0&&a0.nodevalue===az}}aw.removechild(ax);aw=ax=null})();(function(){var aw=document.createelement("div");aw.appendchild(document.createcomment(""));if(aw.getelementsbytagname("*").length>0){am.find.tag=function(ax,a1){var a0=a1.getelementsbytagname(ax[1]);if(ax[1]==="*"){var az=[];for(var ay=0;a0[ay];ay++){if(a0[ay].nodetype===1){az.push(a0[ay])}}a0=az}return a0}}aw.innerhtml="";if(aw.firstchild&&typeof aw.firstchild.getattribute!=="undefined"&&aw.firstchild.getattribute("href")!=="#"){am.attrhandle.href=function(ax){return ax.getattribute("href",2)}}aw=null})();if(document.queryselectorall){(function(){var aw=ag,ay=document.createelement("div");ay.innerhtml="

";if(ay.queryselectorall&&ay.queryselectorall(".test").length===0){return}ag=function(a2,a1,az,a0){a1=a1||document;if(!a0&&a1.nodetype===9&&!ah(a1)){try{return ao(a1.queryselectorall(a2),az)}catch(a3){}}return aw(a2,a1,az,a0)};for(var ax in aw){ag[ax]=aw[ax]}ay=null})()}(function(){var aw=document.createelement("div");aw.innerhtml="
";if(!aw.getelementsbyclassname||aw.getelementsbyclassname("e").length===0){return}aw.lastchild.classname="e";if(aw.getelementsbyclassname("e").length===1){return}am.order.splice(1,0,"class");am.find.class=function(ax,ay,az){if(typeof ay.getelementsbyclassname!=="undefined"&&!az){return ay.getelementsbyclassname(ax[1])}};aw=null})();function k(ax,a2,a1,a5,a3,a4){for(var az=0,ay=a5.length;az0){a0=aw;break}}}aw=aw[ax]}a5[az]=a0}}}var an=document.comparedocumentposition?function(ax,aw){return ax.comparedocumentposition(aw)&16}:function(ax,aw){return ax!==aw&&(ax.contains?ax.contains(aw):true)};var ah=function(aw){var ax=(aw?aw.ownerdocument||aw:0).documentelement;return ax?ax.nodename!=="html":false};var at=function(aw,a3){var az=[],a0="",a1,ay=a3.nodetype?[a3]:a3;while((a1=am.match.pseudo.exec(aw))){a0+=a1[0];aw=aw.replace(am.match.pseudo,"")}aw=am.relative[aw]?aw+"*":aw;for(var a2=0,ax=ay.length;a2{1} browser plugin to view this content.',shared:'you must install both the {1} and {3} browser plugins to view this content.',either:'you must install either the {1} or the {3} browser plugin to view this content.'}};var d,at="sb-drag-proxy",e,j,ag;function ax(){e={x:0,y:0,startx:null,starty:null}}function aa(){var k=q.dimensions;ac(j.style,{height:k.innerheight+"px",width:k.innerwidth+"px"})}function o(){ax();var k=["position:absolute","cursor:"+(q.isgecko?"-moz-grab":"move"),"background-color:"+(q.isie?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");q.appendhtml(q.skin.body,'
');j=ad(at);aa();f(j,"mousedown",l)}function b(){if(j){m(j,"mousedown",l);c(j);j=null}ag=null}function l(s){n(s);var k=v(s);e.startx=k[0];e.starty=k[1];ag=ad(q.player.id);f(document,"mousemove",h);f(document,"mouseup",i);if(q.isgecko){j.style.cursor="-moz-grabbing"}}function h(ai){var k=q.player,aj=q.dimensions,ah=v(ai);var ag=ah[0]-e.startx;e.startx+=ag;e.x=math.max(math.min(0,e.x+ag),aj.innerwidth-k.width);var s=ah[1]-e.starty;e.starty+=s;e.y=math.max(math.min(0,e.y+s),aj.innerheight-k.height);ac(ag.style,{left:e.x+"px",top:e.y+"px"})}function i(){m(document,"mousemove",h);m(document,"mouseup",i);if(q.isgecko){j.style.cursor="-moz-grab"}}q.img=function(s,ag){this.obj=s;this.id=ag;this.ready=false;var k=this;d=new image();d.onload=function(){k.height=s.height?parseint(s.height,10):d.height;k.width=s.width?parseint(s.width,10):d.width;k.ready=true;d.onload=null;d=null};d.src=s.content};q.img.ext=["bmp","gif","jpg","jpeg","png"];q.img.prototype={append:function(s,ai){var ag=document.createelement("img");ag.id=this.id;ag.src=this.obj.content;ag.style.position="absolute";var k,ah;if(ai.oversized&&q.options.handleoversize=="resize"){k=ai.innerheight;ah=ai.innerwidth}else{k=this.height;ah=this.width}ag.setattribute("height",k);ag.setattribute("width",ah);s.appendchild(ag)},remove:function(){var k=ad(this.id);if(k){c(k)}b();if(d){d.onload=null;d=null}},onload:function(){var k=q.dimensions;if(k.oversized&&q.options.handleoversize=="drag"){o()}},onwindowresize:function(){var ah=q.dimensions;switch(q.options.handleoversize){case"resize":var k=ad(this.id);k.height=ah.innerheight;k.width=ah.innerwidth;break;case"drag":if(ag){var ag=parseint(q.getstyle(ag,"top")),s=parseint(q.getstyle(ag,"left"));if(ag+this.height=aj){clearinterval(s);s=null;am(ag,an);if(ar){ar()}}else{am(ag,ao+ak((ai-ah)/al)*ap)}},10)}function ab(){aa.style.height=q.getwindowsize("height")+"px";aa.style.width=q.getwindowsize("width")+"px"}function ae(){aa.style.top=document.documentelement.scrolltop+"px";aa.style.left=document.documentelement.scrollleft+"px"}function ay(k){if(k){af(y,function(s,ag){ag[0].style.visibility=ag[1]||""})}else{y=[];af(q.options.troubleelements,function(ag,s){af(document.getelementsbytagname(s),function(ah,ai){y.push([ai,ai.style.visibility]);ai.style.visibility="hidden"})})}}function r(ag,k){var s=ad("sb-nav-"+ag);if(s){s.style.display=k?"":"none"}}function ah(k,aj){var ai=ad("sb-loading"),ag=q.getcurrent().player,ah=(ag=="img"||ag=="html");if(k){q.setopacity(ai,0);ai.style.display="block";var s=function(){q.clearopacity(ai);if(aj){aj()}};if(ah){n(ai,"opacity",1,q.options.fadeduration,s)}else{s()}}else{var s=function(){ai.style.display="none";q.clearopacity(ai);if(aj){aj()}};if(ah){n(ai,"opacity",0,q.options.fadeduration,s)}else{s()}}}function t(ao){var aj=q.getcurrent();ad("sb-title-inner").innerhtml=aj.title||"";var ap,al,s,aq,am;if(q.options.displaynav){ap=true;var an=q.gallery.length;if(an>1){if(q.options.continuous){al=am=true}else{al=(an-1)>q.current;am=q.current>0}}if(q.options.slideshowdelay>0&&q.hasnext()){aq=!q.ispaused();s=!aq}}else{ap=al=s=aq=am=false}r("close",ap);r("next",al);r("play",s);r("pause",aq);r("previous",am);var k="";if(q.options.displaycounter&&q.gallery.length>1){var an=q.gallery.length;if(q.options.countertype=="skip"){var ai=0,ah=an,ag=parseint(q.options.counterlimit)||0;if(ag2){var ak=math.floor(ag/2);ai=q.current-ak;if(ai<0){ai+=an}ah=q.current+(ag-ak);if(ah>an){ah-=an}}while(ai!=ah){if(ai==an){ai=0}k+='"}}else{k=[q.current+1,q.lang.of,an].join(" ")}}ad("sb-counter").innerhtml=k;ao()}function u(ah){var k=ad("sb-title-inner"),ag=ad("sb-info-inner"),s=0.35;k.style.visibility=ag.style.visibility="";if(k.innerhtml!=""){n(k,"margintop",0,s)}n(ag,"margintop",0,s,ah)}function av(ag,am){var ak=ad("sb-title"),k=ad("sb-info"),ah=ak.offsetheight,ai=k.offsetheight,aj=ad("sb-title-inner"),al=ad("sb-info-inner"),s=(ag?0.35:0);n(aj,"margintop",ah,s);n(al,"margintop",ai*-1,s,function(){aj.style.visibility=al.style.visibility="hidden";am()})}function ac(k,ah,s,aj){var ai=ad("sb-wrapper-inner"),ag=(s?q.options.resizeduration:0);n(z,"top",ah,ag);n(ai,"height",k,ag,aj)}function ar(k,ah,s,ai){var ag=(s?q.options.resizeduration:0);n(z,"left",ah,ag);n(z,"width",k,ag,ai)}function ak(am,ag){var ai=ad("sb-body-inner"),am=parseint(am),ag=parseint(ag),s=z.offsetheight-ai.offsetheight,k=z.offsetwidth-ai.offsetwidth,ak=ae.offsetheight,al=ae.offsetwidth,aj=parseint(q.options.viewportpadding)||20,ah=(q.player&&q.options.handleoversize!="drag");return q.setdimensions(am,ag,ak,al,s,k,aj,ah)}var t={};t.markup='';t.options={animsequence:"sync",counterlimit:10,countertype:"default",displaycounter:true,displaynav:true,fadeduration:0.35,initialheight:160,initialwidth:320,modal:false,overlaycolor:"#000",overlayopacity:0.5,resizeduration:0.35,showoverlay:true,troubleelements:["select","object","embed","canvas"]};t.init=function(){q.appendhtml(document.body,s(t.markup,q.lang));t.body=ad("sb-body-inner");aa=ad("sb-container");ae=ad("sb-overlay");z=ad("sb-wrapper");if(!x){aa.style.position="absolute"}if(!h){var ag,k,s=/url\("(.*\.png)"\)/;af(q,function(ai,aj){ag=ad(aj);if(ag){k=q.getstyle(ag,"backgroundimage").match(s);if(k){ag.style.backgroundimage="none";ag.style.filter="progid:dximagetransform.microsoft.alphaimageloader(enabled=true,src="+k[1]+",sizingmethod=scale);"}}})}var ah;f(au,"resize",function(){if(ah){cleartimeout(ah);ah=null}if(a){ah=settimeout(t.onwindowresize,10)}})};t.onopen=function(k,ag){m=false;aa.style.display="block";ab();var s=ak(q.options.initialheight,q.options.initialwidth);ac(s.innerheight,s.top);ar(s.width,s.left);if(q.options.showoverlay){ae.style.backgroundcolor=q.options.overlaycolor;q.setopacity(ae,0);if(!q.options.modal){f(ae,"click",q.close)}ao=true}if(!x){ae();f(au,"scroll",ae)}ay();aa.style.visibility="visible";if(ao){n(ae,"opacity",q.options.overlayopacity,q.options.fadeduration,ag)}else{ag()}};t.onload=function(s,k){ah(true);while(t.body.firstchild){c(t.body.firstchild)}av(s,function(){if(!a){return}if(!s){z.style.visibility="visible"}t(k)})};t.onready=function(ah){if(!a){return}var s=q.player,ag=ak(s.height,s.width);var k=function(){u(ah)};switch(q.options.animsequence){case"hw":ac(ag.innerheight,ag.top,true,function(){ar(ag.width,ag.left,true,k)});break;case"wh":ar(ag.width,ag.left,true,function(){ac(ag.innerheight,ag.top,true,k)});break;default:ar(ag.width,ag.left,true);ac(ag.innerheight,ag.top,true,k)}};t.onshow=function(k){ah(false,k);m=true};t.onclose=function(){if(!x){m(au,"scroll",ae)}m(ae,"click",q.close);z.style.visibility="hidden";var k=function(){aa.style.visibility="hidden";aa.style.display="none";ay(true)};if(ao){n(ae,"opacity",0,q.options.fadeduration,k)}else{k()}};t.onplay=function(){r("play",false);r("pause",true)};t.onpause=function(){r("pause",false);r("play",true)};t.onwindowresize=function(){if(!m){return}ab();var k=q.player,s=ak(k.height,k.width);ar(s.width,s.left);ac(s.innerheight,s.top);if(k.onwindowresize){k.onwindowresize()}};q.skin=t;au.shadowbox=q})(window);