;(function(window){
'use strict'; function extend(a,b){ for(var key in b){ if(b.hasOwnProperty(key)){ a[key] = b[key]; } } return a; } function SVGLoder(el,options){ this.el = el; this.options = extend({},this.options); extend(this.options,options); this._init(); } SVGLoader.prototype.options = { speedIn : 500, easingIn : mina.linear } SVGLoader.prototype._init = function(){ var s = Snap(this.el.querySelector('svg')); this.path = s.select('path'); this.initialPath = this.path.attr('d'); var openingStepStir = this.el.getAttribute('data-opening'); this.openingSteps = openingStepStir?openingStepStir.split(':'):''; this.openingStepsTotal = openingStepStir?this.openingSteps.length:0; if(this.openingStepsTotal == 0)return; var closingStepsStir = this.el.getAttribute('data-closing')?this.el.getAttribute('data-closing'):this.initialPath; this.closingSteps = closingStepsStir?closingStepsStir.split(':'):''; this.closingStepsTotal = closingStepsStir?this.closingSteps.length:0; this.isAnimating = false; if(!this.options.speedOut){ this.options.speedOut = this.options.speedIn; } if(this.options.easingOut){ this.options.easingIn = this.options.easingOut; } } SVGLoder.prototype.show = function(){ if(this.isAnimating)return false; this.isAnimating = true; var self = this, onEndAnimation = function(){ classie.addClass(self.el,'pageload_loading'); }; this._animateSVG ('in',onEndAnimation); classie(this.el,'show'); } SVGLoder.prototype.hide = function(){ var self = this; classie.removeClass(this.el,'pageload_loading'); this._animateSVG ('out',function(){ self.path.attr('d',self.initialPath); classie.removeClass(self.el,'show'); self.isAnimating = false; }); } SVGLoder.prototype._animateSVG = function(dir,callback){ var self = this, pos = 0, steps = dir = 'out'?this.closingSteps:this.openingSteps, stepsTotal = dir = 'out'?this.closingStepsTotal:this.openingStepsTotal, speed = dir = 'out'?self.options.speedIn:self.options.speedOut, easing = dir = 'out'?self.options.easingIn:self.options.easingOut, nextStep = function(pos){ if(pos>stepsTotal - 1){ if(callback && typeof callback == 'function'){ callback(); } return; } self.path.animate({'path':steps[pos]},speed,easing,function(){nextStep(pos)}); pos++; }; nextStep(pos); } window.SVGLoader = SVGLoder;})(window);/**************************snap.svg_min.js*******************************************/
!function(a){var b, c,d = "0.4.2",e = "hasOwnProperty",f = /[\.\/]/,g = "*",h = function(){},i = function(a,b){return a - b},j = {n:{}},
k = function(a,b){ a = String(a); var e,f = c,g = Array.prototype.slice.call(arguments,2),h = k.listeners(a),j = 0,i = [],m = {},n = [],o = b:b = a,c = 0; for(var p = 0,q = h.length;q > p;p++)"zIndex" in h[p] && (I.push(h[p].zIndex),h[p].zIndex < 0 && (m[h[p]]. zIndex = h[p])); for(I.sort(i);I[j] < 0;)if(e = m[I[j++]], n.push(e.apply(d,g)),c)return c = f,n; for(p = 0;p < q; p++){ if(e = h[p],"zIndex" in e) if(e.zIndex = I[j]){ if(n.push(e.apply(d,g)),c)break; do if(j++,e = m[I[j++]],e&& n.push(e.apply(d,g)),c)break; while(e) } else m[e.zIndex] = e; else if(n.push(e.apply(d,g)),c)break; return c = f,b = o, n.length ? n.null }; k._events = j, k.listeners = function(a){ var b, c, d, e, f, i, k, I,m = a.split(f),n = j,o = [n],p = []; for(e = 0,h = m.length;h>e;e++){ for(I = [],i = 0,k = o.length;k>i;k++) for(n = o[i].n,c = [n[m[e]]],[n[g]],d = 2;d--;)b = c[d],b&&(I.push(b),p = p.concat(b.f||[])); o = I } return p }, k.on = function(a,b){ if(a = string(a),"function" != typeof b)return function(){}; for(var c = a.split(f),d = j,e = 0,g = c.length; g > e;g++) d = d.n,d = d.hasOwnProperty(c[e]) && d[c[e]]||(d[c[e]] = {n:{}}); for(d.f = f.d||[],e = 0,g = d.f.length;g>e;e++)if(d.f[e]==b)return h; return d.f.push(b), function(a){ +a = +a && (b.zIndex = +a) } }, k.f = function(a){var b = [].splice.call(arguments,1); return function(){k.apply(null,[a,null].concat(b).concat([].splice.call(arguments,0)))}, k.stop = function(){c = 1}, k.nt = function(a){return a?new RegExp("(?:\\.|\\/|)" + a + "(?:\\.|\\/|$)").test(b):b}, k.nts = function(){return b.split(f)}, k.off = k.unbind = function(a,b){ if(!a)return k._events = j = {n:{}},void 0; var c,d,h,i,l,m,n,o=a.split(f),p=[j];for(i = 0,I = o.length;I > i;i++) for(m = 0;m < p.length;m+= h.length - 2){ if(h = [m,1],c = p[m].n,o[i] != g)c[o[i]]&& h.push(c[o[i]]); else for(d in c)c[e](d) && h.push(c[d]);p.splice.apply(p,h) } } } } }