/* Minimit Gallery Plugin 2.06 http://www.minimit.com */function Mg(a){this.events=[];this.setSettings(a)} Mg.prototype.setSettings=function(a){for(var c in a)if("object"==typeof a[c]&&!a[c].length){if(void 0==this[c]){var b=this[c]={};this.events.push(c);b.obj=this;b.evnt=c;a.reference&&(b.reference=a.reference);b.inverse=!1;b.anchorize=!1;b.linkedMultiply=b.prevSteps=b.nextSteps=1;b.multiMode="centered";b.multiLimit=!0;b.fixedLess=b.fixedPlus=0;b.scrollIsVertical=b.dragIsVertical=b.scrollInvert=b.dragInvert=b.scrollFraction=b.dragFraction=b.scrollWheel=b.dragWheel=!1;b.scrollFriction=0;b.dragFriction= 0.85;b.scrollPower=b.dragPower=0.6;b.scrollFurther=0;b.dragFurther=0.2;b.scrollCursorOff="url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur), pointer";b.scrollCursorOn="url(http://www.google.com/intl/en_ALL/mapfiles/closedhand.cur), pointer";b.dragCursorOff="url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur), move";b.dragCursorOn="url(http://www.google.com/intl/en_ALL/mapfiles/closedhand.cur), move";b.rounding="round"}var b=this[c],e;for(e in a[c])b[e]=a[c][e];void 0==b.cycle&& (b.cycle=!1);void 0==b.activated&&(b.activated=[]);1>b.activated.length&&b.activated.push(null);b.initNum=b.activated.slice();"onhashchange"in window&&(this.registerEvent(b,window.mg_AnchorEvntsArr,"useAnchor"),this.registerEvent(b,window.mg_HashEvntsArr,"useLinkHash"));window.history&&history.pushState&&this.registerEvent(b,window.mg_UrlEvntsArr,"useLinkUrl")}else this[c]=a[c];this.refreshItems();this.initScrollDrag()}; Mg.prototype.refreshItems=function(){this.items=this.getElementsById(this.reference+"-item-");0a&&(d.multiLess=Math.floor(a/2),d.multiPlus=Math.ceil(a/2));if("useLinkHash"==d.anchorize||"useLinkUrl"==d.anchorize)c=!0}if(c){this.itemsLink=[];b=0;for(e=this.items.length;b=this[c].maxActivated||!this[c].maxActivated)e=parseFloat(b.splice(b.length-1,1));b.unshift(a)}return e}; Mg.prototype.initEvents=function(){for(var a=0,c=this.events.length;ac?(a.prevIsShown=!1,void 0!=a.prevHide&&a.prevHide()):a.prevIsShown||(a.prevIsShown=!0,void 0!=a.prevShow&&a.prevShow());c=a.num+a.nextSteps;a.lastToSteps?c>this.totalItems-a.multiLess-a.multiPlus-1?(a.nextIsShown=!1,void 0!=a.nextHide&&a.nextHide()):a.nextIsShown|| (a.nextIsShown=!0,void 0!=a.nextShow&&a.nextShow()):c>this.totalItems-1?(a.nextIsShown=!1,void 0!=a.nextHide&&a.nextHide()):a.nextIsShown||(a.nextIsShown=!0,void 0!=a.nextShow&&a.nextShow())};Mg.prototype.prev=function(a,c,b,e){var d=this[a],f=this.totalItems,g=0;"centered"==d.multiMode&&!0==d.cycle||(d.lastToSteps&&(f+=d.multiPlus),d.firstToSteps&&(g=-d.multiLess));var h=d.num-d.prevSteps;hf-1&&(h=(d.cycle||e)&&d.num==f-1?g:f-1);void 0!=d.nextClick&&!e&&d.nextClick();this.setState(h,a,c,!0,!0,b,"next")};Mg.prototype.first=function(a){var c=this[a];void 0!=c.firstClick&&c.firstClick();this.setState(0,a,!0,!0,!0,!0,"first")}; Mg.prototype.last=function(a){var c=this[a];void 0!=c.lastClick&&c.lastClick();this.setState(this.totalItems-1,a,!0,!0,"last")};Mg.prototype.autoStart=function(a){var c=this;clearInterval(this[a+"Interval"]);this[a+"Interval"]=this[a].autoInverse?setInterval(function(){c.prev(a,!0,!1,!0)},this[a].auto):setInterval(function(){c.next(a,!0,!1,!0)},this[a].auto)}; Mg.prototype.autoSlow=function(a){var c=this;clearInterval(this[a+"Interval"]);void 0!=this[a].autoSlow&&(this[a+"Interval"]=this[a].autoInverse?setInterval(function(){c.prev(a,!0,!1,!0);c.autoStart(a)},this[a].autoSlow):setInterval(function(){c.next(a,!0,!1,!0);c.autoStart(a)},this[a].autoSlow))};Mg.prototype.autoStop=function(a){clearInterval(this[a+"Interval"])}; Mg.prototype.setMutiple=function(a,c){var b=this[a],e=b.num,d=b.oldNum;if(null!=e||"init"==c){b.multiBeforeIn=[];b.multiBeforeOut=[];b.multiAfterIn=[];b.multiAfterOut=[];b.direction=null;if("centered"==b.multiMode)var f="mapNumCentered",g="nearest",h="normal";else"fixed"==b.multiMode?(f="mapNumFixed",h=g="serie"):"flexible"==b.multiMode&&(f="mapNumFixed",g="normal",h="serie",b.fixedLess=b.multiLess,b.fixedPlus=b.multiPlus);b.multiOldActivated=b.multiActivated;b.multiActivated=this[f](e,b.multiLess, b.multiPlus,this.totalItems,b.cycle,b.fixedLess,b.fixedPlus,b.firstToSteps,b.lastToSteps);if("init"!=c&&b.multiActivated[0]!=b.multiOldActivated[0]){if("normal"==g)var j=this.findNormalDistance(e,d);else"nearest"==g?j=this.findNearestDistance(e,d,this.totalItems,b.cycle):"serie"==g&&(j=this.findNormalDistance(e,d));if("normal"==h)var k=j;else"serie"==h&&(f=b.fixedLess,g=this.totalItems-1-b.fixedPlus,k=b.multiLess+b.multiPlus+1-b.fixedPlus-b.fixedLess,e<=f&&d>=g||d<=f&&e>=g?k=this.totalItems-b.multiActivated.length: 1a+c&&d?f.push(e-(-a-c)):a+c>=e&&d?f.push(a+c-e):f.push(a+c):f.push(null);return f};Mg.prototype.mapNumFixed=function(a,c,b,e,d,f,g,h,j){d=[];c=c+b+1;var k=Math.floor((a-f)/(c-g-f));b=k*(c-g-f);var l=e-b-f;a=l&&!j&&(b=(k-g-1+l)*(c-g-f));for(a=0;ab/2?b-c-1:b/2};Mg.prototype.findNormalDistance=function(a,c){return a-c};Mg.prototype.findNearestDistance=function(a,c,b,e){var d=b/2;return!e||a-c-d?a-c:a-c>d?c>a?-a-(b-c):-c-(b-a):a-c<-d?c>a?a+(b-c):c+(b-a):0};var mg_startingTitle=document.title; "onhashchange"in window&&(window.mg_AnchorEvntsArr=[],window.mg_HashEvntsArr=[],window.onhashchange=function(){for(var a=0,c=window.mg_HashEvntsArr.length;aMath.abs(e)&&a.preventDefault&&a.preventDefault()}function k(a){a||(a=window.event);void 0==a.clientX&&(a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);var b=document.t,c=b.evnt,e=b.mg,d=b.min,f=b.max,g=b.num;document.onmousemove=null;document.onmouseup=null;document.ontouchmove=null;document.ontouchend=null;b.style.cursor=e[c][b.scrollDragStr+"CursorOff"];if(b.clicked){if(b.vertical)h=a.clientY-b.startPosY, j=a.clientX-b.startPosX;else var h=a.clientX-b.startPosX,j=a.clientY-b.startPosY;if(25=d&&g<=f&&(a=!0):500>k&&Math.abs(h)Math.abs(j)?(d=Math.abs(f-d)/e.totalItems,g=0>h?g-d:g+d):g<=-d&&g>=-f&&(a=!0);a&&!e[c].disableFriction?l(b,b.friction,g):(e.scMove(b,g,!0),e.scReleaseFraction(b),e.scRelease(b,g))}else b.onclick=function(){},e.scReleaseFraction(b),e.scRelease(b,g);e[c]["clickedInterval"+b.scrollDragStr]= setTimeout(function(){b.clicked=!1},113)}}function l(a,b,c){var e=a.evnt,d=a.mg;a.count*=b;var f=a.count;c+=f;a.num=c;!b||-1f?(d.scReleaseFraction(a),d.scRelease(a,c)):(d.scMove(a,c),c=d.scCheckLimits(c,a.isScroll,0,a.min,a.max),d[e]["frictionInterval"+a.scrollDragStr]=setTimeout(function(){l(a,b,c)},13))}c.onmousedown=c.ontouchstart=function(a){a||(a=window.event);void 0==a&&(a={clientX:this.startPosX,clientY:this.startPosY});void 0==a.clientX&&(a.clientX=a.touches[0].clientX,a.clientY=a.touches[0].clientY); var b=this.mg,d=this.evnt,e=this.scrollDragStr;document.t=this;document.onmousemove=j;document.onmouseup=k;document.ontouchmove=j;document.ontouchend=k;this.style.cursor=b[d][e+"CursorOn"];this.time=+new Date;this.count=0;this.startPosY=a.clientY;this.startPosX=a.clientX;a=this.mg.getTransform(this);this.vertical?(this.offsetPos=a?a.top:this.offsetTop,c.swipeDist=this.itemOut.offsetHeight/this.concurrent):(this.offsetPos=a?a.left:this.offsetLeft,c.swipeDist=this.itemOut.offsetWidth/this.concurrent); this.startnum=this.num=this.offsetPos;this.clicked=!0;clearTimeout(b[d]["clickedInterval"+e]);clearTimeout(b[d]["frictionInterval"+e]);b.scClick(this)};c.onmouseup=c.ontouchend=k;c.evnt=a;c.mg=this;c.itemOut=b;c.itemIn=c;c.vertical=f;c.scrollDragStr=g;c.wheelnum=0;c.concurrent=h;c.friction=this[a][g+"Friction"];c.power=this[a][g+"Power"];c.further=this[a][g+"Further"];c.style.cursor=c.mg[a][g+"CursorOff"];if("scroll"!=g)b.isScroll=c.isScroll=!1,this[a][g+"Wheel"]&&this.addWheel(c,this.scWheel);else{b.isScroll= c.isScroll=!0;var m=function(a){return(a=a.getBoundingClientRect())?{top:a.top,left:a.left}:{top:0,left:0}};b.onmousedown=b.ontouchstart=function(a){a||(a=window.event);void 0==a.clientX&&(a.clientX=a.touches[0].clientX,a.clientY=a.touches[0].clientY);if(this==this&&!this.itemIn.clicked){var b=this.vertical?a.clientY-m(this).top-this.itemIn.offsetHeight/2:a.clientX-m(this).left-this.itemIn.offsetWidth/2;this.itemIn.startPosX=a.clientX;this.itemIn.startPosY=a.clientY;b=this.mg.scCheckLimits(b,this.isScroll, 0,this.min,this.max);this.mg.scReleaseSet(this,b);if("touchstart"==a.type)this.itemIn.ontouchstart();else this.itemIn.onmousedown();this.itemIn.offsetPos=b}return!1};b.evnt=a;b.mg=this;b.itemIn=c;b.itemOut=b;b.vertical=f;b.scrollDragStr=g;b.wheelnum=0;this[a][g+"Wheel"]&&this.addWheel(b,this.scWheel)}};Mg.prototype.scClick=function(a){var c=a.evnt;a=a.scrollDragStr;if(void 0!=this[c][a+"Click"])this[c][a+"Click"]()}; Mg.prototype.scMove=function(a,c,b,e){var d=a.evnt,f=a.scrollDragStr,g=a.isScroll,h=a.min,j=a.max,k=this[d][f+"Fraction"],l=this[d].rounding;this[d][f+"Dragged"]=a.startnum-c;this[d][f+"Position"]=c;if(!e){g||(j=-j,h=-h);var m=(this.totalItems-1)*((this[d][f+"Invert"]?j-c-h:c-h)/(j-h));c=Math[l](m)}if(c!=this[d].num||k)0<=c&&c<=this.totalItems-1?(a=k?"fraction":f,this[d].fraction=this.calculateFraction(m,l),this.setState(c,d,!0,!g,g,!0,a)):this[d].cycle&&(c=0>c?this.totalItems+c:c-this.totalItems, this.setState(c,d,!0,!g,g,!0,f));if(!b&&void 0!=this[d][f+"Move"])this[d][f+"Move"]()};Mg.prototype.scReleaseSet=function(a,c){var b=a.evnt,e=a.scrollDragStr,d=a.min,f=a.max,g=this[b].rounding;this[b][e+"Invert"]&&(c=f-c);d=Math[g]((this.totalItems-1)*(c/(f-d)));this.setState(d,b,!0,!1,!0,!0,e);this.scRelease(a,c)}; Mg.prototype.scRelease=function(a,c){var b=a.evnt,e=a.itemIn,d=a.itemOut,f=a.scrollDragStr,g=a.isScroll,h=a.min,j=a.max,k=this.totalItems-1;void 0!=c&&(e.wheelnum=d.wheelnum=c,this[b][f+"Dragged"]=a.startnum-c);g||(j=-j,h=-h);e=this[b].activated*((j-h)/k);this[b][f+"Position"]=this[b][f+"Invert"]?j-e:h+e;if(void 0!=c){if(void 0!=this[b][f+"Release"])this[b][f+"Release"]()}else if(void 0!=this[b][f+"Move"])this[b][f+"Move"]()}; Mg.prototype.scReleaseFraction=function(a){var c=a.evnt,b=a.scrollDragStr;this[c][b+"Fraction"]&&this.setState(this[c].activated,c,!0,!a.isScroll,a.isScroll,!0,b)};Mg.prototype.scCheckLimits=function(a,c,b,e,d){c?ad&&(a=d+(a-d)*b):a>-e?a=-e+(a+e)*b:a<-d&&(a=-d+(a+d)*b);return a};Mg.prototype.scGetMin=function(a,c,b,e,d){this[a].firstToSteps||(d=1);return e?-c.offsetHeight*(d-1)/d:-c.offsetWidth*(d-1)/d}; Mg.prototype.scGetMax=function(a,c,b,e,d){this[a].lastToSteps||(d=1);return e?b.offsetHeight-c.offsetHeight/d:b.offsetWidth-c.offsetWidth/d};Mg.prototype.addWheel=function(a,c){var b=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";"undefined"==typeof a.attachEvent&&a.addEventListener(b,c,!1)}; Mg.prototype.scWheel=function(a){var c=this.mg,b=0;a.wheelDelta?b=a.wheelDelta/120:a.detail&&(b=-a.detail/3);b=this.wheelnum-b;0<=b&&b<=c.totalItems-1&&(c.scMove(this,b,!0,!0),c.scReleaseFraction(this),c.scRelease(this,c[this.evnt].activated),a.preventDefault&&a.preventDefault())};Mg.prototype.calculateFraction=function(a,c){var b=a%1;"round"==c?(b-=0.5,0>b&&(b+=1)):"ceil"==c&&(b+=1,1