/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderradius-boxshadow-flexbox-opacity-rgba-textshadow-cssanimations-generatedcontent-csstransforms-csstransitions-canvas-canvastext-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-ie8compat
*/
;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b)&&c(b).matches||!1;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.backgroundsize=function(){return J("backgroundSize")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csstransforms=function(){return!!J("transform")},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var K in s)C(s,K)&&(x=K.toLowerCase(),e[x]=s[K](),v.push((e[x]?"":"no-")+x));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),Modernizr.addTest("ie8compat",function(){return!window.addEventListener&&document.documentMode&&document.documentMode===7});
var pathUrl = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname;
var pathName = window.location.pathname;
var pathArray = pathName.split('/');
var section = pathArray[1]||'main';
var page = (pathArray[2]) ? pathArray[2].replace(/\.html$/, '') : 'index';
var strona_glowna = (section=='main' && page=='index' || pathName=='/');
var input_active_color = 'windowtext';
var input_inactive_color = '#008347';
/* if ( bw.active == true ) {
var input_active_color = 'white';
var input_inactive_color = 'yellow';
} */
if ( window.location.host.substr(0,3) == 'nd.' ) {
var bw = {'active': true, 'href': pathUrl.replace(/nd\./i,'www.')};
} else {
var bw = {'active': false, 'href': pathUrl.replace(/www\./i,'nd.')};
}
if ( typeof(gaid) !== 'undefined' && gaid != '' ) {
var _gaq = _gaq || [];_gaq.push(['_setAccount', gaid]);_gaq.push(['_trackPageview']);(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();
}
var wypelnij_wymagane = "Wypełnij pola wymagane";
var bledny_email = "Podany adres e-mail jest nieprawidłowy.";
function checkForm(pola) {
for (i=0;i2)
blad = true;
}
if (pole.value!='' && (blad || isNaN(pole.value))) {
alert('Niewłaściwy format kwoty!');
pole.select();
pole.focus();
}
}
function checkDate(pole) {
var data=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
if (pole.value!='' && pole.value.match(data)==null) {
alert("Niewłaściwy format daty!\n\n* poprawny format: YYYY-mm-dd");
pole.select();
pole.focus();
return false;
}
else
return true;
}
function checkDateTime(pole) {
var data_czas=/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$/;
if (pole.value!='' && pole.value.match(data_czas)==null) {
alert("Niewłaściwy format daty i czasu!\n\n* poprawny format: YYYY-mm-dd HH:ii:ss");
pole.select();
pole.focus();
return false;
}
else
return true;
}
function checkTime(pole) {
var czas=/^[0-9]{2}:[0-9]{2}$/;
if (pole.value.length==2)
pole.value += ':00';
if (pole.value!='' && pole.value.match(czas)==null) {
alert("Niewłaściwy format godziny!\n\n* poprawny format: HH:mm");
pole.select();
pole.focus();
return false;
}
else
return true;
}
/*
---
MooTools: the javascript framework
web build:
- http://mootools.net/core/76bf47062d6c1983d66ce47ad66aa0e0
packager build:
- packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff
copyrights:
- [MooTools](http://mootools.net)
licenses:
- [MIT License](http://mootools.net/license.txt)
...
*/
(function(){this.MooTools={version:"1.4.5",build:"ab8ea8824dc3b24b6666867a2c4ed58ebb762cf0"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family!=null){return i.$family();
}if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments";
}if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor;
while(s){if(s===i){return true;}s=s.parent;}if(!t.hasOwnProperty){return false;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null;
}if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];}f.prototype.overloadSetter=function(s){var i=this;
return function(u,t){if(u==null){return this;}if(s||typeof u!="string"){for(var v in u){i.call(this,v,u[v]);}if(p){for(var w=p.length;w--;){v=p[w];if(u.hasOwnProperty(v)){i.call(this,v,u[v]);
}}}}else{i.call(this,u,t);}return this;};};f.prototype.overloadGetter=function(s){var i=this;return function(u){var v,t;if(typeof u!="string"){v=u;}else{if(arguments.length>1){v=arguments;
}else{if(s){v=[u];}}}if(v){t={};for(var w=0;w>>0;
b>>0;b>>0;for(var a=(d<0)?Math.max(0,b+d):d||0;a>>0,b=Array(d);for(var a=0;a>>0;
b-1:String(this).indexOf(a)>-1;},trim:function(){return String(this).replace(/^\s+|\s+$/g,"");
},clean:function(){return String(this).replace(/\s+/g," ").trim();},camelCase:function(){return String(this).replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();
});},hyphenate:function(){return String(this).replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());});},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(a){return a.toUpperCase();
});},escapeRegExp:function(){return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);
},hexToRgb:function(b){var a=String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=String(this).match(/\d{1,3}/g);
return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return String(this).replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);
}return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0);
return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a1?Array.slice(arguments,1):null,d=function(){};var c=function(){var g=e,h=arguments.length;if(this instanceof c){d.prototype=a.prototype;
g=new d;}var f=(!b&&!h)?a.call(g):a.apply(g,b&&h?b.concat(Array.slice(arguments)):b||arguments);return g==e?f:g;};return c;},pass:function(b,c){var a=this;
if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b);
},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={};
for(var e=0,b=g.length;e]*>([\s\S]*?)/gi,function(q,r){e+=r+"\n";
return"";});if(o===true){n.exec(e);}else{if(typeOf(o)=="function"){o(e,p);}}return p;});n.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event});
this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,o){g[e]=o;});this.Document=j.$constructor=new Type("Document",function(){});
j.$family=Function.from("document").hide();Document.mirror(function(e,o){j[e]=o;});j.html=j.documentElement;if(!j.head){j.head=j.getElementsByTagName("head")[0];
}if(j.execCommand){try{j.execCommand("BackgroundImageCache",false,true);}catch(f){}}if(this.attachEvent&&!this.addEventListener){var c=function(){this.detachEvent("onunload",c);
j.head=j.html=j.window=null;};this.attachEvent("onunload",c);}var l=Array.from;try{l(j.html.childNodes);}catch(f){Array.from=function(o){if(typeof o!="string"&&Type.isEnumerable(o)&&typeOf(o)!="array"){var e=o.length,p=new Array(e);
while(e--){p[e]=o[e];}return p;}return l(o);};var k=Array.prototype,m=k.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var o=k[e];
Array[e]=function(p){return o.apply(Array.from(p),m.call(arguments,1));};});}})();(function(){var b={};var a=this.DOMEvent=new Type("DOMEvent",function(c,g){if(!g){g=window;
}c=c||g.event;if(c.$extended){return c;}this.event=c;this.$extended=true;this.shift=c.shiftKey;this.control=c.ctrlKey;this.alt=c.altKey;this.meta=c.metaKey;
var i=this.type=c.type;var h=c.target||c.srcElement;while(h&&h.nodeType==3){h=h.parentNode;}this.target=document.id(h);if(i.indexOf("key")==0){var d=this.code=(c.which||c.keyCode);
this.key=b[d];if(i=="keydown"){if(d>111&&d<124){this.key="f"+(d-111);}else{if(d>95&&d<106){this.key=d-96;}}}if(this.key==null){this.key=String.fromCharCode(d).toLowerCase();
}}else{if(i=="click"||i=="dblclick"||i=="contextmenu"||i=="DOMMouseScroll"||i.indexOf("mouse")==0){var j=g.document;j=(!j.compatMode||j.compatMode=="CSS1Compat")?j.html:j.body;
this.page={x:(c.pageX!=null)?c.pageX:c.clientX+j.scrollLeft,y:(c.pageY!=null)?c.pageY:c.clientY+j.scrollTop};this.client={x:(c.pageX!=null)?c.pageX-g.pageXOffset:c.clientX,y:(c.pageY!=null)?c.pageY-g.pageYOffset:c.clientY};
if(i=="DOMMouseScroll"||i=="mousewheel"){this.wheel=(c.wheelDelta)?c.wheelDelta/120:-(c.detail||0)/3;}this.rightClick=(c.which==3||c.button==2);if(i=="mouseover"||i=="mouseout"){var k=c.relatedTarget||c[(i=="mouseover"?"from":"to")+"Element"];
while(k&&k.nodeType==3){k=k.parentNode;}this.relatedTarget=document.id(k);}}else{if(i.indexOf("touch")==0||i.indexOf("gesture")==0){this.rotation=c.rotation;
this.scale=c.scale;this.targetTouches=c.targetTouches;this.changedTouches=c.changedTouches;var f=this.touches=c.touches;if(f&&f[0]){var e=f[0];this.page={x:e.pageX,y:e.pageY};
this.client={x:e.clientX,y:e.clientY};}}}}if(!this.client){this.client={};}if(!this.page){this.page={};}});a.implement({stop:function(){return this.preventDefault().stopPropagation();
},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();
}else{this.event.returnValue=false;}return this;}});a.defineKey=function(d,c){b[d]=c;return this;};a.defineKeys=a.defineKey.overloadSetter(true);a.defineKeys({"38":"up","40":"down","37":"left","39":"right","27":"esc","32":"space","8":"backspace","9":"tab","46":"delete","13":"enter"});
})();(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h};}var g=function(){e(this);if(g.$prototyping){return this;
}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null;return i;}.extend(this).implement(h);
g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.');
}var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments);
};var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone();
break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.');
}var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h});
return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this;
}this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping;
return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j;
for(var i in h){f.call(this,i,h[i],true);}},this);}};})();(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments));
return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty();
return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d);
this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this;
},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c);
}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this;
},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue;
}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments));
if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});})();
(function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p;
var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length;
return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o;
}}}};var h=function(u){var r=u.expressions;for(var p=0;p+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;")+"]").replace(//g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])"));
function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n];
if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,"");
}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")});
}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"});
}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)");
break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break;
case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I);
};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o);
};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var k={},m={},d=Object.prototype.toString;
k.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};k.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(d.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML");
};k.setDocument=function(w){var p=w.nodeType;if(p==9){}else{if(p){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return;
}this.document=w;var A=w.documentElement,o=this.getUIDXML(A),s=m[o],r;if(s){for(r in s){this[r]=s[r];}return;}s=m[o]={};s.root=A;s.isXMLDocument=this.isXML(w);
s.brokenStarGEBTN=s.starSelectsClosedQSA=s.idGetsName=s.brokenMixedCaseQSA=s.brokenGEBCN=s.brokenCheckedQSA=s.brokenEmptyAttributeQSA=s.isHTMLDocument=s.nativeMatchesSelector=false;
var q,u,y,z,t;var x,v="slick_uniqueid";var c=w.createElement("div");var n=w.body||w.getElementsByTagName("body")[0]||A;n.appendChild(c);try{c.innerHTML='';
s.isHTMLDocument=!!w.getElementById(v);}catch(C){}if(s.isHTMLDocument){c.style.display="none";c.appendChild(w.createComment(""));u=(c.getElementsByTagName("*").length>1);
try{c.innerHTML="foo";x=c.getElementsByTagName("*");q=(x&&!!x.length&&x[0].nodeName.charAt(0)=="/");}catch(C){}s.brokenStarGEBTN=u||q;try{c.innerHTML='';
s.idGetsName=w.getElementById(v)===c.firstChild;}catch(C){}if(c.getElementsByClassName){try{c.innerHTML='';c.getElementsByClassName("b").length;
c.firstChild.className="b";z=(c.getElementsByClassName("b").length!=2);}catch(C){}try{c.innerHTML='';y=(c.getElementsByClassName("a").length!=2);
}catch(C){}s.brokenGEBCN=z||y;}if(c.querySelectorAll){try{c.innerHTML="foo";x=c.querySelectorAll("*");s.starSelectsClosedQSA=(x&&!!x.length&&x[0].nodeName.charAt(0)=="/");
}catch(C){}try{c.innerHTML='';s.brokenMixedCaseQSA=!c.querySelectorAll(".MiX").length;}catch(C){}try{c.innerHTML='';
s.brokenCheckedQSA=(c.querySelectorAll(":checked").length==0);}catch(C){}try{c.innerHTML='';s.brokenEmptyAttributeQSA=(c.querySelectorAll('[class*=""]').length!=0);
}catch(C){}}try{c.innerHTML='';t=(c.firstChild.getAttribute("action")!="s");}catch(C){}s.nativeMatchesSelector=A.matchesSelector||A.mozMatchesSelector||A.webkitMatchesSelector;
if(s.nativeMatchesSelector){try{s.nativeMatchesSelector.call(A,":slick");s.nativeMatchesSelector=null;}catch(C){}}}try{A.slick_expando=1;delete A.slick_expando;
s.getUID=this.getUIDHTML;}catch(C){s.getUID=this.getUIDXML;}n.removeChild(c);c=x=n=null;s.getAttribute=(s.isHTMLDocument&&t)?function(G,E){var H=this.attributeGetters[E];
if(H){return H.call(G);}var F=G.getAttributeNode(E);return(F)?F.nodeValue:null;}:function(F,E){var G=this.attributeGetters[E];return(G)?G.call(F):F.getAttribute(E);
};s.hasAttribute=(A&&this.isNativeCode(A.hasAttribute))?function(F,E){return F.hasAttribute(E);}:function(F,E){F=F.getAttributeNode(E);return !!(F&&(F.specified||F.nodeValue));
};var D=A&&this.isNativeCode(A.contains),B=w&&this.isNativeCode(w.contains);s.contains=(D&&B)?function(E,F){return E.contains(F);}:(D&&!B)?function(E,F){return E===F||((E===w)?w.documentElement:E).contains(F);
}:(A&&A.compareDocumentPosition)?function(E,F){return E===F||!!(E.compareDocumentPosition(F)&16);}:function(E,F){if(F){do{if(F===E){return true;}}while((F=F.parentNode));
}return false;};s.documentSorter=(A.compareDocumentPosition)?function(F,E){if(!F.compareDocumentPosition||!E.compareDocumentPosition){return 0;}return F.compareDocumentPosition(E)&4?-1:F===E?0:1;
}:("sourceIndex" in A)?function(F,E){if(!F.sourceIndex||!E.sourceIndex){return 0;}return F.sourceIndex-E.sourceIndex;}:(w.createRange)?function(H,F){if(!H.ownerDocument||!F.ownerDocument){return 0;
}var G=H.ownerDocument.createRange(),E=F.ownerDocument.createRange();G.setStart(H,0);G.setEnd(H,0);E.setStart(F,0);E.setEnd(F,0);return G.compareBoundaryPoints(Range.START_TO_END,E);
}:null;A=null;for(r in s){this[r]=s[r];}};var f=/^([#.]?)((?:[\w-]+|\*))$/,h=/\[.+[*$^]=(?:""|'')?\]/,g={};k.search=function(U,z,H,s){var p=this.found=(s)?null:(H||[]);
if(!U){return p;}else{if(U.navigator){U=U.document;}else{if(!U.nodeType){return p;}}}var F,O,V=this.uniques={},I=!!(H&&H.length),y=(U.nodeType==9);if(this.document!==(y?U:U.ownerDocument)){this.setDocument(U);
}if(I){for(O=p.length;O--;){V[this.getUID(p[O])]=true;}}if(typeof z=="string"){var r=z.match(f);simpleSelectors:if(r){var u=r[1],v=r[2],A,E;if(!u){if(v=="*"&&this.brokenStarGEBTN){break simpleSelectors;
}E=U.getElementsByTagName(v);if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{if(u=="#"){if(!this.isHTMLDocument||!y){break simpleSelectors;
}A=U.getElementById(v);if(!A){return p;}if(this.idGetsName&&A.getAttributeNode("id").nodeValue!=v){break simpleSelectors;}if(s){return A||null;}if(!(I&&V[this.getUID(A)])){p.push(A);
}}else{if(u=="."){if(!this.isHTMLDocument||((!U.getElementsByClassName||this.brokenGEBCN)&&U.querySelectorAll)){break simpleSelectors;}if(U.getElementsByClassName&&!this.brokenGEBCN){E=U.getElementsByClassName(v);
if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{var T=new RegExp("(^|\\s)"+e.escapeRegExp(v)+"(\\s|$)");E=U.getElementsByTagName("*");
for(O=0;A=E[O++];){className=A.className;if(!(className&&T.test(className))){continue;}if(s){return A;}if(!(I&&V[this.getUID(A)])){p.push(A);}}}}}}if(I){this.sort(p);
}return(s)?null:p;}querySelector:if(U.querySelectorAll){if(!this.isHTMLDocument||g[z]||this.brokenMixedCaseQSA||(this.brokenCheckedQSA&&z.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&h.test(z))||(!y&&z.indexOf(",")>-1)||e.disableQSA){break querySelector;
}var S=z,x=U;if(!y){var C=x.getAttribute("id"),t="slickid__";x.setAttribute("id",t);S="#"+t+" "+S;U=x.parentNode;}try{if(s){return U.querySelector(S)||null;
}else{E=U.querySelectorAll(S);}}catch(Q){g[z]=1;break querySelector;}finally{if(!y){if(C){x.setAttribute("id",C);}else{x.removeAttribute("id");}U=x;}}if(this.starSelectsClosedQSA){for(O=0;
A=E[O++];){if(A.nodeName>"@"&&!(I&&V[this.getUID(A)])){p.push(A);}}}else{for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}if(I){this.sort(p);
}return p;}F=this.Slick.parse(z);if(!F.length){return p;}}else{if(z==null){return p;}else{if(z.Slick){F=z;}else{if(this.contains(U.documentElement||U,z)){(p)?p.push(z):p=z;
return p;}else{return p;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!I&&(s||(F.length==1&&F.expressions[0].length==1)))?this.pushArray:this.pushUID;
if(p==null){p=[];}var M,L,K;var B,J,D,c,q,G,W;var N,P,o,w,R=F.expressions;search:for(O=0;(P=R[O]);O++){for(M=0;(o=P[M]);M++){B="combinator:"+o.combinator;
if(!this[B]){continue search;}J=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();D=o.id;c=o.classList;q=o.classes;G=o.attributes;W=o.pseudos;w=(M===(P.length-1));
this.bitUniques={};if(w){this.uniques=V;this.found=p;}else{this.uniques={};this.found=[];}if(M===0){this[B](U,J,D,q,G,W,c);if(s&&w&&p.length){break search;
}}else{if(s&&w){for(L=0,K=N.length;L1)){this.sort(p);}return(s)?(p[0]||null):p;};k.uidx=1;k.uidk="slick-uniqueid";k.getUIDXML=function(n){var c=n.getAttribute(this.uidk);
if(!c){c=this.uidx++;n.setAttribute(this.uidk,c);}return c;};k.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};k.sort=function(c){if(!this.documentSorter){return c;
}c.sort(this.documentSorter);return c;};k.cacheNTH={};k.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;k.parseNTHArgument=function(q){var o=q.match(this.matchNTH);
if(!o){return false;}var p=o[2]||false;var n=o[1]||1;if(n=="-"){n=-1;}var c=+o[3]||0;o=(p=="n")?{a:n,b:c}:(p=="odd")?{a:2,b:1}:(p=="even")?{a:2,b:0}:{a:0,b:n};
return(this.cacheNTH[q]=o);};k.createNTHPseudo=function(p,n,c,o){return function(s,q){var u=this.getUID(s);if(!this[c][u]){var A=s.parentNode;if(!A){return false;
}var r=A[p],t=1;if(o){var z=s.nodeName;do{if(r.nodeName!=z){continue;}this[c][this.getUID(r)]=t++;}while((r=r[n]));}else{do{if(r.nodeType!=1){continue;
}this[c][this.getUID(r)]=t++;}while((r=r[n]));}}q=q||"n";var v=this.cacheNTH[q]||this.parseNTHArgument(q);if(!v){return false;}var y=v.a,x=v.b,w=this[c][u];
if(y==0){return x==w;}if(y>0){if(w":function(p,c,r,o,n,q){if((p=p.firstChild)){do{if(p.nodeType==1){this.push(p,c,r,o,n,q);
}}while((p=p.nextSibling));}},"+":function(p,c,r,o,n,q){while((p=p.nextSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q);break;}}},"^":function(p,c,r,o,n,q){p=p.firstChild;
if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:+"](p,c,r,o,n,q);}}},"~":function(q,c,s,p,n,r){while((q=q.nextSibling)){if(q.nodeType!=1){continue;
}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}},"++":function(p,c,r,o,n,q){this["combinator:+"](p,c,r,o,n,q);
this["combinator:!+"](p,c,r,o,n,q);},"~~":function(p,c,r,o,n,q){this["combinator:~"](p,c,r,o,n,q);this["combinator:!~"](p,c,r,o,n,q);},"!":function(p,c,r,o,n,q){while((p=p.parentNode)){if(p!==this.document){this.push(p,c,r,o,n,q);
}}},"!>":function(p,c,r,o,n,q){p=p.parentNode;if(p!==this.document){this.push(p,c,r,o,n,q);}},"!+":function(p,c,r,o,n,q){while((p=p.previousSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q);
break;}}},"!^":function(p,c,r,o,n,q){p=p.lastChild;if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:!+"](p,c,r,o,n,q);}}},"!~":function(q,c,s,p,n,r){while((q=q.previousSibling)){if(q.nodeType!=1){continue;
}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}}};for(var i in j){k["combinator:"+i]=j[i];}var l={empty:function(c){var n=c.firstChild;
return !(n&&n.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,n){return !this.matchNode(c,n);},contains:function(c,n){return(c.innerText||c.textContent||"").indexOf(n)>-1;
},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false;
}}return true;},"only-child":function(o){var n=o;while((n=n.previousSibling)){if(n.nodeType==1){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeType==1){return false;
}}return true;},"nth-child":k.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":k.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":k.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":k.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(n,c){return this["pseudo:nth-child"](n,""+(c+1));
},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var n=c.nodeName;
while((c=c.previousSibling)){if(c.nodeName==n){return false;}}return true;},"last-of-type":function(c){var n=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==n){return false;
}}return true;},"only-of-type":function(o){var n=o,p=o.nodeName;while((n=n.previousSibling)){if(n.nodeName==p){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeName==p){return false;
}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex"));
},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var b in l){k["pseudo:"+b]=l[b];}var a=k.attributeGetters={"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for");
},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href");},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style");
},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null;},type:function(){return this.getAttribute("type");
},maxlength:function(){var c=this.getAttributeNode("maxLength");return(c&&c.specified)?c.nodeValue:null;}};a.MAXLENGTH=a.maxLength=a.maxlength;var e=k.Slick=(this.Slick||{});
e.version="1.1.7";e.search=function(n,o,c){return k.search(n,o,c);};e.find=function(c,n){return k.search(c,n,null,true);};e.contains=function(c,n){k.setDocument(c);
return k.contains(c,n);};e.getAttribute=function(n,c){k.setDocument(n);return k.getAttribute(n,c);};e.hasAttribute=function(n,c){k.setDocument(n);return k.hasAttribute(n,c);
};e.match=function(n,c){if(!(n&&c)){return false;}if(!c||c===n){return true;}k.setDocument(n);return k.matchNode(n,c);};e.defineAttributeGetter=function(c,n){k.attributeGetters[c]=n;
return this;};e.lookupAttributeGetter=function(c){return k.attributeGetters[c];};e.definePseudo=function(c,n){k["pseudo:"+c]=function(p,o){return n.call(p,o);
};return this;};e.lookupPseudo=function(c){var n=k["pseudo:"+c];if(n){return function(o){return n.call(this,o);};}return null;};e.override=function(n,c){k.override(n,c);
return this;};e.isXML=k.isXML;e.uidOf=function(c){return k.getUIDHTML(c);};if(!this.Slick){this.Slick=e;}}).apply((typeof exports!="undefined")?exports:this);
var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0];
b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var a,f=0,c=d.length;f=this.length){delete this[g--];
}return e;}.protect());}Array.forEachMethod(function(g,e){Elements.implement(e,g);});Array.mirror(Elements);var d;try{d=(document.createElement("").name=="x");
}catch(b){}var c=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""");};Document.implement({newElement:function(e,g){if(g&&g.checked!=null){g.defaultChecked=g.checked;
}if(d&&g){e="";delete g.name;delete g.type;}return this.id(this.createElement(e)).set(g);
}});})();(function(){Slick.uidOf(window);Slick.uidOf(document);Document.implement({newTextNode:function(e){return this.createTextNode(e);},getDocument:function(){return this;
},getWindow:function(){return this.window;},id:(function(){var e={string:function(E,D,l){E=Slick.find(l,"#"+E.replace(/(\W)/g,"\\$1"));return(E)?e.element(E,D):null;
},element:function(D,E){Slick.uidOf(D);if(!E&&!D.$family&&!(/^(?:object|embed)$/i).test(D.tagName)){var l=D.fireEvent;D._fireEvent=function(F,G){return l(F,G);
};Object.append(D,Element.Prototype);}return D;},object:function(D,E,l){if(D.toElement){return e.element(D.toElement(l),E);}return null;}};e.textnode=e.whitespace=e.window=e.document=function(l){return l;
};return function(D,F,E){if(D&&D.$family&&D.uniqueNumber){return D;}var l=typeOf(D);return(e[l])?e[l](D,F,E||document):null;};})()});if(window.$==null){Window.implement("$",function(e,l){return document.id(e,l,this.document);
});}Window.implement({getDocument:function(){return this.document;},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(e){return Slick.search(this,e,new Elements);
},getElement:function(e){return document.id(Slick.find(this,e));}});var m={contains:function(e){return Slick.contains(this,e);}};if(!document.contains){Document.implement(m);
}if(!document.createElement("div").contains){Element.implement(m);}var r=function(E,D){if(!E){return D;}E=Object.clone(Slick.parse(E));var l=E.expressions;
for(var e=l.length;e--;){l[e][0].combinator=D;}return E;};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(e,l){Element.implement(l,function(D){return this.getElement(r(D,e));
});});Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(e,l){Element.implement(l,function(D){return this.getElements(r(D,e));
});});Element.implement({getFirst:function(e){return document.id(Slick.search(this,r(e,">"))[0]);},getLast:function(e){return document.id(Slick.search(this,r(e,">")).getLast());
},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(e){return document.id(Slick.find(this,"#"+(""+e).replace(/(\W)/g,"\\$1")));
},match:function(e){return !e||Slick.match(this,e);}});if(window.$$==null){Window.implement("$$",function(e){if(arguments.length==1){if(typeof e=="string"){return Slick.search(this.document,e,new Elements);
}else{if(Type.isEnumerable(e)){return new Elements(e);}}}return new Elements(arguments);});}var w={before:function(l,e){var D=e.parentNode;if(D){D.insertBefore(l,e);
}},after:function(l,e){var D=e.parentNode;if(D){D.insertBefore(l,e.nextSibling);}},bottom:function(l,e){e.appendChild(l);},top:function(l,e){e.insertBefore(l,e.firstChild);
}};w.inside=w.bottom;var j={},d={};var k={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","rowSpan","tabIndex","useMap"],function(e){k[e.toLowerCase()]=e;
});k.html="innerHTML";k.text=(document.createElement("div").textContent==null)?"innerText":"textContent";Object.forEach(k,function(l,e){d[e]=function(D,E){D[l]=E;
};j[e]=function(D){return D[l];};});var x=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"];
var h={};Array.forEach(x,function(e){var l=e.toLowerCase();h[l]=e;d[l]=function(D,E){D[e]=!!E;};j[l]=function(D){return !!D[e];};});Object.append(d,{"class":function(e,l){("className" in e)?e.className=(l||""):e.setAttribute("class",l);
},"for":function(e,l){("htmlFor" in e)?e.htmlFor=l:e.setAttribute("for",l);},style:function(e,l){(e.style)?e.style.cssText=l:e.setAttribute("style",l);
},value:function(e,l){e.value=(l!=null)?l:"";}});j["class"]=function(e){return("className" in e)?e.className||null:e.getAttribute("class");};var f=document.createElement("button");
try{f.type="button";}catch(z){}if(f.type!="button"){d.type=function(e,l){e.setAttribute("type",l);};}f=null;var p=document.createElement("input");p.value="t";
p.type="submit";if(p.value!="t"){d.type=function(l,e){var D=l.value;l.type=e;l.value=D;};}p=null;var q=(function(e){e.random="attribute";return(e.getAttribute("random")=="attribute");
})(document.createElement("div"));Element.implement({setProperty:function(l,D){var E=d[l.toLowerCase()];if(E){E(this,D);}else{if(q){var e=this.retrieve("$attributeWhiteList",{});
}if(D==null){this.removeAttribute(l);if(q){delete e[l];}}else{this.setAttribute(l,""+D);if(q){e[l]=true;}}}return this;},setProperties:function(e){for(var l in e){this.setProperty(l,e[l]);
}return this;},getProperty:function(F){var D=j[F.toLowerCase()];if(D){return D(this);}if(q){var l=this.getAttributeNode(F),E=this.retrieve("$attributeWhiteList",{});
if(!l){return null;}if(l.expando&&!E[F]){var G=this.outerHTML;if(G.substr(0,G.search(/\/?['"]?>(?![^1){E=e=document.createDocumentFragment();}for(var D=0;D";
var a=(t.childNodes.length==1);if(!a){var s="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),b=document.createDocumentFragment(),u=s.length;
while(u--){b.createElement(s[u]);}}t=null;var g=Function.attempt(function(){var e=document.createElement("table");e.innerHTML=" |
";return true;
});var c=document.createElement("tr"),o=" | ";c.innerHTML=o;var y=(c.innerHTML==o);c=null;if(!g||!y||!a){Element.Properties.html.set=(function(l){var e={table:[1,""],select:[1,""],tbody:[2,""],tr:[3,""]};
e.thead=e.tfoot=e.tbody;return function(D){var E=e[this.get("tag")];if(!E&&!a){E=[0,"",""];}if(!E){return l.call(this,D);}var H=E[0],G=document.createElement("div"),F=G;
if(!a){b.appendChild(G);}G.innerHTML=[E[1],D,E[2]].flatten().join("");while(H--){F=F.firstChild;}this.empty().adopt(F.childNodes);if(!a){b.removeChild(G);
}G=null;};})(Element.Properties.html.set);}var n=document.createElement("form");n.innerHTML="";if(n.firstChild.value!="s"){Element.Properties.value={set:function(G){var l=this.get("tag");
if(l!="select"){return this.setProperty("value",G);}var D=this.getElements("option");for(var E=0;E0||k==null?"visible":"hidden";};var f=(h?function(l,k){l.style.opacity=k;}:(e?function(l,k){var n=l.style;
if(!l.currentStyle||!l.currentStyle.hasLayout){n.zoom=1;}if(k==null||k==1){k="";}else{k="alpha(opacity="+(k*100).limit(0,100).round()+")";}var m=n.filter||l.getComputedStyle("filter")||"";
n.filter=j.test(m)?m.replace(j,k):m+k;if(!n.filter){n.removeAttribute("filter");}}:a));var g=(h?function(l){var k=l.style.opacity||l.getComputedStyle("opacity");
return(k=="")?1:k.toFloat();}:(e?function(l){var m=(l.style.filter||l.getComputedStyle("filter")),k;if(m){k=m.match(j);}return(k==null||m==null)?1:(k[1]/100);
}:function(l){var k=l.retrieve("$opacity");if(k==null){k=(l.style.visibility=="hidden"?0:1);}return k;}));var b=(i.style.cssFloat==null)?"styleFloat":"cssFloat";
Element.implement({getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()];}var l=Element.getDocument(this).defaultView,k=l?l.getComputedStyle(this,null):null;
return(k)?k.getPropertyValue((m==b)?"float":m.hyphenate()):null;},setStyle:function(l,k){if(l=="opacity"){if(k!=null){k=parseFloat(k);}f(this,k);return this;
}l=(l=="float"?b:l).camelCase();if(typeOf(k)!="string"){var m=(Element.Styles[l]||"@").split(" ");k=Array.from(k).map(function(o,n){if(!m[n]){return"";
}return(typeOf(o)=="number")?m[n].replace("@",Math.round(o)):o;}).join(" ");}else{if(k==String(Number(k))){k=Math.round(k);}}this.style[l]=k;if((k==""||k==null)&&c&&this.style.removeAttribute){this.style.removeAttribute(l);
}return this;},getStyle:function(q){if(q=="opacity"){return g(this);}q=(q=="float"?b:q).camelCase();var k=this.style[q];if(!k||q=="zIndex"){k=[];for(var p in Element.ShortStyles){if(q!=p){continue;
}for(var o in Element.ShortStyles[p]){k.push(this.getStyle(o));}return k.join(" ");}k=this.getComputedStyle(q);}if(k){k=String(k);var m=k.match(/rgba?\([\d\s,]+\)/);
if(m){k=k.replace(m[0],m[0].rgbToHex());}}if(Browser.opera||Browser.ie){if((/^(height|width)$/).test(q)&&!(/px$/.test(k))){var l=(q=="width")?["left","right"]:["top","bottom"],n=0;
l.each(function(r){n+=this.getStyle("border-"+r+"-width").toInt()+this.getStyle("padding-"+r).toInt();},this);return this["offset"+q.capitalize()]-n+"px";
}if(Browser.ie&&(/^border(.+)Width|margin|padding/).test(q)&&isNaN(parseFloat(k))){return"0px";}}return k;},setStyles:function(l){for(var k in l){this.setStyle(k,l[k]);
}return this;},getStyles:function(){var k={};Array.flatten(arguments).each(function(l){k[l]=this.getStyle(l);},this);return k;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"};
Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(q){var p=Element.ShortStyles;
var l=Element.Styles;["margin","padding"].each(function(r){var s=r+q;p[r][s]=l[s]="@px";});var o="border"+q;p.border[o]=l[o]="@px @ rgb(@, @, @)";var n=o+"Width",k=o+"Style",m=o+"Color";
p[o]={};p.borderWidth[n]=p[o][n]=l[n]="@px";p.borderStyle[k]=p[o][k]=l[k]="@";p.borderColor[m]=p[o][m]=l[m]="rgb(@, @, @)";});})();(function(){Element.Properties.events={set:function(b){this.addEvents(b);
}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{});if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this;
}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h,f);}if(b.condition){d=function(k){if(b.condition.call(this,k,f)){return h.call(this,k);
}return true;};}if(b.base){g=Function.from(b.base).call(this,f);}}var e=function(){return h.call(j);};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new DOMEvent(k,j.getWindow());
if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]);}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events");
if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d);if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e];
if(f){if(f.onRemove){f.onRemove.call(this,d,e);}if(f.base){e=Function.from(f.base).call(this,e);}}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this;
},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this;},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]);
}return this;}var c=this.retrieve("events");if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e);
},this);delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c);
}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b);
}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,input:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};
Element.Events={mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}};if("onmouseenter" in document.documentElement){Element.NativeEvents.mouseenter=Element.NativeEvents.mouseleave=2;
}else{var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c));
};Element.Events.mouseenter={base:"mouseover",condition:a};Element.Events.mouseleave={base:"mouseout",condition:a};}if(!window.addEventListener){Element.NativeEvents.propertychange=2;
Element.Events.change={base:function(){var b=this.type;return(this.get("tag")=="input"&&(b=="radio"||b=="checkbox"))?"propertychange":"change";},condition:function(b){return this.type!="radio"||(b.event.propertyName=="checked"&&this.checked);
}};}})();(function(){var c=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2;var k=function(l,m,n,o,p){while(p&&p!=l){if(m(p,o)){return n.call(p,o,p);
}p=document.id(p.parentNode);}};var a={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(c?"":"in"),capture:true},blur:{base:c?"blur":"focusout",capture:true}};
var b="$delegation:";var i=function(l){return{base:"focusin",remove:function(m,o){var p=m.retrieve(b+l+"listeners",{})[o];if(p&&p.forms){for(var n=p.forms.length;
n--;){p.forms[n].removeEvent(l,p.fns[n]);}}},listen:function(x,r,v,n,t,s){var o=(t.get("tag")=="form")?t:n.target.getParent("form");if(!o){return;}var u=x.retrieve(b+l+"listeners",{}),p=u[s]||{forms:[],fns:[]},m=p.forms,w=p.fns;
if(m.indexOf(o)!=-1){return;}m.push(o);var q=function(y){k(x,r,v,y,t);};o.addEvent(l,q);w.push(q);u[s]=p;x.store(b+l+"listeners",u);}};};var d=function(l){return{base:"focusin",listen:function(m,n,p,q,r){var o={blur:function(){this.removeEvents(o);
}};o[l]=function(s){k(m,n,p,s,r);};q.target.addEvents(o);}};};if(!c){Object.append(a,{submit:i("submit"),reset:i("reset"),change:d("change"),select:d("select")});
}var h=Element.prototype,f=h.addEvent,j=h.removeEvent;var e=function(l,m){return function(r,q,n){if(r.indexOf(":relay")==-1){return l.call(this,r,q,n);
}var o=Slick.parse(r).expressions[0][0];if(o.pseudos[0].key!="relay"){return l.call(this,r,q,n);}var p=o.tag;o.pseudos.slice(1).each(function(s){p+=":"+s.key+(s.value?"("+s.value+")":"");
});l.call(this,r,q);return m.call(this,p,o.pseudos[0].value,q);};};var g={addEvent:function(v,q,x){var t=this.retrieve("$delegates",{}),r=t[v];if(r){for(var y in r){if(r[y].fn==x&&r[y].match==q){return this;
}}}var p=v,u=q,o=x,n=a[v]||{};v=n.base||p;q=function(B){return Slick.match(B,u);};var w=Element.Events[p];if(w&&w.condition){var l=q,m=w.condition;q=function(C,B){return l(C,B)&&m.call(C,B,v);
};}var z=this,s=String.uniqueID();var A=n.listen?function(B,C){if(!C&&B&&B.target){C=B.target;}if(C){n.listen(z,q,x,B,C,s);}}:function(B,C){if(!C&&B&&B.target){C=B.target;
}if(C){k(z,q,x,B,C);}};if(!r){r={};}r[s]={match:u,fn:o,delegator:A};t[p]=r;return f.call(this,v,A,n.capture);},removeEvent:function(r,n,t,u){var q=this.retrieve("$delegates",{}),p=q[r];
if(!p){return this;}if(u){var m=r,w=p[u].delegator,l=a[r]||{};r=l.base||m;if(l.remove){l.remove(this,u);}delete p[u];q[m]=p;return j.call(this,r,w);}var o,v;
if(t){for(o in p){v=p[o];if(v.match==n&&v.fn==t){return g.removeEvent.call(this,r,n,t,o);}}}else{for(o in p){v=p[o];if(v.match==n){g.removeEvent.call(this,r,n,v.fn,o);
}}}return this;}};[Element,Window,Document].invoke("implement",{addEvent:e(f,g.addEvent),removeEvent:e(j,g.removeEvent)});})();(function(){var h=document.createElement("div"),e=document.createElement("div");
h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h);h=e=null;var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName);
};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n);}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize();
}return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};
},getScroll:function(){if(a(this)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0};
while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop;n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;
}var n=(k(m,"position")=="static")?i:l;while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null;
}try{return m.offsetParent;}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed");
return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft;
m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n);
m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){var q=this.getOffsets(),n=this.getScrolls();
var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates();
}var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")};
},setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight};
},getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body;
return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize();
return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box";
}function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName);
}function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}})();Element.alias({position:"setPosition"});[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y;
},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;
},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;
},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this;
this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval;
this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e;
},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2);
});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request();
this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false;
this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d;
}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml);
}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e);
}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();
},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]);
},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f;
return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true;
}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this;
}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options;
o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString();
break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e;
j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g;
}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID();
}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this);
}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true;
}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]);
}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}else{if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this);
}}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d;
if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e};
if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e);
return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")});
this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})();
Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(f){var e=this.options,c=this.response;
c.html=f.stripScripts(function(h){c.javascript=h;});var d=c.html.match(/]*>([\s\S]*?)/i);if(d){c.html=d[1];}var b=new Element("div").set("html",c.html);
c.tree=b.childNodes;c.elements=b.getElements(e.filter||"*");if(e.filter){c.tree=c.elements;}if(e.update){var g=document.id(e.update).empty();if(e.filter){g.adopt(c.elements);
}else{g.set("html",c.html);}}else{if(e.append){var a=document.id(e.append);if(e.filter){c.elements.reverse().inject(a);}else{a.adopt(b.getChildren());}}}if(e.evalScripts){Browser.exec(c.javascript);
}this.onSuccess(c.tree,c.elements,c.html,c.javascript);}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this;
},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"});this.store("load",a);}return a;
}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString}));return this;}});if(typeof JSON=="undefined"){this.JSON={};
}(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4);
};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");
return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON();
}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[];
Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj;
case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string);
}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")");
};})();Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"});
},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure();
}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b;
this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path;
}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure";
}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");
return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}});
Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose();
};(function(i,k){var l,f,e=[],c,b,d=k.createElement("div");var g=function(){clearTimeout(b);if(l){return;}Browser.loaded=l=true;k.removeListener("DOMContentLoaded",g).removeListener("readystatechange",a);
k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.length;m--;){if(e[m]()){g();return true;}}return false;};var j=function(){clearTimeout(b);
if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h);
c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a);
}else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this);
}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;
},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance;
var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks;
var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments);
};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild;
},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement());
return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+"");
return eval(rs);};})();
/*
---
MooTools: the javascript framework
web build:
- http://mootools.net/more/f33a018fb43fb81cdf260b23d6e975f9
packager build:
- packager build More/More More/Hash More/Element.Measure More/Element.Position More/Fx.Elements More/Fx.Scroll More/Fx.Slide More/Fx.SmoothScroll More/Assets More/Color More/HtmlTable More/HtmlTable.Zebra More/Tips
...
*/
/*
---
script: More.js
name: More
description: MooTools More
license: MIT-style license
authors:
- Guillermo Rauch
- Thomas Aylott
- Scott Kyle
- Arian Stolwijk
- Tim Wienk
- Christoph Pojer
- Aaron Newton
- Jacob Thornton
requires:
- Core/MooTools
provides: [MooTools.More]
...
*/
MooTools.More = {
version: '1.5.1',
build: '2dd695ba957196ae4b0275a690765d6636a61ccd'
};
/*
---
name: Hash
description: Contains Hash Prototypes. Provides a means for overcoming the JavaScript practical impossibility of extending native Objects.
license: MIT-style license.
requires:
- Core/Object
- MooTools.More
provides: [Hash]
...
*/
(function(){
if (this.Hash) return;
var Hash = this.Hash = new Type('Hash', function(object){
if (typeOf(object) == 'hash') object = Object.clone(object.getClean());
for (var key in object) this[key] = object[key];
return this;
});
this.$H = function(object){
return new Hash(object);
};
Hash.implement({
forEach: function(fn, bind){
Object.forEach(this, fn, bind);
},
getClean: function(){
var clean = {};
for (var key in this){
if (this.hasOwnProperty(key)) clean[key] = this[key];
}
return clean;
},
getLength: function(){
var length = 0;
for (var key in this){
if (this.hasOwnProperty(key)) length++;
}
return length;
}
});
Hash.alias('each', 'forEach');
Hash.implement({
has: Object.prototype.hasOwnProperty,
keyOf: function(value){
return Object.keyOf(this, value);
},
hasValue: function(value){
return Object.contains(this, value);
},
extend: function(properties){
Hash.each(properties || {}, function(value, key){
Hash.set(this, key, value);
}, this);
return this;
},
combine: function(properties){
Hash.each(properties || {}, function(value, key){
Hash.include(this, key, value);
}, this);
return this;
},
erase: function(key){
if (this.hasOwnProperty(key)) delete this[key];
return this;
},
get: function(key){
return (this.hasOwnProperty(key)) ? this[key] : null;
},
set: function(key, value){
if (!this[key] || this.hasOwnProperty(key)) this[key] = value;
return this;
},
empty: function(){
Hash.each(this, function(value, key){
delete this[key];
}, this);
return this;
},
include: function(key, value){
if (this[key] == undefined) this[key] = value;
return this;
},
map: function(fn, bind){
return new Hash(Object.map(this, fn, bind));
},
filter: function(fn, bind){
return new Hash(Object.filter(this, fn, bind));
},
every: function(fn, bind){
return Object.every(this, fn, bind);
},
some: function(fn, bind){
return Object.some(this, fn, bind);
},
getKeys: function(){
return Object.keys(this);
},
getValues: function(){
return Object.values(this);
},
toQueryString: function(base){
return Object.toQueryString(this, base);
}
});
Hash.alias({indexOf: 'keyOf', contains: 'hasValue'});
})();
/*
---
script: Element.Measure.js
name: Element.Measure
description: Extends the Element native object to include methods useful in measuring dimensions.
credits: "Element.measure / .expose methods by Daniel Steigerwald License: MIT-style license. Copyright: Copyright (c) 2008 Daniel Steigerwald, daniel.steigerwald.cz"
license: MIT-style license
authors:
- Aaron Newton
requires:
- Core/Element.Style
- Core/Element.Dimensions
- MooTools.More
provides: [Element.Measure]
...
*/
(function(){
var getStylesList = function(styles, planes){
var list = [];
Object.each(planes, function(directions){
Object.each(directions, function(edge){
styles.each(function(style){
list.push(style + '-' + edge + (style == 'border' ? '-width' : ''));
});
});
});
return list;
};
var calculateEdgeSize = function(edge, styles){
var total = 0;
Object.each(styles, function(value, style){
if (style.test(edge)) total = total + value.toInt();
});
return total;
};
var isVisible = function(el){
return !!(!el || el.offsetHeight || el.offsetWidth);
};
Element.implement({
measure: function(fn){
if (isVisible(this)) return fn.call(this);
var parent = this.getParent(),
toMeasure = [];
while (!isVisible(parent) && parent != document.body){
toMeasure.push(parent.expose());
parent = parent.getParent();
}
var restore = this.expose(),
result = fn.call(this);
restore();
toMeasure.each(function(restore){
restore();
});
return result;
},
expose: function(){
if (this.getStyle('display') != 'none') return function(){};
var before = this.style.cssText;
this.setStyles({
display: 'block',
position: 'absolute',
visibility: 'hidden'
});
return function(){
this.style.cssText = before;
}.bind(this);
},
getDimensions: function(options){
options = Object.merge({computeSize: false}, options);
var dim = {x: 0, y: 0};
var getSize = function(el, options){
return (options.computeSize) ? el.getComputedSize(options) : el.getSize();
};
var parent = this.getParent('body');
if (parent && this.getStyle('display') == 'none'){
dim = this.measure(function(){
return getSize(this, options);
});
} else if (parent){
try { //safari sometimes crashes here, so catch it
dim = getSize(this, options);
}catch(e){}
}
return Object.append(dim, (dim.x || dim.x === 0) ? {
width: dim.x,
height: dim.y
} : {
x: dim.width,
y: dim.height
}
);
},
getComputedSize: function(options){
options = Object.merge({
styles: ['padding','border'],
planes: {
height: ['top','bottom'],
width: ['left','right']
},
mode: 'both'
}, options);
var styles = {},
size = {width: 0, height: 0},
dimensions;
if (options.mode == 'vertical'){
delete size.width;
delete options.planes.width;
} else if (options.mode == 'horizontal'){
delete size.height;
delete options.planes.height;
}
getStylesList(options.styles, options.planes).each(function(style){
styles[style] = this.getStyle(style).toInt();
}, this);
Object.each(options.planes, function(edges, plane){
var capitalized = plane.capitalize(),
style = this.getStyle(plane);
if (style == 'auto' && !dimensions) dimensions = this.getDimensions();
style = styles[plane] = (style == 'auto') ? dimensions[plane] : style.toInt();
size['total' + capitalized] = style;
edges.each(function(edge){
var edgesize = calculateEdgeSize(edge, styles);
size['computed' + edge.capitalize()] = edgesize;
size['total' + capitalized] += edgesize;
});
}, this);
return Object.append(size, styles);
}
});
})();
/*
---
script: Element.Position.js
name: Element.Position
description: Extends the Element native object to include methods useful positioning elements relative to others.
license: MIT-style license
authors:
- Aaron Newton
- Jacob Thornton
requires:
- Core/Options
- Core/Element.Dimensions
- Element.Measure
provides: [Element.Position]
...
*/
(function(original){
var local = Element.Position = {
options: {/*
edge: false,
returnPos: false,
minimum: {x: 0, y: 0},
maximum: {x: 0, y: 0},
relFixedPosition: false,
ignoreMargins: false,
ignoreScroll: false,
allowNegative: false,*/
relativeTo: document.body,
position: {
x: 'center', //left, center, right
y: 'center' //top, center, bottom
},
offset: {x: 0, y: 0}
},
getOptions: function(element, options){
options = Object.merge({}, local.options, options);
local.setPositionOption(options);
local.setEdgeOption(options);
local.setOffsetOption(element, options);
local.setDimensionsOption(element, options);
return options;
},
setPositionOption: function(options){
options.position = local.getCoordinateFromValue(options.position);
},
setEdgeOption: function(options){
var edgeOption = local.getCoordinateFromValue(options.edge);
options.edge = edgeOption ? edgeOption :
(options.position.x == 'center' && options.position.y == 'center') ? {x: 'center', y: 'center'} :
{x: 'left', y: 'top'};
},
setOffsetOption: function(element, options){
var parentOffset = {x: 0, y: 0};
var parentScroll = {x: 0, y: 0};
var offsetParent = element.measure(function(){
return document.id(this.getOffsetParent());
});
if (!offsetParent || offsetParent == element.getDocument().body) return;
parentScroll = offsetParent.getScroll();
parentOffset = offsetParent.measure(function(){
var position = this.getPosition();
if (this.getStyle('position') == 'fixed'){
var scroll = window.getScroll();
position.x += scroll.x;
position.y += scroll.y;
}
return position;
});
options.offset = {
parentPositioned: offsetParent != document.id(options.relativeTo),
x: options.offset.x - parentOffset.x + parentScroll.x,
y: options.offset.y - parentOffset.y + parentScroll.y
};
},
setDimensionsOption: function(element, options){
options.dimensions = element.getDimensions({
computeSize: true,
styles: ['padding', 'border', 'margin']
});
},
getPosition: function(element, options){
var position = {};
options = local.getOptions(element, options);
var relativeTo = document.id(options.relativeTo) || document.body;
local.setPositionCoordinates(options, position, relativeTo);
if (options.edge) local.toEdge(position, options);
var offset = options.offset;
position.left = ((position.x >= 0 || offset.parentPositioned || options.allowNegative) ? position.x : 0).toInt();
position.top = ((position.y >= 0 || offset.parentPositioned || options.allowNegative) ? position.y : 0).toInt();
local.toMinMax(position, options);
if (options.relFixedPosition || relativeTo.getStyle('position') == 'fixed') local.toRelFixedPosition(relativeTo, position);
if (options.ignoreScroll) local.toIgnoreScroll(relativeTo, position);
if (options.ignoreMargins) local.toIgnoreMargins(position, options);
position.left = Math.ceil(position.left);
position.top = Math.ceil(position.top);
delete position.x;
delete position.y;
return position;
},
setPositionCoordinates: function(options, position, relativeTo){
var offsetY = options.offset.y,
offsetX = options.offset.x,
calc = (relativeTo == document.body) ? window.getScroll() : relativeTo.getPosition(),
top = calc.y,
left = calc.x,
winSize = window.getSize();
switch(options.position.x){
case 'left': position.x = left + offsetX; break;
case 'right': position.x = left + offsetX + relativeTo.offsetWidth; break;
default: position.x = left + ((relativeTo == document.body ? winSize.x : relativeTo.offsetWidth) / 2) + offsetX; break;
}
switch(options.position.y){
case 'top': position.y = top + offsetY; break;
case 'bottom': position.y = top + offsetY + relativeTo.offsetHeight; break;
default: position.y = top + ((relativeTo == document.body ? winSize.y : relativeTo.offsetHeight) / 2) + offsetY; break;
}
},
toMinMax: function(position, options){
var xy = {left: 'x', top: 'y'}, value;
['minimum', 'maximum'].each(function(minmax){
['left', 'top'].each(function(lr){
value = options[minmax] ? options[minmax][xy[lr]] : null;
if (value != null && ((minmax == 'minimum') ? position[lr] < value : position[lr] > value)) position[lr] = value;
});
});
},
toRelFixedPosition: function(relativeTo, position){
var winScroll = window.getScroll();
position.top += winScroll.y;
position.left += winScroll.x;
},
toIgnoreScroll: function(relativeTo, position){
var relScroll = relativeTo.getScroll();
position.top -= relScroll.y;
position.left -= relScroll.x;
},
toIgnoreMargins: function(position, options){
position.left += options.edge.x == 'right'
? options.dimensions['margin-right']
: (options.edge.x != 'center'
? -options.dimensions['margin-left']
: -options.dimensions['margin-left'] + ((options.dimensions['margin-right'] + options.dimensions['margin-left']) / 2));
position.top += options.edge.y == 'bottom'
? options.dimensions['margin-bottom']
: (options.edge.y != 'center'
? -options.dimensions['margin-top']
: -options.dimensions['margin-top'] + ((options.dimensions['margin-bottom'] + options.dimensions['margin-top']) / 2));
},
toEdge: function(position, options){
var edgeOffset = {},
dimensions = options.dimensions,
edge = options.edge;
switch(edge.x){
case 'left': edgeOffset.x = 0; break;
case 'right': edgeOffset.x = -dimensions.x - dimensions.computedRight - dimensions.computedLeft; break;
// center
default: edgeOffset.x = -(Math.round(dimensions.totalWidth / 2)); break;
}
switch(edge.y){
case 'top': edgeOffset.y = 0; break;
case 'bottom': edgeOffset.y = -dimensions.y - dimensions.computedTop - dimensions.computedBottom; break;
// center
default: edgeOffset.y = -(Math.round(dimensions.totalHeight / 2)); break;
}
position.x += edgeOffset.x;
position.y += edgeOffset.y;
},
getCoordinateFromValue: function(option){
if (typeOf(option) != 'string') return option;
option = option.toLowerCase();
return {
x: option.test('left') ? 'left'
: (option.test('right') ? 'right' : 'center'),
y: option.test(/upper|top/) ? 'top'
: (option.test('bottom') ? 'bottom' : 'center')
};
}
};
Element.implement({
position: function(options){
if (options && (options.x != null || options.y != null)){
return (original ? original.apply(this, arguments) : this);
}
var position = this.setStyle('position', 'absolute').calculatePosition(options);
return (options && options.returnPos) ? position : this.setStyles(position);
},
calculatePosition: function(options){
return local.getPosition(this, options);
}
});
})(Element.prototype.position);
/*
---
script: Fx.Elements.js
name: Fx.Elements
description: Effect to change any number of CSS properties of any number of Elements.
license: MIT-style license
authors:
- Valerio Proietti
requires:
- Core/Fx.CSS
- MooTools.More
provides: [Fx.Elements]
...
*/
Fx.Elements = new Class({
Extends: Fx.CSS,
initialize: function(elements, options){
this.elements = this.subject = $$(elements);
this.parent(options);
},
compute: function(from, to, delta){
var now = {};
for (var i in from){
var iFrom = from[i], iTo = to[i], iNow = now[i] = {};
for (var p in iFrom) iNow[p] = this.parent(iFrom[p], iTo[p], delta);
}
return now;
},
set: function(now){
for (var i in now){
if (!this.elements[i]) continue;
var iNow = now[i];
for (var p in iNow) this.render(this.elements[i], p, iNow[p], this.options.unit);
}
return this;
},
start: function(obj){
if (!this.check(obj)) return this;
var from = {}, to = {};
for (var i in obj){
if (!this.elements[i]) continue;
var iProps = obj[i], iFrom = from[i] = {}, iTo = to[i] = {};
for (var p in iProps){
var parsed = this.prepare(this.elements[i], p, iProps[p]);
iFrom[p] = parsed.from;
iTo[p] = parsed.to;
}
}
return this.parent(from, to);
}
});
/*
---
script: Fx.Scroll.js
name: Fx.Scroll
description: Effect to smoothly scroll any element, including the window.
license: MIT-style license
authors:
- Valerio Proietti
requires:
- Core/Fx
- Core/Element.Event
- Core/Element.Dimensions
- MooTools.More
provides: [Fx.Scroll]
...
*/
(function(){
Fx.Scroll = new Class({
Extends: Fx,
options: {
offset: {x: 0, y: 0},
wheelStops: true
},
initialize: function(element, options){
this.element = this.subject = document.id(element);
this.parent(options);
if (typeOf(this.element) != 'element') this.element = document.id(this.element.getDocument().body);
if (this.options.wheelStops){
var stopper = this.element,
cancel = this.cancel.pass(false, this);
this.addEvent('start', function(){
stopper.addEvent('mousewheel', cancel);
}, true);
this.addEvent('complete', function(){
stopper.removeEvent('mousewheel', cancel);
}, true);
}
},
set: function(){
var now = Array.flatten(arguments);
this.element.scrollTo(now[0], now[1]);
return this;
},
compute: function(from, to, delta){
return [0, 1].map(function(i){
return Fx.compute(from[i], to[i], delta);
});
},
start: function(x, y){
if (!this.check(x, y)) return this;
var scroll = this.element.getScroll();
return this.parent([scroll.x, scroll.y], [x, y]);
},
calculateScroll: function(x, y){
var element = this.element,
scrollSize = element.getScrollSize(),
scroll = element.getScroll(),
size = element.getSize(),
offset = this.options.offset,
values = {x: x, y: y};
for (var z in values){
if (!values[z] && values[z] !== 0) values[z] = scroll[z];
if (typeOf(values[z]) != 'number') values[z] = scrollSize[z] - size[z];
values[z] += offset[z];
}
return [values.x, values.y];
},
toTop: function(){
return this.start.apply(this, this.calculateScroll(false, 0));
},
toLeft: function(){
return this.start.apply(this, this.calculateScroll(0, false));
},
toRight: function(){
return this.start.apply(this, this.calculateScroll('right', false));
},
toBottom: function(){
return this.start.apply(this, this.calculateScroll(false, 'bottom'));
},
toElement: function(el, axes){
axes = axes ? Array.from(axes) : ['x', 'y'];
var scroll = isBody(this.element) ? {x: 0, y: 0} : this.element.getScroll();
var position = Object.map(document.id(el).getPosition(this.element), function(value, axis){
return axes.contains(axis) ? value + scroll[axis] : false;
});
return this.start.apply(this, this.calculateScroll(position.x, position.y));
},
toElementEdge: function(el, axes, offset){
axes = axes ? Array.from(axes) : ['x', 'y'];
el = document.id(el);
var to = {},
position = el.getPosition(this.element),
size = el.getSize(),
scroll = this.element.getScroll(),
containerSize = this.element.getSize(),
edge = {
x: position.x + size.x,
y: position.y + size.y
};
['x', 'y'].each(function(axis){
if (axes.contains(axis)){
if (edge[axis] > scroll[axis] + containerSize[axis]) to[axis] = edge[axis] - containerSize[axis];
if (position[axis] < scroll[axis]) to[axis] = position[axis];
}
if (to[axis] == null) to[axis] = scroll[axis];
if (offset && offset[axis]) to[axis] = to[axis] + offset[axis];
}, this);
if (to.x != scroll.x || to.y != scroll.y) this.start(to.x, to.y);
return this;
},
toElementCenter: function(el, axes, offset){
axes = axes ? Array.from(axes) : ['x', 'y'];
el = document.id(el);
var to = {},
position = el.getPosition(this.element),
size = el.getSize(),
scroll = this.element.getScroll(),
containerSize = this.element.getSize();
['x', 'y'].each(function(axis){
if (axes.contains(axis)){
to[axis] = position[axis] - (containerSize[axis] - size[axis]) / 2;
}
if (to[axis] == null) to[axis] = scroll[axis];
if (offset && offset[axis]) to[axis] = to[axis] + offset[axis];
}, this);
if (to.x != scroll.x || to.y != scroll.y) this.start(to.x, to.y);
return this;
}
});
function isBody(element){
return (/^(?:body|html)$/i).test(element.tagName);
}
})();
/*
---
script: Fx.Slide.js
name: Fx.Slide
description: Effect to slide an element in and out of view.
license: MIT-style license
authors:
- Valerio Proietti
requires:
- Core/Fx
- Core/Element.Style
- MooTools.More
provides: [Fx.Slide]
...
*/
Fx.Slide = new Class({
Extends: Fx,
options: {
mode: 'vertical',
wrapper: false,
hideOverflow: true,
resetHeight: false
},
initialize: function(element, options){
element = this.element = this.subject = document.id(element);
this.parent(options);
options = this.options;
var wrapper = element.retrieve('wrapper'),
styles = element.getStyles('margin', 'position', 'overflow');
if (options.hideOverflow) styles = Object.append(styles, {overflow: 'hidden'});
if (options.wrapper) wrapper = document.id(options.wrapper).setStyles(styles);
if (!wrapper) wrapper = new Element('div', {
styles: styles
}).wraps(element);
element.store('wrapper', wrapper).setStyle('margin', 0);
if (element.getStyle('overflow') == 'visible') element.setStyle('overflow', 'hidden');
this.now = [];
this.open = true;
this.wrapper = wrapper;
this.addEvent('complete', function(){
this.open = (wrapper['offset' + this.layout.capitalize()] != 0);
if (this.open && this.options.resetHeight) wrapper.setStyle('height', '');
}, true);
},
vertical: function(){
this.margin = 'margin-top';
this.layout = 'height';
this.offset = this.element.offsetHeight;
},
horizontal: function(){
this.margin = 'margin-left';
this.layout = 'width';
this.offset = this.element.offsetWidth;
},
set: function(now){
this.element.setStyle(this.margin, now[0]);
this.wrapper.setStyle(this.layout, now[1]);
return this;
},
compute: function(from, to, delta){
return [0, 1].map(function(i){
return Fx.compute(from[i], to[i], delta);
});
},
start: function(how, mode){
if (!this.check(how, mode)) return this;
this[mode || this.options.mode]();
var margin = this.element.getStyle(this.margin).toInt(),
layout = this.wrapper.getStyle(this.layout).toInt(),
caseIn = [[margin, layout], [0, this.offset]],
caseOut = [[margin, layout], [-this.offset, 0]],
start;
switch (how){
case 'in': start = caseIn; break;
case 'out': start = caseOut; break;
case 'toggle': start = (layout == 0) ? caseIn : caseOut;
}
return this.parent(start[0], start[1]);
},
slideIn: function(mode){
return this.start('in', mode);
},
slideOut: function(mode){
return this.start('out', mode);
},
hide: function(mode){
this[mode || this.options.mode]();
this.open = false;
return this.set([-this.offset, 0]);
},
show: function(mode){
this[mode || this.options.mode]();
this.open = true;
return this.set([0, this.offset]);
},
toggle: function(mode){
return this.start('toggle', mode);
}
});
Element.Properties.slide = {
set: function(options){
this.get('slide').cancel().setOptions(options);
return this;
},
get: function(){
var slide = this.retrieve('slide');
if (!slide){
slide = new Fx.Slide(this, {link: 'cancel'});
this.store('slide', slide);
}
return slide;
}
};
Element.implement({
slide: function(how, mode){
how = how || 'toggle';
var slide = this.get('slide'), toggle;
switch (how){
case 'hide': slide.hide(mode); break;
case 'show': slide.show(mode); break;
case 'toggle':
var flag = this.retrieve('slide:flag', slide.open);
slide[flag ? 'slideOut' : 'slideIn'](mode);
this.store('slide:flag', !flag);
toggle = true;
break;
default: slide.start(how, mode);
}
if (!toggle) this.eliminate('slide:flag');
return this;
}
});
/*
---
script: Fx.SmoothScroll.js
name: Fx.SmoothScroll
description: Class for creating a smooth scrolling effect to all internal links on the page.
license: MIT-style license
authors:
- Valerio Proietti
requires:
- Core/Slick.Finder
- Fx.Scroll
provides: [Fx.SmoothScroll]
...
*/
Fx.SmoothScroll = new Class({
Extends: Fx.Scroll,
options: {
axes: ['x', 'y']
},
initialize: function(options, context){
context = context || document;
this.doc = context.getDocument();
this.parent(this.doc, options);
var win = context.getWindow(),
location = win.location.href.match(/^[^#]*/)[0] + '#',
links = $$(this.options.links || this.doc.links);
links.each(function(link){
if (link.href.indexOf(location) != 0) return;
var anchor = link.href.substr(location.length);
if (anchor) this.useLink(link, anchor);
}, this);
this.addEvent('complete', function(){
win.location.hash = this.anchor;
this.element.scrollTo(this.to[0], this.to[1]);
}, true);
},
useLink: function(link, anchor){
link.addEvent('click', function(event){
var el = document.id(anchor) || this.doc.getElement('a[name=' + anchor + ']');
if (!el) return;
event.preventDefault();
this.toElement(el, this.options.axes).chain(function(){
this.fireEvent('scrolledTo', [link, el]);
}.bind(this));
this.anchor = anchor;
}.bind(this));
return this;
}
});
/*
---
script: Assets.js
name: Assets
description: Provides methods to dynamically load JavaScript, CSS, and Image files into the document.
license: MIT-style license
authors:
- Valerio Proietti
requires:
- Core/Element.Event
- MooTools.More
provides: [Assets]
...
*/
var Asset = {
javascript: function(source, properties){
if (!properties) properties = {};
var script = new Element('script', {src: source, type: 'text/javascript'}),
doc = properties.document || document,
load = properties.onload || properties.onLoad;
delete properties.onload;
delete properties.onLoad;
delete properties.document;
if (load){
if (!script.addEventListener){
script.addEvent('readystatechange', function(){
if (['loaded', 'complete'].contains(this.readyState)) load.call(this);
});
} else {
script.addEvent('load', load);
}
}
return script.set(properties).inject(doc.head);
},
css: function(source, properties){
if (!properties) properties = {};
var load = properties.onload || properties.onLoad,
doc = properties.document || document,
timeout = properties.timeout || 3000;
['onload', 'onLoad', 'document'].each(function(prop){
delete properties[prop];
});
var link = new Element('link', {
type: 'text/css',
rel: 'stylesheet',
media: 'screen',
href: source
}).setProperties(properties).inject(doc.head);
if (load){
// based on article at http://www.yearofmoo.com/2011/03/cross-browser-stylesheet-preloading.html
var loaded = false, retries = 0;
var check = function(){
var stylesheets = document.styleSheets;
for (var i = 0; i < stylesheets.length; i++){
var file = stylesheets[i];
var owner = file.ownerNode ? file.ownerNode : file.owningElement;
if (owner && owner == link){
loaded = true;
return load.call(link);
}
}
retries++;
if (!loaded && retries < timeout / 50) return setTimeout(check, 50);
}
setTimeout(check, 0);
}
return link;
},
image: function(source, properties){
if (!properties) properties = {};
var image = new Image(),
element = document.id(image) || new Element('img');
['load', 'abort', 'error'].each(function(name){
var type = 'on' + name,
cap = 'on' + name.capitalize(),
event = properties[type] || properties[cap] || function(){};
delete properties[cap];
delete properties[type];
image[type] = function(){
if (!image) return;
if (!element.parentNode){
element.width = image.width;
element.height = image.height;
}
image = image.onload = image.onabort = image.onerror = null;
event.delay(1, element, element);
element.fireEvent(name, element, 1);
};
});
image.src = element.src = source;
if (image && image.complete) image.onload.delay(1);
return element.set(properties);
},
images: function(sources, options){
sources = Array.from(sources);
var fn = function(){},
counter = 0;
options = Object.merge({
onComplete: fn,
onProgress: fn,
onError: fn,
properties: {}
}, options);
return new Elements(sources.map(function(source, index){
return Asset.image(source, Object.append(options.properties, {
onload: function(){
counter++;
options.onProgress.call(this, counter, index, source);
if (counter == sources.length) options.onComplete();
},
onerror: function(){
counter++;
options.onError.call(this, counter, index, source);
if (counter == sources.length) options.onComplete();
}
}));
}));
}
};
/*
---
script: Color.js
name: Color
description: Class for creating and manipulating colors in JavaScript. Supports HSB -> RGB Conversions and vice versa.
license: MIT-style license
authors:
- Valerio Proietti
requires:
- Core/Array
- Core/String
- Core/Number
- Core/Hash
- Core/Function
- MooTools.More
provides: [Color]
...
*/
(function(){
var Color = this.Color = new Type('Color', function(color, type){
if (arguments.length >= 3){
type = 'rgb'; color = Array.slice(arguments, 0, 3);
} else if (typeof color == 'string'){
if (color.match(/rgb/)) color = color.rgbToHex().hexToRgb(true);
else if (color.match(/hsb/)) color = color.hsbToRgb();
else color = color.hexToRgb(true);
}
type = type || 'rgb';
switch (type){
case 'hsb':
var old = color;
color = color.hsbToRgb();
color.hsb = old;
break;
case 'hex': color = color.hexToRgb(true); break;
}
color.rgb = color.slice(0, 3);
color.hsb = color.hsb || color.rgbToHsb();
color.hex = color.rgbToHex();
return Object.append(color, this);
});
Color.implement({
mix: function(){
var colors = Array.slice(arguments);
var alpha = (typeOf(colors.getLast()) == 'number') ? colors.pop() : 50;
var rgb = this.slice();
colors.each(function(color){
color = new Color(color);
for (var i = 0; i < 3; i++) rgb[i] = Math.round((rgb[i] / 100 * (100 - alpha)) + (color[i] / 100 * alpha));
});
return new Color(rgb, 'rgb');
},
invert: function(){
return new Color(this.map(function(value){
return 255 - value;
}));
},
setHue: function(value){
return new Color([value, this.hsb[1], this.hsb[2]], 'hsb');
},
setSaturation: function(percent){
return new Color([this.hsb[0], percent, this.hsb[2]], 'hsb');
},
setBrightness: function(percent){
return new Color([this.hsb[0], this.hsb[1], percent], 'hsb');
}
});
this.$RGB = function(r, g, b){
return new Color([r, g, b], 'rgb');
};
this.$HSB = function(h, s, b){
return new Color([h, s, b], 'hsb');
};
this.$HEX = function(hex){
return new Color(hex, 'hex');
};
Array.implement({
rgbToHsb: function(){
var red = this[0],
green = this[1],
blue = this[2],
hue = 0;
var max = Math.max(red, green, blue),
min = Math.min(red, green, blue);
var delta = max - min;
var brightness = max / 255,
saturation = (max != 0) ? delta / max : 0;
if (saturation != 0){
var rr = (max - red) / delta;
var gr = (max - green) / delta;
var br = (max - blue) / delta;
if (red == max) hue = br - gr;
else if (green == max) hue = 2 + rr - br;
else hue = 4 + gr - rr;
hue /= 6;
if (hue < 0) hue++;
}
return [Math.round(hue * 360), Math.round(saturation * 100), Math.round(brightness * 100)];
},
hsbToRgb: function(){
var br = Math.round(this[2] / 100 * 255);
if (this[1] == 0){
return [br, br, br];
} else {
var hue = this[0] % 360;
var f = hue % 60;
var p = Math.round((this[2] * (100 - this[1])) / 10000 * 255);
var q = Math.round((this[2] * (6000 - this[1] * f)) / 600000 * 255);
var t = Math.round((this[2] * (6000 - this[1] * (60 - f))) / 600000 * 255);
switch (Math.floor(hue / 60)){
case 0: return [br, t, p];
case 1: return [q, br, p];
case 2: return [p, br, t];
case 3: return [p, q, br];
case 4: return [t, p, br];
case 5: return [br, p, q];
}
}
return false;
}
});
String.implement({
rgbToHsb: function(){
var rgb = this.match(/\d{1,3}/g);
return (rgb) ? rgb.rgbToHsb() : null;
},
hsbToRgb: function(){
var hsb = this.match(/\d{1,3}/g);
return (hsb) ? hsb.hsbToRgb() : null;
}
});
})();
/*
---
script: Class.Occlude.js
name: Class.Occlude
description: Prevents a class from being applied to a DOM element twice.
license: MIT-style license.
authors:
- Aaron Newton
requires:
- Core/Class
- Core/Element
- MooTools.More
provides: [Class.Occlude]
...
*/
Class.Occlude = new Class({
occlude: function(property, element){
element = document.id(element || this.element);
var instance = element.retrieve(property || this.property);
if (instance && !this.occluded)
return (this.occluded = instance);
this.occluded = false;
element.store(property || this.property, this);
return this.occluded;
}
});
/*
---
script: HtmlTable.js
name: HtmlTable
description: Builds table elements with methods to add rows.
license: MIT-style license
authors:
- Aaron Newton
requires:
- Core/Options
- Core/Events
- Class.Occlude
provides: [HtmlTable]
...
*/
var HtmlTable = new Class({
Implements: [Options, Events, Class.Occlude],
options: {
properties: {
cellpadding: 0,
cellspacing: 0,
border: 0
},
rows: [],
headers: [],
footers: []
},
property: 'HtmlTable',
initialize: function(){
var params = Array.link(arguments, {options: Type.isObject, table: Type.isElement, id: Type.isString});
this.setOptions(params.options);
if (!params.table && params.id) params.table = document.id(params.id);
this.element = params.table || new Element('table', this.options.properties);
if (this.occlude()) return this.occluded;
this.build();
},
build: function(){
this.element.store('HtmlTable', this);
this.body = document.id(this.element.tBodies[0]) || new Element('tbody').inject(this.element);
$$(this.body.rows);
if (this.options.headers.length) this.setHeaders(this.options.headers);
else this.thead = document.id(this.element.tHead);
if (this.thead) this.head = this.getHead();
if (this.options.footers.length) this.setFooters(this.options.footers);
this.tfoot = document.id(this.element.tFoot);
if (this.tfoot) this.foot = document.id(this.tfoot.rows[0]);
this.options.rows.each(function(row){
this.push(row);
}, this);
},
toElement: function(){
return this.element;
},
empty: function(){
this.body.empty();
return this;
},
set: function(what, items){
var target = (what == 'headers') ? 'tHead' : 'tFoot',
lower = target.toLowerCase();
this[lower] = (document.id(this.element[target]) || new Element(lower).inject(this.element, 'top')).empty();
var data = this.push(items, {}, this[lower], what == 'headers' ? 'th' : 'td');
if (what == 'headers') this.head = this.getHead();
else this.foot = this.getHead();
return data;
},
getHead: function(){
var rows = this.thead.rows;
return rows.length > 1 ? $$(rows) : rows.length ? document.id(rows[0]) : false;
},
setHeaders: function(headers){
this.set('headers', headers);
return this;
},
setFooters: function(footers){
this.set('footers', footers);
return this;
},
update: function(tr, row, tag){
var tds = tr.getChildren(tag || 'td'), last = tds.length - 1;
row.each(function(data, index){
var td = tds[index] || new Element(tag || 'td').inject(tr),
content = ((data && Object.prototype.hasOwnProperty.call(data, 'content')) ? data.content : '') || data,
type = typeOf(content);
if (data && Object.prototype.hasOwnProperty.call(data, 'properties')) td.set(data.properties);
if (/(element(s?)|array|collection)/.test(type)) td.empty().adopt(content);
else td.set('html', content);
if (index > last) tds.push(td);
else tds[index] = td;
});
return {
tr: tr,
tds: tds
};
},
push: function(row, rowProperties, target, tag, where){
if (typeOf(row) == 'element' && row.get('tag') == 'tr'){
row.inject(target || this.body, where);
return {
tr: row,
tds: row.getChildren('td')
};
}
return this.update(new Element('tr', rowProperties).inject(target || this.body, where), row, tag);
},
pushMany: function(rows, rowProperties, target, tag, where){
return rows.map(function(row){
return this.push(row, rowProperties, target, tag, where);
}, this);
}
});
['adopt', 'inject', 'wraps', 'grab', 'replaces', 'dispose'].each(function(method){
HtmlTable.implement(method, function(){
this.element[method].apply(this.element, arguments);
return this;
});
});
/*
---
script: Element.Shortcuts.js
name: Element.Shortcuts
description: Extends the Element native object to include some shortcut methods.
license: MIT-style license
authors:
- Aaron Newton
requires:
- Core/Element.Style
- MooTools.More
provides: [Element.Shortcuts]
...
*/
Element.implement({
isDisplayed: function(){
return this.getStyle('display') != 'none';
},
isVisible: function(){
var w = this.offsetWidth,
h = this.offsetHeight;
return (w == 0 && h == 0) ? false : (w > 0 && h > 0) ? true : this.style.display != 'none';
},
toggle: function(){
return this[this.isDisplayed() ? 'hide' : 'show']();
},
hide: function(){
var d;
try {
//IE fails here if the element is not in the dom
d = this.getStyle('display');
} catch(e){}
if (d == 'none') return this;
return this.store('element:_originalDisplay', d || '').setStyle('display', 'none');
},
show: function(display){
if (!display && this.isDisplayed()) return this;
display = display || this.retrieve('element:_originalDisplay') || 'block';
return this.setStyle('display', (display == 'none') ? 'block' : display);
},
swapClass: function(remove, add){
return this.removeClass(remove).addClass(add);
}
});
Document.implement({
clearSelection: function(){
if (window.getSelection){
var selection = window.getSelection();
if (selection && selection.removeAllRanges) selection.removeAllRanges();
} else if (document.selection && document.selection.empty){
try {
//IE fails here if selected element is not in dom
document.selection.empty();
} catch(e){}
}
}
});
/*
---
script: Class.Refactor.js
name: Class.Refactor
description: Extends a class onto itself with new property, preserving any items attached to the class's namespace.
license: MIT-style license
authors:
- Aaron Newton
requires:
- Core/Class
- MooTools.More
# Some modules declare themselves dependent on Class.Refactor
provides: [Class.refactor, Class.Refactor]
...
*/
Class.refactor = function(original, refactors){
Object.each(refactors, function(item, name){
var origin = original.prototype[name];
origin = (origin && origin.$origin) || origin || function(){};
original.implement(name, (typeof item == 'function') ? function(){
var old = this.previous;
this.previous = origin;
var value = item.apply(this, arguments);
this.previous = old;
return value;
} : item);
});
return original;
};
/*
---
script: HtmlTable.Zebra.js
name: HtmlTable.Zebra
description: Builds a stripy table with methods to add rows.
license: MIT-style license
authors:
- Harald Kirschner
- Aaron Newton
requires:
- HtmlTable
- Element.Shortcuts
- Class.refactor
provides: [HtmlTable.Zebra]
...
*/
HtmlTable = Class.refactor(HtmlTable, {
options: {
classZebra: 'table-tr-odd',
zebra: true,
zebraOnlyVisibleRows: true
},
initialize: function(){
this.previous.apply(this, arguments);
if (this.occluded) return this.occluded;
if (this.options.zebra) this.updateZebras();
},
updateZebras: function(){
var index = 0;
Array.each(this.body.rows, function(row){
if (!this.options.zebraOnlyVisibleRows || row.isDisplayed()){
this.zebra(row, index++);
}
}, this);
},
setRowStyle: function(row, i){
if (this.previous) this.previous(row, i);
this.zebra(row, i);
},
zebra: function(row, i){
return row[((i % 2) ? 'remove' : 'add')+'Class'](this.options.classZebra);
},
push: function(){
var pushed = this.previous.apply(this, arguments);
if (this.options.zebra) this.updateZebras();
return pushed;
}
});
/*
---
script: Tips.js
name: Tips
description: Class for creating nice tips that follow the mouse cursor when hovering an element.
license: MIT-style license
authors:
- Valerio Proietti
- Christoph Pojer
- Luis Merino
requires:
- Core/Options
- Core/Events
- Core/Element.Event
- Core/Element.Style
- Core/Element.Dimensions
- MooTools.More
provides: [Tips]
...
*/
(function(){
var read = function(option, element){
return (option) ? (typeOf(option) == 'function' ? option(element) : element.get(option)) : '';
};
this.Tips = new Class({
Implements: [Events, Options],
options: {/*
id: null,
onAttach: function(element){},
onDetach: function(element){},
onBound: function(coords){},*/
onShow: function(){
this.tip.setStyle('display', 'block');
},
onHide: function(){
this.tip.setStyle('display', 'none');
},
title: 'title',
text: function(element){
return element.get('rel') || element.get('href');
},
showDelay: 100,
hideDelay: 100,
className: 'tip-wrap',
offset: {x: 16, y: 16},
windowPadding: {x:0, y:0},
fixed: false,
waiAria: true
},
initialize: function(){
var params = Array.link(arguments, {
options: Type.isObject,
elements: function(obj){
return obj != null;
}
});
this.setOptions(params.options);
if (params.elements) this.attach(params.elements);
this.container = new Element('div', {'class': 'tip'});
if (this.options.id){
this.container.set('id', this.options.id);
if (this.options.waiAria) this.attachWaiAria();
}
},
toElement: function(){
if (this.tip) return this.tip;
this.tip = new Element('div', {
'class': this.options.className,
styles: {
position: 'absolute',
top: 0,
left: 0
}
}).adopt(
new Element('div', {'class': 'tip-top'}),
this.container,
new Element('div', {'class': 'tip-bottom'})
);
return this.tip;
},
attachWaiAria: function(){
var id = this.options.id;
this.container.set('role', 'tooltip');
if (!this.waiAria){
this.waiAria = {
show: function(element){
if (id) element.set('aria-describedby', id);
this.container.set('aria-hidden', 'false');
},
hide: function(element){
if (id) element.erase('aria-describedby');
this.container.set('aria-hidden', 'true');
}
};
}
this.addEvents(this.waiAria);
},
detachWaiAria: function(){
if (this.waiAria){
this.container.erase('role');
this.container.erase('aria-hidden');
this.removeEvents(this.waiAria);
}
},
attach: function(elements){
$$(elements).each(function(element){
var title = read(this.options.title, element),
text = read(this.options.text, element);
element.set('title', '').store('tip:native', title).retrieve('tip:title', title);
element.retrieve('tip:text', text);
this.fireEvent('attach', [element]);
var events = ['enter', 'leave'];
if (!this.options.fixed) events.push('move');
events.each(function(value){
var event = element.retrieve('tip:' + value);
if (!event) event = function(event){
this['element' + value.capitalize()].apply(this, [event, element]);
}.bind(this);
element.store('tip:' + value, event).addEvent('mouse' + value, event);
}, this);
}, this);
return this;
},
detach: function(elements){
$$(elements).each(function(element){
['enter', 'leave', 'move'].each(function(value){
element.removeEvent('mouse' + value, element.retrieve('tip:' + value)).eliminate('tip:' + value);
});
this.fireEvent('detach', [element]);
if (this.options.title == 'title'){ // This is necessary to check if we can revert the title
var original = element.retrieve('tip:native');
if (original) element.set('title', original);
}
}, this);
return this;
},
elementEnter: function(event, element){
clearTimeout(this.timer);
this.timer = (function(){
this.container.empty();
['title', 'text'].each(function(value){
var content = element.retrieve('tip:' + value);
var div = this['_' + value + 'Element'] = new Element('div', {
'class': 'tip-' + value
}).inject(this.container);
if (content) this.fill(div, content);
}, this);
this.show(element);
this.position((this.options.fixed) ? {page: element.getPosition()} : event);
}).delay(this.options.showDelay, this);
},
elementLeave: function(event, element){
clearTimeout(this.timer);
this.timer = this.hide.delay(this.options.hideDelay, this, element);
this.fireForParent(event, element);
},
setTitle: function(title){
if (this._titleElement){
this._titleElement.empty();
this.fill(this._titleElement, title);
}
return this;
},
setText: function(text){
if (this._textElement){
this._textElement.empty();
this.fill(this._textElement, text);
}
return this;
},
fireForParent: function(event, element){
element = element.getParent();
if (!element || element == document.body) return;
if (element.retrieve('tip:enter')) element.fireEvent('mouseenter', event);
else this.fireForParent(event, element);
},
elementMove: function(event, element){
this.position(event);
},
position: function(event){
if (!this.tip) document.id(this);
var size = window.getSize(), scroll = window.getScroll(),
tip = {x: this.tip.offsetWidth, y: this.tip.offsetHeight},
props = {x: 'left', y: 'top'},
bounds = {y: false, x2: false, y2: false, x: false},
obj = {};
for (var z in props){
obj[props[z]] = event.page[z] + this.options.offset[z];
if (obj[props[z]] < 0) bounds[z] = true;
if ((obj[props[z]] + tip[z] - scroll[z]) > size[z] - this.options.windowPadding[z]){
obj[props[z]] = event.page[z] - this.options.offset[z] - tip[z];
bounds[z+'2'] = true;
}
}
this.fireEvent('bound', bounds);
this.tip.setStyles(obj);
},
fill: function(element, contents){
if (typeof contents == 'string') element.set('html', contents);
else element.adopt(contents);
},
show: function(element){
if (!this.tip) document.id(this);
if (!this.tip.getParent()) this.tip.inject(document.body);
this.fireEvent('show', [this.tip, element]);
},
hide: function(element){
if (!this.tip) document.id(this);
this.fireEvent('hide', [this.tip, element]);
}
});
})();
/* QScroller Copyright 2008 Massimo Giagnoni. All rights reserved.
Vesrion 1.0.1 (Mootools 1.11)
QScroller is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
var QScroller = new Class({
options: {
slides: 'qslide',
direction: 'h',
duration: 8000,
auto: false,
delay: 1000,
transition: Fx.Transitions.linear
},
initialize: function(wrapper,options) {
this.setOptions(options);
this.wrapper = $(wrapper);
this.wrapper.setStyles({
position: 'relative',
overflow: 'hidden'
});
//this.wrapper.addEvent('mouseenter', this.fireEvent.pass('onMouseEnter',this));
//this.wrapper.addEvent('mouseleave', this.fireEvent.pass('onMouseLeave',this));
this.slideOut = new Element('div').setStyles({
position: 'absolute',
overflow: 'hidden',
top: 0,
left: 0,
width: this.wrapper.getStyle('width'),
height: this.wrapper.getStyle('height')
}).injectInside(this.wrapper);
this.slideIn = this.slideOut.clone();
this.slideIn.injectInside(this.wrapper);
this.slides = $$('.'+this.options.slides);
this.auto = this.options.auto;
this.idxSlide = 0;
this.step = 0;
this.isFirst = true;
},
load: function() {
if(!this.isFirst) {
this.idxSlide += this.step;
if(this.idxSlide > this.slides.length-1) {
this.idxSlide = 0;
} else if(this.idxSlide < 0) {
this.idxSlide = this.slides.length-1;
}
}
this.curSlide = this.slides[this.idxSlide].clone();
this.show();
},
show: function() {
var slide = this.slideIn.getElement('div');
if(slide) {
slide.replaceWith(this.curSlide);
} else {
this.curSlide.injectInside(this.slideIn);
}
this.doEffect();
},
doEffect: function() {
this.fxOn = true;
var d = this.isFirst ? 0:this.options.duration;
var t = this.options.transition;
var inX = 0;
var inY = 0;
var outX = 0;
var outY = 0;
var ww = this.wrapper.getStyle('width').toInt();
var wh = this.wrapper.getStyle('height').toInt();
if(this.step > 0) {
if(this.options.direction == 'h') {
inX = ww;
outX = -ww;
} else {
inY = -wh;
outY = wh;
}
} else {
if(this.options.direction == 'h') {
inX = ww;
outX = -ww;
} else {
inY = wh;
outY = -wh;
}
}
if(this.isFirst) {
if(this.auto) {
this.step = 1;
}
this.isFirst = false;
if ( Browser.Engine.trident5 ) {
this.slideIn.destroy();
}
}
if ( this.slideIn ) {
this.slideIn.effects({
duration:d,
transition: t
}).start({
top: [inY, 0],
left: [inX, 0],
opacity: [1, 1]
});
}
this.slideOut.effects({
duration: d,
transition: t
}).start({
top: [0, outY],
left: [0, outX]
});
this.fxEnd.delay(d + 75, this);
},
fxEnd: function() {
this.fxOn = false;
this.swapSlides();
if(this.auto) {
$clear(this.timer);
this.timer = this.load.delay(this.options.delay, this);
}
},
swapSlides: function() {
this.slideOut.setStyles({
zIndex: 0,
opacity: 0
});
var t = this.slideOut;
this.slideOut =this.slideIn;
this.slideIn = t;
}
});
QScroller.implement(new Options, new Events);
/*
Script: dbug.js
A wrapper for Firebug console.* statements.
License:
http://clientside.cnet.com/wiki/cnet-libraries#license
*/
var dbug = {
logged: [],
timers: {},
firebug: false,
enabled: false,
log: function() {
dbug.logged.push(arguments);
},
nolog: function(msg) {
dbug.logged.push(arguments);
},
time: function(name){
dbug.timers[name] = new Date().getTime();
},
timeEnd: function(name){
if (dbug.timers[name]) {
var end = new Date().getTime() - dbug.timers[name];
dbug.timers[name] = false;
dbug.log('%s: %s', name, end);
} else dbug.log('no such timer: %s', name);
},
enable: function(silent) {
if(dbug.firebug) {
try {
dbug.enabled = true;
dbug.log = function(){
(console.debug || console.log).apply(console, arguments);
};
dbug.time = function(){
console.time.apply(console, arguments);
};
dbug.timeEnd = function(){
console.timeEnd.apply(console, arguments);
};
if(!silent) dbug.log('enabling dbug');
for(var i=0;i0 || debugCookie=='true') dbug.enable();
if(debugCookie=='true')dbug.log('debugging cookie enabled');
if(window.location.href.indexOf("jsdebugCookie=true")>0){
dbug.cookie();
if(!dbug.enabled)dbug.enable();
}
if(window.location.href.indexOf("jsdebugCookie=false")>0)dbug.disableCookie();
}
/*
Script: IframeShim.js
Defines IframeShim, a class for obscuring select lists and flash objects in IE.
License:
http://clientside.cnet.com/wiki/cnet-libraries#license
*/
var IframeShim = new Class({
Implements: [Options, Events],
options: {
name: '',
className:'iframeShim',
display:false,
zindex: null,
margin: 0,
offset: {
x: 0,
y: 0
},
browsers: (Browser.ie4 || (Browser.chrome && Browser.Platform.mac))
},
initialize: function (element, options){
this.setOptions(options);
/*legacy*/
if(this.options.offset && this.options.offset.top) this.options.offset.y = this.options.offset.top;
if(this.options.offset && this.options.offset.left) this.options.offset.x = this.options.offset.left;
this.element = $(element);
this.makeShim();
return;
},
makeShim: function(){
this.shim = new Element('iframe');
this.id = this.options.name || new Date().getTime() + "_shim";
if(this.element.getStyle('z-Index').toInt()<1 || isNaN(this.element.getStyle('z-Index').toInt()))
this.element.setStyle('z-Index',5);
var z = this.element.getStyle('z-Index')-1;
if($chk(this.options.zindex) &&
this.element.getStyle('z-Index').toInt() > this.options.zindex)
z = this.options.zindex;
this.shim.setStyles({
'position': 'absolute',
'zIndex': z,
'border': 'none',
'filter': 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'
}).setProperties({
'src':'javascript:void(0);',
'frameborder':'0',
'scrolling':'no',
'id':this.id
}).addClass(this.options.className);
this.element.store('shim', this);
var inject = function(){
this.shim.inject(this.element, 'after');
if(this.options.display) this.show();
else this.hide();
this.fireEvent('onInject');
};
if(this.options.browsers){
if(Browser.ie && !IframeShim.ready) {
window.addEvent('load', inject.bind(this));
} else {
inject.run(null, this);
}
}
},
position: function(shim){
if(!this.options.browsers || !IframeShim.ready) return this;
var before = this.element.getStyles('display', 'visibility', 'position');
this.element.setStyles({
display: 'block',
position: 'absolute',
visibility: 'hidden'
});
var size = this.element.getSize();
this.element.setStyles(before);
if(typeOf(this.options.margin)){
size.x = size.x-(this.options.margin*2);
size.y = size.y-(this.options.margin*2);
this.options.offset.x += this.options.margin;
this.options.offset.y += this.options.margin;
}
this.shim.setStyles({
'width': size.x,
'height': size.y
}).setPosition({
relativeTo: this.element,
offset: this.options.offset
});
return this;
},
hide: function(){
if(this.options.browsers) this.shim.setStyle('display','none');
return this;
},
show: function(){
if(!this.options.browsers) return this;
this.shim.setStyle('display','block');
return this.position();
},
dispose: function(){
if(this.options.browsers) this.shim.dispose();
return this;
}
});
window.addEvent('load', function(){
IframeShim.ready = true;
});
/*
Script: Element.Measure.js
Extends the Element native object to include methods useful in measuring dimensions.
License:
http://clientside.cnet.com/wiki/cnet-libraries#license
*/
Element.implement({
expose: function(){
if (this.getStyle('display') != 'none') return $empty;
var before = {};
var styles = { visibility: 'hidden', display: 'block', position:'absolute' };
/*use this method instead of getStyles*/
Object.each(styles, function(value, style){
before[style] = this.style[style]||'';
}, this);
/*this.getStyles('visibility', 'display', 'position');*/
this.setStyles(styles);
return (function(){ this.setStyles(before); }).bind(this);
},
getDimensions: function(options) {
options = Object.merge({computeSize: false},options);
var dim = {};
function getSize(el, options){
return (options.computeSize)?el.getComputedSize(options):el.getSize();
};
if(this.getStyle('display') == 'none'){
var restore = this.expose();
dim = getSize(this, options); /*works now, because the display isn't none*/
restore(); /*put it back where it was*/
} else {
try { /*safari sometimes crashes here, so catch it*/
dim = getSize(this, options);
}catch(e){}
}
return $chk(dim.x)?Object.append(dim, {width: dim.x, height: dim.y}):Object.append(dim, {x: dim.width, y: dim.height});
},
getComputedSize: function(options){
options = Object.merge({
styles: ['padding','border'],
plains: {height: ['top','bottom'], width: ['left','right']},
mode: 'both'
}, options);
var size = {width: 0,height: 0};
switch (options.mode){
case 'vertical':
delete size.width;
delete options.plains.width;
break;
case 'horizontal':
delete size.height;
delete options.plains.height;
break;
};
var getStyles = [];
/*this function might be useful in other places; perhaps it should be outside this function?*/
Object.each(options.plains, function(plain, key){
plain.each(function(edge){
options.styles.each(function(style){
getStyles.push((style=="border")?style+'-'+edge+'-'+'width':style+'-'+edge);
});
});
});
var styles = this.getStyles.apply(this, getStyles);
var subtracted = [];
Object.each(options.plains, function(plain, key){ /*keys: width, height, plains: ['left','right'], ['top','bottom']*/
size['total'+key.capitalize()] = 0;
size['computed'+key.capitalize()] = 0;
plain.each(function(edge){ /*top, left, right, bottom*/
size['computed'+edge.capitalize()] = 0;
getStyles.each(function(style,i){ /*padding, border, etc.*/
/*'padding-left'.test('left') size['totalWidth'] = size['width']+[padding-left]*/
if(style.test(edge)) {
styles[style] = styles[style].toInt(); /*styles['padding-left'] = 5;*/
if(isNaN(styles[style]))styles[style]=0;
size['total'+key.capitalize()] = size['total'+key.capitalize()]+styles[style];
size['computed'+edge.capitalize()] = size['computed'+edge.capitalize()]+styles[style];
}
/*if width != width (so, padding-left, for instance), then subtract that from the total*/
if(style.test(edge) && key!=style &&
(style.test('border') || style.test('padding')) && !subtracted.contains(style)) {
subtracted.push(style);
size['computed'+key.capitalize()] = size['computed'+key.capitalize()]-styles[style];
}
});
});
});
if($chk(size.width)) {
size.width = size.width+this.offsetWidth+size.computedWidth;
size.totalWidth = size.width + size.totalWidth;
delete size.computedWidth;
}
if($chk(size.height)) {
size.height = size.height+this.offsetHeight+size.computedHeight;
size.totalHeight = size.height + size.totalHeight;
delete size.computedHeight;
}
return Object.append(styles, size);
}
});
/*
Script: Element.Position.js
Extends the Element native object to include methods useful positioning elements relative to others.
License:
http://clientside.cnet.com/wiki/cnet-libraries#license
*/
Element.implement({
setPosition: function(options){
Object.each(options||{}, function(v, k){ if (!$defined(v)) delete options[k]; });
options = Object.merge({
relativeTo: document.body,
position: {
x: 'center', /*left, center, right*/
y: 'center' /*top, center, bottom*/
},
edge: false,
offset: {x:0,y:0},
returnPos: false,
relFixedPosition: false,
ignoreMargins: false
}, options);
/*compute the offset of the parent positioned element if this element is in one*/
var parentOffset = {x: 0, y: 0};
var parentPositioned = false;
var putItBack = this.expose();
var offsetParent = this.getOffsetParent();
putItBack();
if(offsetParent && offsetParent != this.getDocument().body) {
var putItBack = offsetParent.expose();
parentOffset = offsetParent.getPosition();
putItBack();
parentPositioned = true;
options.offset.x = options.offset.x - parentOffset.x;
options.offset.y = options.offset.y - parentOffset.y;
}
/*upperRight, bottomRight, centerRight, upperLeft, bottomLeft, centerLeft*/
/*topRight, topLeft, centerTop, centerBottom, center*/
function fixValue(option) {
if(typeOf(option) != "string") return option;
option = option.toLowerCase();
var val = {};
if(option.test('left')) val.x = 'left';
else if(option.test('right')) val.x = 'right';
else val.x = 'center';
if(option.test('upper')||option.test('top')) val.y = 'top';
else if (option.test('bottom')) val.y = 'bottom';
else val.y = 'center';
return val;
};
options.edge = fixValue(options.edge);
options.position = fixValue(options.position);
if(!options.edge) {
if(options.position.x == 'center' && options.position.y == 'center') options.edge = {x:'center',y:'center'};
else options.edge = {x:'left',y:'top'};
}
this.setStyle('position', 'absolute');
var rel = $(options.relativeTo) || document.body;
var top = (rel == document.body)?window.getScroll().y:rel.getPosition().y;
var left = (rel == document.body)?window.getScroll().x:rel.getPosition().x;
if (top < 0) top = 0;
if (left < 0) left = 0;
var dim = this.getDimensions({computeSize: true, styles:['padding', 'border','margin']});
if (options.ignoreMargins) {
options.offset.x = options.offset.x - parentOffset.x - offsetParent.getStyle('border-left-width').toInt()||0;
options.offset.y = options.offset.y - parentOffset.y - offsetParent.getStyle('border-top-width').toInt()||0;
}
var pos = {};
var prefY = options.offset.y.toInt();
var prefX = options.offset.x.toInt();
switch(options.position.x) {
case 'left':
pos.x = left + prefX;
break;
case 'right':
pos.x = left + prefX + rel.offsetWidth;
break;
default: /*center*/
pos.x = left + (((rel == document.body)?window.getSize().x:rel.offsetWidth)/2) + prefX;
break;
};
switch(options.position.y) {
case 'top':
pos.y = top + prefY;
break;
case 'bottom':
pos.y = top + prefY + rel.offsetHeight;
break;
default: /*center*/
pos.y = top + (((rel == document.body)?window.getSize().y:rel.offsetHeight)/2) + prefY;
break;
};
if(options.edge){
var edgeOffset = {};
switch(options.edge.x) {
case 'left':
edgeOffset.x = 0;
break;
case 'right':
edgeOffset.x = -dim.x-dim.computedRight-dim.computedLeft;
break;
default: /*center*/
edgeOffset.x = -(dim.x/2);
break;
};
switch(options.edge.y) {
case 'top':
edgeOffset.y = 0;
break;
case 'bottom':
edgeOffset.y = -dim.y-dim.computedTop-dim.computedBottom;
break;
default: /*center*/
edgeOffset.y = -(dim.y/2);
break;
};
pos.x = pos.x+edgeOffset.x;
pos.y = pos.y+edgeOffset.y;
}
pos = {
left: ((pos.x >= 0 || parentPositioned)?pos.x:0).toInt(),
top: ((pos.y >= 0 || parentPositioned)?pos.y:0).toInt()
};
if(rel.getStyle('position') == "fixed"||options.relFixedPosition) {
pos.top = pos.top.toInt() + window.getScroll().y;
pos.left = pos.left.toInt() + window.getScroll().x;
}
if(options.returnPos) return pos;
else this.setStyles(pos);
return this;
}
});
/*
Script: Element.Shortcuts.js
Extends the Element native object to include some shortcut methods.
License:
http://clientside.cnet.com/wiki/cnet-libraries#license
*/
Element.implement({
isVisible: function() {
return this.getStyle('display') != 'none';
},
toggle: function() {
return this[this.isVisible() ? 'hide' : 'show']();
},
hide: function() {
var d;
try {
/*IE fails here if the element is not in the dom*/
d = this.getStyle('display');
} catch(e){}
this.store('originalDisplay', d||'block');
this.setStyle('display','none');
return this;
},
show: function(display) {
original = this.retrieve('originalDisplay')?this.retrieve('originalDisplay'):this.get('originalDisplay');
this.setStyle('display',(display || original || 'block'));
return this;
},
swapClass: function(remove, add) {
return this.removeClass(remove).addClass(add);
},
/*TODO*/
/*DO NOT USE THIS METHOD*/
/*it is temporary, as Mootools 1.1 will negate its requirement*/
fxOpacityOk: function(){
return !Browser.ie4;
}
});
/*
Script: DatePickerTop.js
Autor:
IntraCOM,
Info:
Adaptacja skryptu DatePicker, użytego do wyboru daty w polach input.
*/
var DatePickerTop = new Class({
Implements: [Options,Events],
options: {
onShow: function(dp){
dp.setStyle('visibility', 'visible');
},
onHide: function(dp){
dp.setStyle('visibility', 'hidden');
},
data : false,
container : 't_kalendarz_tresc',
bName : 'menu1_mc',
bPrev : 't_miesiac_prev',
bNext : 't_miesiac_next',
className : 'DatePicker',
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
monthNames: ['Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpień', 'Wrzesień', 'Październik', 'Listopad', 'Grudzień'],
dayNames : ['Niedziela', 'Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota'],
format: 'yyyy-mm-dd',
yearStart: (new Date().getFullYear() - 60),
yearRange: 61,
yearOrder: 'asc',
offsets: {'x':2, 'y':0},
width: 190,
delay: 100,
zIndex: 99999
},
/* setup the new DatePicker */
initialize: function(el, options){
this.setOptions(options);
if ( ! $(this.options.container) && ! el ) { return; }
this.bName = $(this.options.bName);
this.bPrev = $(this.options.bPrev);
this.bNext = $(this.options.bNext);
if ( this.options.data == false ) {
d = new Date(); this.year = d.getFullYear(); this.month = d.getMonth(); this.day = d.getDate();
}
else {
d = this.options.data.split('-'); this.year = d[0].toInt(); (this.month = d[1].toInt() - 1); this.day = d[2].toInt();
}
this.cur_year = this.year;
this.cur_month = this.month;
if ( el ) {
this.active = false;
if (el.value.length > 9){
switch (this.options.format){
case 'mm/dd/yyyy': d = el.value.split('/'); this.year = d[2].toInt(); (this.month = d[0].toInt() - 1); this.day = d[1].toInt(); break;
case 'yyyy-mm-dd': d = el.value.split('-'); this.year = d[0].toInt(); (this.month = d[1].toInt() - 1); this.day = d[2].toInt(); break;
case 'yyyy.mm.dd': d = el.value.split('.'); this.year = d[0].toInt(); (this.month = d[1].toInt() - 1); this.day = d[2].toInt(); break;
case 'mm.dd.yyyy': d = el.value.split('.'); this.year = d[2].toInt(); (this.month = d[0].toInt() - 1); this.day = d[1].toInt(); break;
default: d = new Date(); this.year = d.getFullYear(); this.month = d.getMonth(); this.day = d.getDate(); break;
}
} else {
d = new Date(); this.year = d.getFullYear(); this.month = d.getMonth(); this.day = d.getDate();
}
this.dp = new Element('div', {
'class': this.options.className + '-Container',
'styles': {
'position':'absolute',
'top':'0px',
'left':'0px',
'z-index':this.options.zIndex,
'visibility':'hidden'
}
}).inject(document.body);
this.wrapper = new Element('div', {
'class':this.options.className + '-Wrapper',
'styles': {
'position':'absolute',
'min-width':this.options.width + 'px'
}
}).inject(this.dp);
}
this.setup(el);
},
/* setup the calendar */
setup: function(el){
if ( el ) {
this.setupEl(el);
return;
}
/*następny miesiąc*/
this.bNext.addEvent('click', function() {
if ( this.month == 11 ) {
this.month = 0;
this.year = this.year + 1;
}
else {
this.month = this.month + 1;
}
this.build();
}.bind(this));
/*poprzedni miesiąc*/
this.bPrev.addEvent('click', function() {
if ( this.month == 0 ) {
this.month = 11;
this.year = this.year - 1;
}
else {
this.month = this.month - 1;
}
this.build();
}.bind(this));
/*bieżący miesiąc*/
this.bName.addEvent('click', function() {
if ( this.year == this.cur_year && this.month == this.cur_month ) {
return;
}
this.year = this.cur_year;
this.month = this.cur_month;
this.build();
}.bind(this));
this.build();
},
setupEl: function(el){
el.addEvent('click', function(){
this.position(el);
this.build(el);
}.bind(this));
var destroy = this.destroy.bind(this);
this.dp.addEvent('mouseleave', destroy);
},
/* build the calendar */
build: function(el){
if ( el ) {
this.buildEl(el);
return;
}
date = new Date();
date.setFullYear(this.year, this.month, 1);
this.year % 4 == 0 ? this.options.daysInMonth[1] = 29 : this.options.daysInMonth[1] = 28;
var firstDay = (date.getDay()==0) ? -5 : 2 - date.getDay();
/* start creating calendar */
$(this.options.bName).set('html', this.options.monthNames[this.month]+' '+this.year+'');
calTableTbody = $(this.options.container);
calTableTbody.empty();
/* create the day cells */
date2 = new Date();
while (firstDay <= this.options.daysInMonth[this.month]){
calDayRow = new Element('tr').inject(calTableTbody);
for (i = 0; i < 7; i++){
klasa = ( i == 6 ) ? 'dzien niedziela' : 'dzien';
if ((firstDay <= this.options.daysInMonth[this.month]) && (firstDay > 0))
{
this.day = firstDay;
da = this.biezacaData();
calDayCell = new Element('td', {'class':klasa, 'styles':{'text-align':'center'}, 'title':da, 'id':'t_'+da}).set('html', firstDay).inject(calDayRow);
if (date2.getFullYear() == this.year && date2.getMonth() == this.month && date2.getDate() == firstDay) calDayCell.addClass('dzis');
}
else {
calDayCell = new Element('td', {'class':'none'}).set('html', ' ').inject(calDayRow);
}
firstDay++;
}
}
/* pobierz zadania z danego miesiąca */
var url = '/ajax/kalendarium/lista_wydarzen/' + this.biezacaData() + '.html';
new XHR(url, {
method: 'get',
useWaiter: true,
waiterOptions: {},
waiterTarget: this.options.container,
onComplete: function(a) {
if ( a == '' ) {
return;
}
a = a.split(''); /* bo 1,2,...
wyd1
wyd2
...*/
// legenda
if ( a[2] && $('kalendarium-legenda') && $('kalendarium-legenda').get('html') == '' ) {
$('kalendarium-legenda').set('html', a[2]);
}
var dni = a[0].split(',');
var newsy = a[1].split('');
dni.each(function(d){
this.day = d;
var dz = this.biezacaData();
var td = $('t_'+dz);
if ( td )
{
/* dodaj tekst do tips-a*/
var txt = '';
for(i=0; i (this.options.yearStart - this.options.yearRange - 1); y--){
yearSel.options[i] = new Option(y, y);
if (this.year == y) yearSel.options[i].selected = true;
i++;
}
} else {
for (var y = this.options.yearStart; y < (this.options.yearStart + this.options.yearRange + 1); y++){
yearSel.options[i] = new Option(y, y);
if (this.year == y) yearSel.options[i].selected = true;
i++;
}
}
/** start creating calendar */
calTable = new Element('table', {'styles':{'width':'100%'}}).inject(this.wrapper);
calTableTbody = new Element('tbody').inject(calTable);
new Element('tr').adopt(new Element('td', {'class':'nav', 'styles':{'text-align':'center'}, 'colspan':'7'}).adopt(btnPrev).adopt(monthSel).adopt(yearSel).adopt(btnNext)).inject(calTableTbody);
/** create day names */
calDayNameRow = new Element('tr').inject(calTableTbody);
for (var i = 0; i < this.options.dayNames.length; i++){
//klasa = ( i == 0 ) ? 'dayName n' : 'dayName';
klasa = 'dayName';
nazwa = (i<6) ? this.options.dayNames[i+1].substr(0, 1) : this.options.dayNames[0].substr(0, 1);
calDayNameCell = new Element('td', {'class':klasa, 'styles':{'text-align':'center', 'width':'14%'}}).set('text', nazwa).inject(calDayNameRow);
}
/** create the day cells */
date2 = new Date();
while (firstDay <= this.options.daysInMonth[this.month]){
calDayRow = new Element('tr').inject(calTableTbody);
for (i = 0; i < 7; i++){
klasa = ( i == 6 ) ? 'day n' : 'day';
if ((firstDay <= this.options.daysInMonth[this.month]) && (firstDay > 0)){
calDayCell = new Element('td', {'class':klasa, 'styles':{'cursor':'pointer', 'text-align':'center'}, 'axis':this.year + '-' + (this.month + 1) + '-' + firstDay}).set('text', firstDay).inject(calDayRow);
if (date2.getFullYear() == this.year && date2.getMonth() == this.month && date2.getDate() == firstDay) calDayCell.addClass('current');
} else {
calDayCell = new Element('td', {'class':'empty'}).set('text', ' ').inject(calDayRow);
}
firstDay++;
}
}
/** set the onclick events for all calendar days */
$$('div.DatePicker-Wrapper td.day').each(function(d){
d.onclick = function(){
ds = d.axis.split('-');
el.value = this.formatValue(ds[0], ds[1], ds[2]);
if ( el.retrieve('tmp_val') ) {
el.setStyle('color', 'windowtext');
}
this.hide();
}.bind(this);
}.bind(this));
/** ukrywanie kalendarza */
document.addEvent('click', function() {
if (!this.active) this.fireEvent('onHide', [this.dp]);
}.bind(this));
/** set the onchange event for the month & year select boxes */
monthSel.onfocus = function(){ this.active = true; }.bind(this);
monthSel.onblur = function(){ this.active = false; }.bind(this);
monthSel.onchange = function(){
this.month = monthSel.value.toInt();
this.year = yearSel.value.toInt();
this.active = false;
this.build(el);
}.bind(this);
yearSel.onfocus = function(){ this.active = true; }.bind(this);
yearSel.onblur = function(){ this.active = false; }.bind(this);
yearSel.onchange = function(){
this.month = monthSel.value.toInt();
this.year = yearSel.value.toInt();
this.active = false;
this.build(el);
}.bind(this);
this.timer = this.show.delay(this.options.delay, this);
this.wrapper.getChildren().addEvent('click', function(e) {
e.stopPropagation();
});
},
nextMonth: function(el){
if ( this.month == 11 ) {
this.month = 0;
this.year = this.year + 1;
}
else {
this.month++;
}
this.active = false;
this.build(el);
},
prevMonth: function(el){
if ( this.month == 0 ) {
this.month = 11;
this.year = this.year - 1;
}
else {
this.month--;
}
this.active = false;
this.build(el);
},
/* ustaw aktywny dzień */
biezacaData: function(){
var da = this.year + '-';
da += (this.month+1<10) ? '0'+(this.month+1) : (this.month+1);
da += '-';
da += (this.day<10) ? '0'+this.day : this.day;
return da;
},
/* ustaw aktywny dzień */
setActive: function(td){
if ( this.active ) {
this.active.removeClass('active');
}
this.active = td;
this.active.addClass('active');
},
/* destroy the calendar */
destroy: function(event){
clearInterval(this.timer);
this.timer = this.hide.delay(this.options.delay, this);
},
/* position the calendar */
position: function(el){
this.coords = el.getCoordinates();
this.dp.setStyles({'top':(this.coords.top + this.options.offsets.y) + 'px', 'left':(this.coords.left + this.options.offsets.x) + 'px', 'width':this.coords.width + 'px', 'padding-top': this.coords.height + 'px'});
},
/* show the calendar */
show: function(){
this.fireEvent('onShow', [this.dp]);
},
/* hide the calendar */
hide: function(){
if (!this.active) this.fireEvent('onHide', [this.dp]);
},
/* format the returning date value */
formatValue: function(year, month, day){
var dateStr = '';
if (day < 10) { day = '0' + day; }
if (month < 10) { month = '0' + month; }
dateStr = this.options.format.replace( /dd/i, day ).replace( /mm/i, month ).replace( /yyyy/i, year );
this.month = month.toInt() - 1;
this.year = year.toInt();
return dateStr;
}
});
/* Script: Waiter.js
Adds a semi-transparent overlay over a dom element with a spinnin ajax icon.
Author:
Aaron Newton - aaron [dot] newton [at] cnet [dot] com
Class: Waiter
Adds a semi-transparent overlay over a dom element with a spinnin ajax icon.
Arguments:
target - (dom element or id) the dom element to overlay; defaults to document.body
options - (object) a key/value set of options
Options:
baseHref - (string) url prefix for the img src (see below); defaults to
'http://www.cnet.com/html/rb/assets/global/waiter/'
img - (object) options for the image (see below)
imgPosition - (object) options passed to for the image; relativeTo is set to the target above automatically.
layer - (object) options for the overlay layer (see below)
fxOptions - (object) options passed to the effects used to transition the overlay and the image opacity
img options:
Properties passed to the element instantiation.
(start code)
//default values
img: {
src: 'waiter.gif',
id: 'waitingImg',
styles: {
position: 'absolute',
width: 24,
height: 24,
display: 'none',
opacity: 0,
zIndex: 999
}
}
(end)
layer options:
Properties passed to the element instantiation.
(start code)
//default values
layer:{
id: 'waitingDiv',
background: '#fff',
opacity: 0.8
}
(end)
*/
var Waiter = new Class({
options: {
baseHref: 'pics/',
containerProps: {
styles: {
position: 'absolute',
display: 'none',
opacity: 0,
zIndex: 999
}
},
msg: false,
msgProps: {
styles: {
textAlign: 'center',
fontWeight: 'bold'
}
},
img: {
src: 'bigWaiting.gif',
styles: {
width: 32,
height: 32
}
},
imgPosition: {},
layer:{
styles: {
width: 0,
height: 0,
position: 'absolute',
zIndex: 999,
display: 'none',
opacity: 0.2,
background: '#fff'
},
'class': 'waitingDiv'
},
fxOptions: {}
},
initialize: function(target, options){
this.target = $(target||document.body);
this.setOptions(options);
this.waiterMsg = new Element('div', this.options.containerProps).injectInside(document.body).addClass("waiterDiv");
if (this.options.msg) this.waiterMsg.adopt(new Element('div', this.options.msgProps).appendText(this.options.msg));
this.waiterImg = $(this.options.img.id) || new Element('img', $merge(this.options.img, {
src: this.options.baseHref + this.options.img.src
})).injectInside(this.waiterMsg).addClass('waiterImg');
this.waiterDiv = $(this.options.layer.id) || new Element('div', this.options.layer).injectInside(document.body);
this.waiterFx = this.waiterFx || new Fx.Elements($$(this.waiterMsg, this.waiterDiv), this.options.fxOptions);
},
/* Property: toggle
Toggles the waiter over the specified element. If the waiter is currently showing over the specified element, it will hide. Otherwise it will
*/
toggle: function(element, show) {
//the element or the default
element = $(element) || $(this.active) || $(this.target);
if (!$(element)) return this;
if (this.active && element != this.active) return this.stop(this.start.bind(this, element));
//if it's not active or show is explicit
//or show is not explicitly set to false
//start the effect
if((!this.active || show) && show !== false) this.start(element);
//else if it's active and show isn't explicitly set to true
//stop the effect
else if(this.active && !show) this.stop();
return this;
},
reset: function(){
this.waiterFx.stop().set({
0: { opacity:[0]},
1: { opacity:[0]}
});
},
start: function(element){
this.reset();
element = $(element) || $(this.target);
var start = function() {
var dim = element.getComputedSize();
this.active = element;
this.waiterMsg.setPosition($merge(this.options.imgPosition, {
relativeTo: element
})).show();
this.waiterDiv.setStyles({
width: dim.totalWidth,
height: dim.totalHeight,
display: 'block'
}).setPosition({
relativeTo: element,
position: 'upperLeft'
});
this.waiterFx.start({
0: { opacity:[1] },
1: { opacity:[this.options.layer.styles.opacity]}
}).chain(function(){
//if (this.acive == element) this.fireEvent('onShow', element);
//this.callChain();
}.bind(this));
}.bind(this);
if (this.active && this.active != element) this.stop(start);
else start();
return this;
},
stop: function(callback){
if (!this.active) {
if ($type(callback) == "function") callback.attempt();
return this;
}
this.waiterFx.stop();
this.waiterFx.clearChain();
//fade the waiter out
this.waiterFx.start({
0: { opacity:[0]},
1: { opacity:[0]}
}).chain(function(){
this.active = null;
this.waiterDiv.hide();
this.waiterMsg.hide();
//this.fireEvent('onHide', this.active);
//this.callChain();
//this.clearChain();
if ($type(callback) == "function") callback.attempt();
}.bind(this));
return this;
}
});
Waiter.implement(new Options, new Events, new Chain);
/* Class: Ajax
Extends functionality from into .
Additional Options:
useWaiter - (boolean) if true will automatically apply a to the update target; defaults to false. Note: if you do not specify a value for update option this is ignored.
waiterOptions - (object) options value passed on to class.
waiterTarget - (element) if specified, the Waiter will overlay this element, otherwise it uses the update target specified in the ajax options.
*/
if (typeof Ajax != "undefined") {
var Ajax = new Class ({
Extends: Ajax,
options: {
useWaiter: false,
waiterOptions: {},
waiterTarget: false
},
initialize: function(url, options){
this.parent(url, options);
if (this.options.useWaiter && ($(this.options.update) || $(this.options.waiterTarget))) {
this.waiter = new Waiter(this.options.waiterTarget || this.options.update, this.options.waiterOptions);
this.addEvent('onComplete', this.waiter.stop.bind(this.waiter));
this.addEvent('onFailure', this.waiter.stop.bind(this.waiter));
this.addEvent('onRequest', this.waiter.start.bind(this.waiter));
}
}/*,
request: function(data) {
if (this.waiter) this.waiter.start().chain(this.parent(data));
else this.parent(data);
return this;
}*/
});
}
/**************************************************************
Script : Overlay
Version : 2.0.4
Authors : Samuel Birch
Desc : Covers the window with a semi-transparent layer.
Licence : Open Source MIT Licence
Modified : Liam Smart (liam_smart@hotmail.com) - MooTools 1.2 upgrade
**************************************************************/
//start overlay class
var Overlay = new Class({
//implements
Implements: Options,
//options
options:{
colour: '#000',//background color of overlay
opacity: 0.7,//opacity of overlay
zIndex: 100,//the z-index of the overlay (needs to lower than multiBox pop-up)
onClick: new Class()//make sure new class is loaded
},
//initialization
initialize: function(options){
//set options
this.setOptions(options);
//start building overlay
this.container = new Element('div', {
'id': 'OverlayContainer',
'styles': {
position: 'absolute',
left: 0,
top: 0,
width: '100%',
visibility: 'hidden',
overflow: 'hidden',
zIndex: this.options.zIndex,
opacity: 0
}
}).inject(this.options.container);
this.iframe = new Element('iframe', {
'id': 'OverlayIframe',
'name': 'OverlayIframe',
'src': 'javascript:void(0);',
'frameborder': 0,
'scrolling': 'no',
'styles': {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
filter: 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)',
opacity: 0,
zIndex: 101
}
}).inject(this.container);
this.overlay = new Element('div', {
'id': 'Overlay',
'styles': {
position: 'absolute',
left: 0,
top: 0,
width: '100%',
height: '100%',
zIndex: 102,
backgroundColor: this.options.colour
}
}).inject(this.container);
this.container.addEvent('click', function(){
this.options.onClick();
}.bind(this));
this.fade = new Fx.Morph(this.container);
this.position();
//make sure overlay is resized when browser is
window.addEvent('resize',this.position.bind(this));
},
position: function(){
if(this.options.container == document.body){
this.container.setStyles({
height: window.getScrollSize().y,
width: window.getScrollSize().x
});
}else{
var myCoords = this.options.container.getCoordinates();
this.container.setStyles({
top: myCoords.top,
height: myCoords.height,
left: myCoords.left,
width: myCoords.width
});
};
},
show: function(){
this.fade.start({
visibility: 'visible',
opacity: this.options.opacity
}).chain(function(){
//visibility: 'hidden'
//this.container.setStyle('visibility', 'visible');
}.bind(this));
},
hide: function(){
this.fade.start({
opacity: 0
}).chain(function() {
//visibility: 'hidden'
this.container.setStyle('visibility', 'hidden');
}.bind(this));
}
});
/**************************************************************
Script : multiBox
Version : 2.0.6
Authors : Samuel Birch
Desc : Supports jpg, gif, png, flash, flv, mov, wmv, mp3, html, iframe
Licence : Open Source MIT Licence
Modified : Liam Smart (liam_smart@hotmail.com) - MooTools 1.2 upgrade
Usage : window.addEvent('domready', function(){
//call multiBox
var initMultiBox = new multiBox({
mbClass: '.mb',//class you need to add links that you want to trigger multiBox with (remember and update CSS files)
container: $(document.body),//where to inject multiBox
descClassName: 'multiBoxDesc',//the class name of the description divs
path: './Files/',//path to mp3 and flv players
useOverlay: true,//use a semi-transparent background. default: false;
maxSize: {w:600, h:400},//max dimensions (width,height) - set to null to disable resizing
addDownload: true,//do you want the files to be downloadable?
pathToDownloadScript: './Scripts/forceDownload.asp',//if above is true, specify path to download script (classicASP and ASP.NET versions included)
addRollover: true,//add rollover fade to each multibox link
addOverlayIcon: true,//adds overlay icons to images within multibox links
addChain: true,//cycle through all images fading them out then in
recalcTop: true,//subtract the height of controls panel from top position
addTips: true,//adds MooTools built in 'Tips' class to each element (see: http://mootools.net/docs/Plugins/Tips)
autoOpen: 0//to auto open a multiBox element on page load change to (1, 2, or 3 etc)
});
});
**************************************************************/
//start multiBox class
var multiBox = new Class({
//implements
Implements: Options,
//options
options:{
initialSize: {w:250, h:250},//initial width/height the box will open at before resizing
useOverlay: false,//do you want to use a semi-transparent background?
contentColor: '#fff',//background colour of the content holder within the pop-up
showNumbers: true,//show numbers such as "4 of 12"
showControls: true,//show the previous/next, title, download etc
descClassName: false,//class of description box
movieSize: {w:400, h:300},//default width/height of movie
offset: {x:0, y:0},//offset multiBox position
fixedTop: false,//force multiBox to open at top of page
path: 'flash/',//path to mp3player and flvplayer etc
openFromLink: true,//pop-up will slide in from the position of the element clicked
useKeyboard: true//allow keyboard shortcuts (esc: close, spacebar & right arrow: next, left arrow: previous)
},
//initialization
initialize: function(options){
//set options
this.setOptions(options);
//set variables
this.openClosePos = {};
this.contentToLoad = {};
this.contentObj = {};
this.containerDefaults = {};
this.multiBox = [];
this.families = [];
this.content = [];
this.timer = 0;
this.index = 0;
this.opened = false;
this.currentGallery = null;
//start multiBox
//alert(this.options.mbClass+" - "+$$(this.options.mbClass).length);
if($$(this.options.mbClass).length > 0){this.start();};
},
//start multiBox
start: function(){
//there will be no next/previous buttons unless you specify them to a group
Array.each($$(this.options.mbClass), function(el){
//we must store original rel & title values to use later
if($chk(el.get('rel'))){
el.store('origRel',el.get('rel'));
};
if($chk(el.get('title'))){
el.store('origTitle',el.get('title'));
};
//check if it has a rel="[group]"
if(el.rel.test(/\[*?]/i)){
//if there are more than 1 rel value, we need to split them to find our group
if(el.get('rel').contains(',')){
//split then loop through each array instance of the split rel's
var tempArr = el.get('rel').split(',');
Array.each(tempArr, function(temp,i){
if(temp.contains('[')){//only take out the rel relating to a [group]
//change this links relation to the temp variable
el.set('rel',temp);
};
},this);
};
//if rel isnt already in fanilies then create a new instance for it
this.families.include(el.get('rel'));
};
//finally now we have put them into families, push each link with 'mbClass' into multiBox array
this.multiBox.push(el);
},this);
//loop through each mb link seperating content into groups of families
Array.each(this.multiBox, function(el){
//check rel contains a group
if(el.rel.test(/\[*?]/i)){
//we know the link has a group so loop through each family to find where it belongs
Array.each(this.families, function(fam,i){
//if the rel belongs to a family we make sure its pushed into correct family array within content array
if(el.get('rel') == fam){
//if there isnt a family array within content array to hold this family create one
if(!this.content[i]){
//create new gallery
this.content[i] = [];
};
//finally push link into appropriate family within content array
this.content[i].push(el);
};
},this);
};
},this);
//loop through each mb link seperating content into groups of families
Array.each(this.multiBox, function(el){
//check rel DOESNT contain a group
if(el.rel.test(/\[*?]/i) == false){
//add link into content array as a single array as it doesnt belong to a family
this.content.push([el]);
};
},this);
this.container = new Element('div').addClass('MultiBoxContainer').inject(this.options.container);
this.iframe = new Element('iframe', {
'id': 'multiBoxIframe',
'name': 'mulitBoxIframe',
'src': 'javascript:void(0);',
'frameborder': 0,
'scrolling': 'no',
'styles': {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
filter: 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)',
opacity: 0
}
}).inject(this.container);
this.box = new Element('div').addClass('MultiBoxContent').inject(this.container);
this.closeButton = new Element('div').addClass('MultiBoxClose').inject(this.container).addEvent('click', this.close.bind(this));
this.controlsContainer = new Element('div').addClass('MultiBoxControlsContainer').inject(this.container);
this.controls = new Element('div').addClass('MultiBoxControls').inject(this.controlsContainer);
this.previousButton = new Element('div').addClass('MultiBoxPrevious').inject(this.controls).addEvent('click', this.previous.bind(this));
this.nextButton = new Element('div').addClass('MultiBoxNext').inject(this.controls).addEvent('click', this.next.bind(this));
this.title = new Element('div').addClass('MultiBoxTitle').inject(this.controls);
this.number = new Element('div').addClass('MultiBoxNumber').inject(this.controls);
this.description = new Element('div').addClass('MultiBoxDescription').inject(this.controls);
//check user options and call functions accordingly
if(this.options.useKeyboard){
$(window.document).addEvent('keydown',function(e){
if(e.key == 'right' || e.key == 'space'){
this.next();
}else if(e.key == 'left'){
this.previous();
}else if(e.key == 'esc'){
this.close();
};
}.bind(this));
};
if(this.options.useOverlay){
this.overlay = new Overlay({
container:this.options.container,
onClick:this.close.bind(this)
});
};
if(this.options.addOverlayIcon == true){
this.addOverlayIcon(this.multiBox);
};
if(this.options.addRollover == true){
this.addRollover(this.multiBox);
};
if(this.options.addChain == true){
this.addChain(this.multiBox);
};
if(this.options.descClassName){
this.descriptions = $$('.'+this.options.descClassName);
};
if(this.options.addDownload == true){
this.addDownload(this.multiBox);
};
if(this.options.addTips == true){
this.addTips(this.multiBox);
};
//if there is only one multiBox link don't show unneccesary buttons
if(this.multiBox.length == 1){
this.title.setStyle('margin-left',0);
this.description.setStyle('margin-left',0);
this.previousButton.setStyle('display','none');
this.nextButton.setStyle('display','none');
this.number.setStyle('display','none');
};
new Element('div').setStyle('clear','both').inject(this.controls);
//start breaking into content array to add event listeners to each link within each group
Array.each(this.content, function(el,i){
//now we are left with each group as arrays
el.each(function(group,i){
//add event listener
group.addEvent('click', function(e){
var myTarget = ($(e.target).match('a')) ? $(e.target) : $(e.target).getParent('a');
e.preventDefault();
this.open(el.indexOf(myTarget),el);
}.bind(this));
//check to see if link is an HTML element
if(group.href.indexOf('#') > -1){
//grab it as an object
group.content = $(group.href.substr(group.href.indexOf('#')+1));
//hide the object
if(group.content){
group.content.setStyle('display','none');
};
};
},this);
},this);
this.containerEffects = new Fx.Morph(this.container,{duration:400,transition:Fx.Transitions.Sine.easeOut});
this.controlEffects = new Fx.Morph(this.controlsContainer,{duration:300});
this.reset();
//auto open a multiBox element
if(this.options.autoOpen > 0){
this.autoOpen(this.multiBox);
};
},
setContentType: function(element){
var str = element.href.substr(element.href.lastIndexOf('.')+1).toLowerCase();
var myRel = element.retrieve('origRel');
var contentOptions = {};
//retrieve original rel values and make sure there was one
if($chk(myRel)){
//split the options just incase there are more than 1
var optArr = myRel.split(',');
optArr.each(function(el){
//make sure the group is ignored
if(el.test(/\[*?]/i) != true){
var ta = el.split(':');
contentOptions[ta[0]] = ta[1];
};
});
};
if(contentOptions.type != undefined){
str = contentOptions.type;
};
this.contentObj.url = element.href;
this.contentObj.xH = 0;
if(contentOptions.width){
this.contentObj.width = contentOptions.width;
}else{
this.contentObj.width = this.options.movieSize.w;
};
if(contentOptions.height){
this.contentObj.height = contentOptions.height;
}else{
this.contentObj.height = this.options.movieSize.h;
};
if(contentOptions.panel){
this.panelPosition = contentOptions.panel;
}else{
this.panelPosition = this.options.panel;
};
switch(str){
case 'jpg':
case 'gif':
case 'png':
this.type = 'image';
break;
case 'swf':
this.type = 'flash';
break;
case 'flv':
this.type = 'flashVideo';
this.contentObj.xH = 70;
break;
case 'mov':
this.type = 'quicktime';
break;
case 'wmv':
this.type = 'windowsMedia';
break;
case 'rv':
case 'rm':
case 'rmvb':
this.type = 'real';
break;
case 'mp3':
this.type = 'flashMp3';
this.contentObj.width = 320;
this.contentObj.height = 70;
break;
case 'element':
this.type = 'htmlelement';
this.elementContent = element.content;
this.elementContent.setStyles({
display: 'block',
opacity: 0,
width: 'auto'//added this to get htmlElement to behave
});
//check and see if styles are being applied to HTML content section
if(this.elementContent.getStyle('width') != 'auto'){
this.contentObj.width = this.elementContent.getWidth();
};
this.contentObj.height = this.elementContent.getHeight();
this.elementContent.setStyles({
display: 'none',
opacity: 1
});
break;
default:
this.type = 'iframe';
if(contentOptions.req){
this.type = 'req';
};
break;
}
},
reset: function(){
this.container.setStyles({
opacity: 0,
display: 'none'
});
this.controlsContainer.setStyle('height',0);
this.removeContent();
this.previousButton.removeClass('MultiBoxButtonDisabled');
this.nextButton.removeClass('MultiBoxButtonDisabled');
this.opened = false;
},
getOpenClosePos: function(element){
if(this.options.openFromLink){
if(element.getFirst()){
var w = element.getFirst().getCoordinates().width - (this.container.getStyle('border').toInt() * 2);
if(w < 0){
w = 0;
};
var h = element.getFirst().getCoordinates().height - (this.container.getStyle('border').toInt() * 2);
if(h < 0){
h = 0;
};
this.openClosePos = {
width: w,
height: h,
top: element.getFirst().getCoordinates().top,
left: element.getFirst().getCoordinates().left
};
}else{
var w = element.getCoordinates().width - (this.container.getStyle('border').toInt() * 2);
if(w < 0){
w = 0;
};
var h = element.getCoordinates().height - (this.container.getStyle('border').toInt() * 2);
if(h < 0){
h = 0;
};
this.openClosePos = {
width: w,
height: h,
top: element.getCoordinates().top,
left: element.getCoordinates().left
};
};
}else{
if(this.options.fixedTop){
var top = this.options.fixedTop;
}else{
var top = ((window.getHeight()/2)-(this.options.initialSize.h/2)-this.container.getStyle('border').toInt())+this.options.offset.y;
};
this.openClosePos = {
width: this.options.initialSize.w,
height: this.options.initialSize.h,
top: top,
left: ((window.getWidth()/2)-(this.options.initialSize.w/2)-this.container.getStyle('border').toInt())+this.options.offset.x
};
};
return this.openClosePos;
},
open: function(index,currGal){
//need to store current gallery and index of the object in gallery
this.currentGallery = currGal;
this.index = index;
//grab id so description can be matched
this.openId = this.currentGallery[this.index].getProperty('id');
//check to see if mb is already open
if(!this.opened){
this.opened = true;
if(this.options.useOverlay){
this.overlay.show();
};
this.container.setStyles(this.getOpenClosePos(this.currentGallery[this.index]));
this.container.setStyles({
opacity: 0,
display: 'block'
});
if(this.options.fixedTop){
var top = this.options.fixedTop;
}else{
var top = ((window.getHeight()/2)-(this.options.initialSize.h/2)-this.container.getStyle('border').toInt())+this.options.offset.y;
};
this.containerEffects.start({
width: this.options.initialSize.w,
height: this.options.initialSize.h,
top: top,
left: ((window.getWidth()/2)-(this.options.initialSize.w/2)-this.container.getStyle('border').toInt())+this.options.offset.x,
opacity: [0, 1]
});
this.load(this.currentGallery[this.index]);
}else{
if(this.options.showControls){
this.hideControls();
};
this.getOpenClosePos(this.currentGallery[this.index]);
this.timer = this.hideContent.bind(this).delay(500);
this.timer = this.load.pass(this.currentGallery[this.index],this).delay(1100);
};
},
getContent: function(element){
this.setContentType(element);
var desc = {};
if(this.options.descClassName){
this.descriptions.each(function(el,i){
if(el.hasClass(this.openId)){
desc = el.clone();
};
},this);
};
this.contentToLoad = {
title: element.retrieve('origTitle') || ' ',
desc: desc,
number: this.index+1
};
},
close: function(){
if(this.options.useOverlay){
this.overlay.hide();
};
if(this.options.showControls){
this.hideControls();
};
this.hideContent();
this.containerEffects.cancel();
this.zoomOut.bind(this).delay(500);
},
zoomOut: function(){
this.containerEffects.start({
width: this.openClosePos.width,
height: this.openClosePos.height,
top: this.openClosePos.top,
left: this.openClosePos.left,
opacity: 0
});
this.reset.bind(this).delay(500);
},
load: function(element){
this.box.addClass('MultiBoxLoading');
this.getContent(element);
if(this.type == 'image'){
var xH = this.contentObj.xH;
this.contentObj = new Asset.image(element.href,{onload:this.resize.bind(this)});
this.contentObj.xH = xH;
}else{
this.resize();
};
},
resize: function(){
//only resize if values have been set to resize to
if(this.options.maxSize != null){
var maxW = this.options.maxSize.w.toInt();//declare max width at top of script
var maxH = this.options.maxSize.h.toInt();//declare max height at top of script
var dW = 0;//set initial final width to 0
var dH = 0;//set initial final height to 0
var h = dH = this.contentObj.height;//retrieve image height
var w = dW = this.contentObj.width;//retrieve image width
if((h >= maxH) && (w >= maxW)){
if(h > w){
dH = maxH;
dW = ((w * dH) / h).toInt();
}else{
dW = maxW;
dH = ((h * dW) / w).toInt();
};
}else if((h > maxH) && (w < maxW)){
dH = maxH;
dW = ((w * dH) / h).toInt();
}else if((h < maxH) && (w > maxW)){
dW = maxW;
dH = ((h * dW) / w).toInt();
};
this.contentObj.height = dH;//resize image height
this.contentObj.width = dW;//resize image width
};
if(this.options.fixedTop){
var top = this.options.fixedTop;
}else{
var top = ((window.getHeight() / 2) - ((Number(this.contentObj.height) + this.contentObj.xH) / 2) - this.container.getStyle('border').toInt() + window.getScrollTop()) + this.options.offset.y;
};
var left = ((window.getWidth() / 2) - (this.contentObj.width / 2) - this.container.getStyle('border').toInt()) + this.options.offset.x;
if(top < 0){
top = 0;
};
if(left < 0){
left = 0;
};
this.containerEffects.pause();
//this.containerEffects.cancel();
/*this.containerEffects = new Fx.Morph(this.container, {
duration: 400,
transition: Fx.Transitions.Sine.easeOut
});*/
this.containerEffects.start({
width: this.contentObj.width,
height: Number(this.contentObj.height) + this.contentObj.xH,
top: top,
left: left,
opacity: 1
});
this.timer = this.showContent.bind(this).delay(500);
},
showContent: function(){
this.box.removeClass('MultiBoxLoading');
this.removeContent();
this.contentContainer = new Element('div', {
'id': 'MultiBoxContentContainer',
'styles': {
opacity: 0,
width: this.contentObj.width,
height: (Number(this.contentObj.height)+this.contentObj.xH)
}
}).inject(this.box);
if(this.type == 'image'){
this.contentObj.inject(this.contentContainer);
}else if(this.type == 'iframe'){
new Element('iframe', {
'id': 'iFrame'+new Date().getTime(),
'width': this.contentObj.width,
'height': this.contentObj.height,
'src': this.contentObj.url,
'frameborder': 0,
'scrolling': 'auto'
}).inject(this.contentContainer);
}else if(this.type == 'htmlelement'){
this.elementContent.clone().setStyle('display','block').inject(this.contentContainer);
}else if(this.type == 'req'){
var req = new Request.HTML({
url: this.contentObj.url,
method: 'get',
evalScripts: true,
onSuccess: function(responseTree,responseElements,responseHTML,responseJavaScript){
$('MultiBoxContentContainer').adopt(responseElements);
},
onFailure: function() {
$('MultiBoxContentContainer').set('text','The request failed.');
}
}).send();
}else{
this.obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'}).inject(this.contentContainer);
this.createEmbedObject();
//if its a movie inject the object string into obj
if(this.str){
this.obj.set('html',this.str);
this.str = null;//clear the value after using it
};
};
this.contentEffects = new Fx.Morph(this.contentContainer,{duration:500});
this.contentEffects.start({
opacity: 1
});
this.title.set('html',this.contentToLoad.title);
this.number.set('html',this.contentToLoad.number+' z '+this.currentGallery.length);
if(this.options.descClassName){
//check to see if there is a desc override
if(this.currentGallery[this.index].retrieve('origRel')){
//declare variables
var ignoreDesc = false;
var myRel = this.currentGallery[this.index].retrieve('origRel');
var optArr = myRel.split(',');
//loop through each split looking for 'noDesc'
optArr.each(function(el){
if(el.test('noDesc') == true){
ignoreDesc = true;
};
});
};
//check and see if user wants to override default description setting for this element
if(ignoreDesc != true){
if(this.description.getFirst()){
this.description.getFirst().destroy();
};
//this.contentToLoad.desc.inject(this.description).setStyle('display','block');
};
};
if(this.options.showControls){
this.timer = this.showControls.bind(this).delay(800);
};
if(this.options.addDownload){
var filePath = this.currentGallery[this.index].href;
var fileName = this.currentGallery[this.index].href.substring(this.currentGallery[this.index].href.lastIndexOf('/')+1);
this.download.set('html','Download File');
//empty download if its not an image
if(this.type != 'image'){
this.download.empty();
};
};
},
hideContent: function(){
this.box.addClass('MultiBoxLoading');
this.contentEffects.start({
opacity: 0
});
this.removeContent.bind(this).delay(500);
},
removeContent: function(){
if($('MultiBoxMediaObject')){
$('MultiBoxMediaObject').empty();//so sound doesnt keep playing in IE
$('MultiBoxMediaObject').dispose();//dispose() instead of destroy() as IE 6&7 crashes
};
if($('MultiBoxContentContainer')){
$('MultiBoxContentContainer').dispose();//dispose() instead of destroy() as IE 6&7 crashes
};
if(this.description){
this.description.empty();//empty description incase next element doesnt want to have one
};
},
showControls: function(){
if(this.container.getStyle('height') != 'auto'){
this.containerDefaults.height = this.container.getStyle('height');
this.containerDefaults.backgroundColor = this.options.contentColor;
//controls box isnt taken into consideration when positioning the container from the top so correct this
if(this.options.recalcTop == true){
if(this.container.getStyle('top').toInt() > this.controls.getStyle('height').toInt()/2){
this.finalResize = new Fx.Morph(this.container,{duration:400});
this.finalResize.start({
top: this.container.getStyle('top').toInt()-(this.controls.getStyle('height').toInt()/2)
});
};
};
};
this.container.setStyle('height','auto');
if(this.contentToLoad.number == 1){
this.previousButton.addClass('MultiBoxPreviousDisabled');
}else{
this.previousButton.removeClass('MultiBoxPreviousDisabled');
};
if(this.contentToLoad.number == this.currentGallery.length){
this.nextButton.addClass('MultiBoxNextDisabled');
}else{
this.nextButton.removeClass('MultiBoxNextDisabled');
};
this.controlEffects.start({
'height': this.controls.getStyle('height')
});
},
hideControls: function(num){
this.controlEffects.start({'height': 0}).chain(function(){
this.container.setStyles(this.containerDefaults);
}.bind(this));
},
next: function(){
if(this.index < this.currentGallery.length-1){
this.index++;
this.openId = this.currentGallery[this.index].getProperty('id');
if(this.options.showControls){
this.hideControls();
};
this.getOpenClosePos(this.currentGallery[this.index]);
this.timer = this.hideContent.bind(this).delay(500);
this.timer = this.load.pass(this.currentGallery[this.index],this).delay(1100);
};
},
previous: function(){
if(this.index > 0){
this.index--;
this.openId = this.currentGallery[this.index].getProperty('id');
if(this.options.showControls){
this.hideControls();
};
this.getOpenClosePos(this.currentGallery[this.index]);
this.timer = this.hideContent.bind(this).delay(500);
this.timer = this.load.pass(this.currentGallery[this.index],this).delay(1000);
};
},
createEmbedObject: function(){
if(this.type == 'flash'){
var url = this.contentObj.url;
var swfHolder = new Element('div').setProperties({id: 'swfHolder'}).inject(this.obj);
var flashObj = new Swiff(url, {
id: url,
container: swfHolder,
width: this.contentObj.width,
height: this.contentObj.height
});
}else if(this.type == 'flashVideo'){
var url = this.contentObj.url;
var swfHolder = new Element('div').setProperties({id: 'swfHolder'}).inject(this.obj);
var flashObj = new Swiff(this.options.path+'flvplayer.swf', {
id: url,
container: swfHolder,
width: this.contentObj.width,
height: (Number(this.contentObj.height)+this.contentObj.xH),
vars: {
path: url
}
});
}else if(this.type == 'flashMp3'){
var url = this.contentObj.url;
var swfHolder = new Element('div').setProperties({id: 'swfHolder'}).inject(this.obj);
var flashObj = new Swiff(this.options.path+'mp3player.swf', {
id: url,
container: swfHolder,
width: this.contentObj.width,
height: (Number(this.contentObj.height)+this.contentObj.xH),
vars: {
path: url
}
});
}else if(this.type == 'quicktime'){
var url = this.contentObj.url;
this.str = '';
}else if(this.type == 'windowsMedia'){
var url = this.contentObj.url;
this.str = '';
}else if(this.type == 'real'){
var url = this.contentObj.url;
this.str = '';
};
},
addOverlayIcon:function(element){
//loop through each instance
element.each(function(el,i){
//if link contains an image ad overlay
if(el.getElement('img')){
//add position:relative to them so that icon is contained
el.setStyle('position','relative');
//inject a new div that is the overlay icon
var overlayIcon = new Element('div').inject(el);
overlayIcon.addClass('OverlayIcon');
//IE6 causes too many issues due to lack of PNG support
if(!Browser.ie4){
overlayIcon.setStyle('opacity',0);
overlayIcon.set('tween',{duration:3000,transition:Fx.Transitions.Expo.easeIn}).tween('opacity',1);
};
};
});
},
addRollover:function(element){
element.each(function(el,i){
//if link contains an image ad overlay
if(el.getElement('img')){
//add event listeners
el.addEvents({
'mouseenter': function(){
el.getElement('img').set('tween',{duration:200,transition:Fx.Transitions.linear}).tween('opacity',0.5);
},
'mouseleave': function(){
el.getElement('img').set('tween',{duration:400,transition:Fx.Transitions.linear}).tween('opacity',1);
}
});
};
});
},
addChain:function(element){
//create new array to hold all links with images to chain through
var chainArray = [];
//push link into chainArray if it contains an image
element.each(function(el,i){
//detect whether link contains image
if(el.getElement('img')){
chainArray.push(el);
};
});
//now chain through each item in the new array
chainArray.each(function(el,i){
//detect whether link contains image
if(el.getElement('img')){
//chain through each multibox link that contains an image
var HoverMe = new Chain();
var hoverOn = function(){
el.getElement('img').set('tween',{duration:200,transition:Fx.Transitions.linear}).tween('opacity',0.5);
};
var hoverOff = function(){
el.getElement('img').set('tween',{duration:400,transition:Fx.Transitions.linear}).tween('opacity',1);
};
HoverMe.chain(hoverOn);
HoverMe.chain(hoverOff);
HoverMe.callChain.delay(2000+(i+1)*1000,HoverMe);
HoverMe.callChain.delay((i+2)*1000,HoverMe);
};
});
},
addDownload:function(element){
this.download = new Element('div').addClass('MultiBoxDownload').inject(this.controls).setStyle('margin-left',0);
},
addTips:function(element){
element.each(function(el,i){
//add MooTools tips
if(el.get('title')){
var toolTips = new Tips(el, {
onShow: function(el){el.fade(.9);},
onHide: function(el){el.fade(0);},
offsets: {'x':16,'y':5},
className: 'mbTips'
});
};
//remove title so dont get duplication of title and MooTools tips
if(el.getElement('img')){
if(el.getElement('img').get('title')){
el.getElement('img').erase('title');
};
if(el.getElement('img').get('alt')){
el.getElement('img').erase('alt');
};
};
});
},
autoOpen:function(element){
//make sure element number is valid
if(this.options.autoOpen > $$(this.options.mbClass).length){
this.options.autoOpen = $$(this.options.mbClass).length;
};
//auto open multiBox on page
this.open(this.options.autoOpen-1,element);
}
});
/*
---
script: slideGallery.js
description: Multifunctional gallery for MooTools
license: MIT-style license
authors:
- Sergii Kashcheiev
requires:
- core/1.2.4: Events
- core/1.2.4: Fx.Tween
- core/1.2.4: Fx.Transitions
provides: [slideGallery, fadeGallery]
...
*/
var slideGallery = new Class({
Version: "1.3",
Implements: [Options, Events],
options: {
holder: ".holder",
elementsParent: "ul",
elements: "li",
nextItem: ".next",
prevItem: ".prev",
stop: ".stop",
start: ".start",
speed: 600,
duration: 4000,
steps: 1,
current: 0,
transition: "sine:in:out",
direction: "horizontal",
mode: "callback",
currentClass: "current",
nextDisableClass: "next-disable",
prevDisableClass: "prev-disable",
paging: false,
pagingEvent: "click",
pagingHolder: ".paging",
random: false,
autoplay: false,
autoplayOpposite: false,
stopOnHover: true
/*
onStart: $empty,
onPlay: $empty,
*/
},
initialize: function(gallery, options) {
if(gallery.length == null) this.gallery = gallery;
else this.gallery = gallery[0];
if(!this.gallery) return false;
this.setOptions(options);
this.holder = this.gallery.getElement(this.options.holder);
this.itemsParent = this.holder.getElement(this.options.elementsParent);
this.items = this.itemsParent.getElements(this.options.elements);
this.next = this.gallery.getElement(this.options.nextItem);
this.prev = this.gallery.getElement(this.options.prevItem);
this.stop = this.gallery.getElement(this.options.stop);
this.start = this.gallery.getElement(this.options.start);
this.current = this.options.current;
this.bound = {rotate: this.rotate.bind(this) };
Fx.implement({
cancel: function() {
if(!this.callChain()) this.fireEvent('chainComplete', this.subject);
/* if(this.stopTimer()) this.onCancel(); */
return this;
}
});
if(this.options.direction == "horizontal") {
this.direction = "margin-left";
this.size = this.items[0].getWidth();
this.visible = Math.round(this.holder.getWidth()/this.size);
}
else {
this.direction = "margin-top";
this.size = this.items[0].getHeight();
this.visible = Math.round(this.holder.getHeight()/this.size);
}
if(this.items.length <= this.visible) {
if(this.next) this.next.addClass(this.options.nextDisableClass).addEvent("click", function() {return false;});
if(this.prev) this.prev.addClass(this.options.prevDisableClass).addEvent("click", function() {return false;});
if(this.stop) this.stop.addEvent("click", function() {return false;});
if(this.start) this.start.addEvent("click", function() {return false;});
this.gallery.addClass("stopped no-active");
this.fireEvent("start", this.current, this.visible, this.items.length, this.items[this.current]);
return false;
}
this.options.steps = this.options.steps > this.visible ? this.visible : this.options.steps;
this.options.duration = this.options.duration < 1000 ? 1000 : this.options.duration;
this.options.speed = this.options.speed > 6000 ? 6000 : this.options.speed;
if(this.options.speed > this.options.duration) this.options.speed = this.options.duration;
this.fx = new Fx.Tween(this.itemsParent, {
property: this.direction,
duration: this.options.speed,
transition: this.options.transition,
link: "cancel",
fps: 100
});
if(this.options.random) this.shuffle();
this.getInitialCurrent();
if(this.options.mode == "circle") {
while(this.items.length < this.options.steps+this.visible) {
this.itemsParent.innerHTML += this.itemsParent.innerHTML;
this.items = this.itemsParent.getElements(this.options.elements);
}
for(var i=0; i this.items.length-1) this.current = this.items.length-1;
else if(this.current < 0) this.current = 0;
}
if(this.options.mode != "circle" && this.visible+this.current >= this.items.length) this.current = this.items.length-this.visible;
return this;
},
rotate: function() {
if(!this.options.autoplayOpposite) this.nextSlide();
else this.prevSlide();
this.timer = this.bound.rotate.delay(this.options.duration);
return this;
},
play: function(animate) {
if(this.options.mode == "line") this.sidesChecking();
if(animate) this.fx.start(-this.current*this.size);
else this.fx.set(-this.current*this.size);
if(this.options.paging) this.setActivePage();
this.fireEvent("play", this.current, this.visible, this.items.length, this.items[this.current]);
return this;
},
nextSlide: function() {
if(this.options.mode != "circle") {
if(this.visible+this.current >= this.items.length) {
if(this.options.mode == "callback") this.current = 0;
}
else if(this.visible+this.current+this.options.steps >= this.items.length) {
this.current = this.items.length-this.visible;
}
else this.current += this.options.steps;
this.play(true);
}
else {
var temp = this.current;
if((this.current += this.options.steps) >= this.items.length) this.current -= this.items.length;
this.fx.start(-this.size*this.options.steps).chain(function() {
for(var i=0; i= this.items.length) temp = 0;
this.items[temp++].inject(this.itemsParent, "bottom");
}
this.fx.set(0);
}.bind(this));
this.fireEvent("play", this.current, this.visible, this.items.length, this.items[this.current]);
}
return this;
},
prevSlide: function() {
if(this.options.mode != "circle") {
if(this.current <= 0) {
if(this.options.mode == "callback") this.current = this.items.length-this.visible;
}
else if(this.current-this.options.steps <= 0) {
this.current = 0;
}
else this.current -= this.options.steps;
this.play(true);
}
else {
for(var i=0; i= this.items.length) {
this.next.addClass(this.options.nextDisableClass)
} else if(this.current==0) {
this.prev.addClass(this.options.prevDisableClass);
}
return this;
},
createPaging: function() {
this.paging = new Element("ul");
var pagingHold = this.gallery.getElement(this.options.pagingHolder);
if(pagingHold != null) this.paging.injectInside(pagingHold);
else this.paging.injectInside(this.gallery).addClass("paging");
var length = Math.ceil((this.items.length-this.visible)/this.options.steps)+1;
var str = "";
for(var i=0; i' + parseInt(i+1) + '';
}
this.paging = this.paging.set("html", str).getElements("a");
this.paging.each(function(el, i) {
el.addEvent(this.options.pagingEvent, function() {
if(i < length-1) this.current = i*this.options.steps;
else this.current = this.items.length-this.visible;
this.play(true);
return false;
}.bind(this));
}.bind(this));
return this;
},
setActivePage: function() {
this.paging.removeClass("active")[Math.ceil(this.current/this.options.steps)].addClass("active");
return this;
},
shuffle: function() {
var str = "";
this.items.sort(function(){return 0.5 - Math.random()}).each(function(el) {
str += new Element("div").adopt(el).get("html");
});
this.items = this.itemsParent.set("html", str).getElements(this.options.elements);
return this;
}
});
var fadeGallery = new Class({
Extends: slideGallery,
initialize: function(gallery, options) {
if(options.mode == "circle") options.mode = "callback";
this.parent(gallery, options);
this.fxFade = [];
this.items.each(function(el, i) {
this.fxFade[i] = new Fx.Tween(el, {
property: "opacity",
duration: this.options.speed,
transition: this.options.transition,
link: "cancel"
});
this.fxFade[i].set(0);
}.bind(this));
this.play(false);
},
play: function(animate) {
if(this.previous == null) {
this.previous = 0;
return false;
}
if(this.options.mode == "line") this.sidesChecking();
if(animate) {
this.fxFade[this.previous].start(0);
this.fxFade[this.current].start(1);
}
else {
this.fxFade[this.previous].set(0);
this.fxFade[this.current].set(1);
}
this.previous = this.current;
if(this.options.paging) this.setActivePage();
this.fireEvent("play", this.current, this.visible, this.items.length, this.items[this.current]);
}
});
/*
---
struktura:
JSON:
{
1: 'sciezka1',
2: 'sciezka2',
3: 'sciezka3',
n: 'sciezkan'
}
}
---
*/
var zarzadzalne_naglowki = new Class({
Implements: [Options, Events],
options: {
duration: 1000,
delay: 5000,
jsonURL: 'js/headers.json',
preloader: true,
preloaderID: ''
},
initialize: function(header, options) {
this.setOptions(options);
this.header = header;
this.count = 0;
this.URLs = {};
this.headers = new Array();
this.pointer = 0;
this.status = false;
this.requestJSON = new Request.JSON({
evalScripts: false,
method: 'get',
url: this.options.jsonURL,
onError: function(text, error) {alert(text + ', ' + error);},
onFailure: function(xhr) {alert(xhr.status);},
onSuccess: function(responseText) {
for (var i in responseText) {
this.URLs = responseText;
this.count++;
}
this.setStructures();
}.bind(this)
}).get();
},
setStructures: function() {
for (i=0; i= minPoint) ){
if( change=='0' ){
change = ( defaultPoint-currPoint ) * difference;
currPoint = defaultPoint;
currFontSize = defaultFontSize;
}
else{
currPoint = currPoint + change;
change = change * difference; /* roznica rozmiaru*/
currFontSize = currFontSize + change; /* domyslny rozmiar*/
}
cookieValue = currFontSize - defaultFontSize;
Cookie.write('fontSize', cookieValue, {'path':'/', 'duration':'365'});
fontSizer(change);
}
}
function pobierzArkuszIlosc(){
return(document.styleSheets.length);
}
function pobierzStylIlosc(i){
if( navigator.appName=="Microsoft Internet Explorer" )
return(document.styleSheets[i].rules.length);
else
return(document.styleSheets[i].cssRules.length);
}
function pobierzStyl(i,j){
if( navigator.appName=="Microsoft Internet Explorer" )
return(document.styleSheets[i].rules[j]);
else
return(document.styleSheets[i].cssRules[j]);
}
function ustalRozmiar(obiekt,change){
if ( (obiekt.selectorText!='' && !noChange.test(obiekt.selectorText)) || obiekt.selectorText=='' ) {
if( obiekt.style.fontSize )
font = parseInt(obiekt.style.fontSize.slice(0,-2)) + parseInt(change);
else
font = defaultFontSize + parseInt(change);
obiekt.style.fontSize = font + 'px';
/* obiekt.style.lineHeight = 'normal'; */
/* obiekt.style.wordSpacing = 'normal'; */
}
}
function fontSizer(change) {
if( !document.getElementById )
return;
else{
var i,j;
var arkuszIlosc=pobierzArkuszIlosc();
for(i=0;ithis.items.length-1)
return;
var slide_index = index;
this.items.each(function(slide, index){
if(slide_index!=index)
{
slide.fade('out');
}
else
{
slide.fade('in');
}
}, this, slide_index);
this.current_slide = slide_index;
this.setPaginationActive();
if(this.options.autostart)
this.startSlideshow();
},
setPaginationActive: function() {
if(this.options.pag_class)
{
$$('.'+this.options.pag_class).each(function(item){
item.removeClass('pag-active');
});
$$('.'+this.options.pag_class)[this.current_slide].addClass('pag-active');
}
},
slideToNext: function() {
if(this.current_slide==this.items.length-1)
{
this.current_slide = 0;
}
else
{
this.current_slide++;
}
$(this.id).set('morph',{unit : 'px'}).morph({'margin-left' : -this.current_slide*window.getSize().x});
this.setPaginationActive();
//this.slideSetActiveButtons();
},
slideToPrevious: function() {
if(this.current_slide==0)
{
this.current_slide = this.items.length-1;
}
else
{
this.current_slide--;
}
$(this.id).set('morph',{unit : 'px'}).morph({'margin-left' : -this.current_slide*window.getSize().x});
this.setPaginationActive();
//this.slideSetActiveButtons();
},
slideTo: function(index) {
if(index>this.items.length-1)
return;
$(this.id).set('morph',{unit : 'px'}).morph({'margin-left' : -index*window.getSize().x});
this.current_slide = index;
this.setPaginationActive();
//this.slideSetActiveButtons();
},
slideSetActiveButtons: function() {
if(this.options.show_next_id)
{
if(this.current_slide==this.items.length-1)
{
$(this.options.show_next_id).removeClass('active');
}
else
{
$(this.options.show_next_id).addClass('active');
}
}
if(this.options.show_previous_id)
{
if(this.current_slide==0)
{
$(this.options.show_previous_id).removeClass('active');
}
else
{
$(this.options.show_previous_id).addClass('active');
}
}
},
calculateSlideDimensions: function() {
$(this.id).setStyle('width',window.getSize().x*this.items.length+'px');
$$('#'+this.id+' li')[this.current_slide].setStyle('width',window.getSize().x+'px');
$$('#'+this.id+' li').each(function(slide){
slide.setStyle('width',window.getSize().x+'px');
}, this);
}
});
var incheckradio = new Class({
initialize: function(sel) {
//Formularze xml
$$('label.'+sel).getNext('div').getElements('input.check').each(function(element){
element.addClass(sel);
});
$$('label.'+sel).removeClass(sel);
this.sel = sel;
this.els = $$('input.'+this.sel);
if(this.els.length>0) {
this.els.each(function(el){
var input = el;
var href = new Element('a',{
'class': 'incheckradio',
'text': 'wybierz',
'href': '#'
}).addEvent('click',function(event){
event.preventDefault();
if(input.disabled)
return;
href.toggleClass('checked');
if(input.type=='checkbox')
{
if(input.checked)
{
input.setProperty('checked', false);
}
else
{
input.setProperty('checked', true);
}
}
else if(input.type=='radio')
{
$$('input[name="'+input.name+'"]').each(function(radio){
radio.setProperty('checked', false);
radio.getPrevious('a.incheckradio').removeClass('checked');
});
input.setProperty('checked', true);
input.getPrevious('a.incheckradio').addClass('checked');
}
console.log(input);
input.fireEvent('click');
}).inject(el,'before');
if(input.type=='checkbox')
{
href.addClass('icheck');
}
else
{
href.addClass('iradio');
}
input.addEvent('click',function(e){
if(this.type=='radio')
{
$$('input[name="'+this.name+'"]').each(function(radio){
radio.setProperty('checked', false);
radio.getPrevious('a.incheckradio').removeClass('checked');
});
this.setProperty('checked', true);
this.getPrevious('a.incheckradio').addClass('checked');
}
});
if(input.checked)
{
href.addClass('checked');
}
if(input.disabled)
{
href.addClass('disabled');
}
});
}
}
});
/*
Class: inTabs
Nawigacja na zakładkach. Kliknięcie w zakładkę aktywuje ją, oraz ładuje
odpowiednią zawartość poprzez ajax.
Schemat układu html dla zakładek ajax:
- Zakładka 1
- Zakładka 2
...
Schemat układu html dla zakładek standardowych:
- Zakładka 1
- Zakładka 2
...
...
*/
var inTabs = new Class({
Implements: [Options],
options: {
link : '',
linki : [],
aktywny : 0,
aktywnyClass : 'active',
uzyjAjax : true,
evalScripts : true
},
initialize : function(id, options) {
this.setOptions(options);
this.linki = this.options.linki;
this.aktywny = this.options.aktywny;
this.aktywnyClass = this.options.aktywnyClass;
this.tresci = new Array();
this.id = id;
this.tabs = $(this.id+'-kontrolki').getElements('li');
//utwórz kontener dla treści każdej zakładki
var i = 0;
Array.each(this.tabs, function(n){
if ( ! $defined( $(this.id+'_content'+i) ) ) {
var d = new Element('div', {'id':this.id+'_content'+i,'display':'none'});
d.inject( $(this.id+'_content') );
}
n.i = i;
i++;
}.bind(this));
if ( this.options.uzyjAjax ) {
this.initAjaxTabs();
}
else {
this.initStandardTabs();
}
},
initStandardTabs: function() {
Array.each(this.tabs, function(n){
/* Schowaj nieaktywne */
if ( n.i != this.aktywny ) {
$(this.id+'_content'+n.i).setStyle('display', 'none');
}
n.onclick = function()
{
this.tabs[this.aktywny].removeClass(this.aktywnyClass);
$(this.id+'_content'+this.aktywny).setStyle('display', 'none');
n.addClass(this.aktywnyClass);
this.aktywny = n.i;
$(this.id+'_content'+this.aktywny).setStyle('display', '');
}.bind(this);
}.bind(this));
},
initAjaxTabs: function() {
/*if ( this.aktywny != -1 ) {
this.tresci[this.aktywny] = $(this.id+'_content'+this.aktywny).get('html');
}*/
Array.each(this.tabs, function(n){
n.onclick = function()
{
//deaktywuj stary
this.tabs[this.aktywny].removeClass(this.aktywnyClass);
$(this.id+'_content'+this.aktywny).setStyle('display', 'none');
//aktywuj nowy
n.addClass(this.aktywnyClass);
this.aktywny = n.i;
if ( $(this.id+'_content'+this.aktywny).get('text') != '' )
{
$(this.id+'_content'+this.aktywny).setStyle('display', '');
}
else
{
var url = (this.linki.length>0) ? this.linki[this.aktywny] : this.options.link.replace(/\{tabid\}/, this.aktywny);
var get = new Ajax(url, {
method: 'get',
update: $(this.id+'_content'+this.aktywny),
useWaiter: true,
waiterOptions: {},
waiterTarget: $(this.id+'_content'),
evalScripts: this.options.evalScripts,
onComplete: function(obj) {
$(this.id+'_content'+this.aktywny).setStyle('display', '');
}.bind(this)
}).request();
}
}.bind(this);
}.bind(this));
/* automatycznie aktywuj odp. zakładkę */
if ( this.aktywny == -1 ) {
this.aktywny = 0;
}
this.tabs[this.aktywny].onclick();
}
});
var wypelnij_wymagane = "Wypełnij pola wymagane";
var bledny_email = "Podany adres e-mail jest nieprawidłowy.";
var www_dir = window.location.protocol + "//" + window.location.host + "/";
/*function fsDoUlubionych()
{
var www = window.location.protocol + "//" + window.location.host + "/";
var title = document.title;
if ( navigator.userAgent.indexOf('MSIE') != -1 ) {
return window.external.AddFavorite (www, title);
}
else {
if ((navigator.userAgent.indexOf('Mozilla') != -1) && (typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function')) {
return window.sidebar.addPanel(title, www, '');
}
else {
if ( navigator.userAgent.toLowerCase().indexOf('chrome') != -1 ) {
alert('Aby dodać stronę do zakładek, wciśnij klawisze:\nCtrl + D');
return false;
}
else {
if ( window.external && window.external.AddFavorite ) {
return window.external.AddFavorite(www, title);
}
else {
alert('Twoja przeglądarka nie obsługuje tej funkcji.');
return false;
}
}
}
}
}*/
function fsStronaStartowa()
{
/* MS IE */
if ( navigator.appName.indexOf('Microsoft')!=-1 )
{
var link = document.getElementById('link_startowa');
link.style.behavior='url(#default#homepage)';
link.setHomePage(www_dir);
return;
}
/* Netscape, firefox */
if ( navigator.appName.indexOf('Netscape')!=-1 ) {
var msg = "{_STRONA_STARTOWA_INFO1}";
}
/* Opera */
else if ( navigator.appName.indexOf('Opera')!=-1 ) {
var msg = "{_STRONA_STARTOWA_INFO2}";
}
/* Inne */
else {
var msg = "{_STRONA_STARTOWA_INFO3}";
};
alert(msg);
}
function fsPolecStrone()
{
location.href = "/main/polec_znajomemu.html";
}
function checkFormSzukaj(s)
{
if ( s.value=='' || s.value.length<2 ) {
alert("{_S_WPISZ_SZUKANE_WYRAZENIE}");
s.select();
s.focus();
return false;
}
return true;
}
var newsletter_akcja = 'dodaj';
function checkFormNewsletter()
{
if ( ! checkEmail('newsletter_email') ) {
return false;
}
if ( newsletter_akcja == 'usun' ) {
if ( ! confirm('Usunąć podany adres e-mail z newslettera?') ) {
return false;
}
}
document.getElementById('newsletter_dodaj_usun').value = newsletter_akcja;
return true;
}
function pobierzPlik(plik) {
noweOknoPopup = window.open('{__WWW__}download/s/'+plik);
}
function no(sciezka,nazwaokna,zmienne) {
window.open(sciezka,nazwaokna,zmienne+',resizable=yes,status=yes,toolbar=yes');
}
/* dodaje do każdego linku zewnętrznego ikonkę */
function aBlank()
{
if ( ! $('tresc') ) return false;
allLinks = $$('#tresc a');
for(i=0; i';
l.title = 'Link zewnętrzny: ' + l.href;
}
}
else if ( l.target=="_popup" ) {
l.removeAttribute("target");
l.onclick = function() {showPopupWindow(this.href);return false;};
}
}
}
/* antyspam */
function sm(imie,nazwisko,type)
{
var name = 'katowice.uw.gov.pl';
var inc1 = 'ilto';
var inc2 = 'ma';
var goryl = '@';
nazwisko = (nazwisko=='katowice') ? name : nazwisko;
if (type==1)
document.location = inc2+inc1+':'+imie+goryl+nazwisko;
else
document.write(imie+goryl+nazwisko);
}
/* cookies */
function SetCookie(cookieName,cookieValue,nDays)
{
var today = new Date();
var expire = new Date();
if (nDays==null || nDays==0) nDays=1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName+"="+escape(cookieValue)+"; expires="+expire.toGMTString()+"; path=/";
}
function ReadCookie(cookieName)
{
var theCookie=""+document.cookie;
var ind=theCookie.indexOf(cookieName);
if (ind==-1 || cookieName=="") return "";
var ind1=theCookie.indexOf(';',ind);
if (ind1==-1) ind1=theCookie.length;
return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
/*
Wersja żałobna.
*/
function desaturate( obszar )
{
if ( ! obszar ) { return; }
var imgs = obszar.getElements('img');
$each(imgs, function(n) {
if ( n.src.indexOf('_gray.') == -1 ) {
jsImageFX.doImage(n, 'desaturate');
}
});
}
if ( '{__VERSION}' == '_gray' || '{__VERSION}' == '_bw' )
{
Ajax = Ajax.extend({
request: function(){
this.addEvent('onComplete', this.filter);
this.parent();
},
filter: function() {
var el = $(this.options.update) || this.options.update;
desaturate(el);
}
});
}
/* stare funkcje */
function showPhoto(obrazek,width,height) {}
function showPhoto2(obrazek) {}
function showPopupWindow(link,width,height)
{
width = (!width || width==0) ? 640 : width;
height = (!height || height==0) ? 600 : height;
var left = parseInt(screen.width/2-width/2);
var top = parseInt(screen.height/2-height/2);
if (screen.width < 1024 || screen.height < 756) {
var top = 0;
height = 500;
}
noweOknoPopup = window.open(link,'PopupWin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,left='+left+',top='+top+',width='+width+',height='+height);
noweOknoPopup.focus();
}
function sPW(link) {
if ( link.href )
showPopupWindow(link.href);
else
showPopupWindow(link);
return false;
}
var Tipsy = new Array();
function initTips()
{
Tipsy.empty();
var allTips = $$('img[class^=Tip],td[class^=Tip]');
for ( i=0; i < allTips.length; i++){
var el = allTips[i];
var es = el.getProperty('title');
if ( $defined( es ) && es != '' )
{
es = es.split('::');
el.store('tip:title', es[0]);
el.store('tip:text', es[1]);
Tipsy.include( new Tips(el,{'className':'tip-tool'}) );
}
}
}
function spiner( el ){
var s = new Element('img', {'src': 'pics/spinner.gif','class':'spinner','style':'margin-left:10px'});
s.injectAfter(el);
}
/* wersja do druku */
function printImgs( on )
{
var allImgs = $$('img');
if ( on ) {
for (i=0;i 0 ) {
first_url = l[0].getElements('a')[0].href;
prev_url = l[i-1].getElements('a')[0].href;
}
if ( i < l.length-1 ) {
next_url = l[i+1].getElements('a')[0].href;
last_url = l[l.length-1].getElements('a')[0].href;
}
}
}
document.addEvent('keyup', function(e)
{
if ( ! e.shift ) {
return;
}
// strzałka w lewo, prawo, górę, dół
if ( e.code == 37 ) {
if ( prev_url == '' ) {
return;
}
location.href = prev_url;
return;
}
else if ( e.code == 39 ) {
if ( next_url == '' ) {
return;
}
location.href = next_url;
return;
}
else if ( e.code == 38 ) {
if ( first_url == '' ) {
alert('Jesteś na pierwszej stronie!');
return;
}
location.href = first_url;
return;
}
else if ( e.code == 40 ) {
if ( last_url == '' ) {
alert('Jesteś na ostatniej stronie!');
return;
}
location.href = last_url;
return;
}
});
}
/* icheckbox */
new incheckradio('icheckbox');
/* placeholder */
var placeH = $$('input[type=text], textarea').each(function(el) {
if ( el.getPrevious('label') ) {
el.set('placeholder', el.getPrevious('label').get('text') );
}
});
/* linki '_blank' */
aBlank();
/* statystyki */
/*new Ajax('{__WWW__}ajax/stats/{section}/{page}.html', {
method: 'get'
}).request();*/
/* okno pobierania */
var objIFrame = new Element('iframe', {
'id' : 'DownloadWin',
'name' : 'DownloadWin',
'styles': {'display': 'none'}
});
objIFrame.inject( $(document.body) );
/* zaznacz aktywny link */
var m = $$('a');
var t = top.location.href.replace(/http:\/\/[^\/]+\//, '').replace(/\.html$/, '') + '/';
Array.each(m, function(el) {
if ( el.href == '' ) {
return;
}
var h = el.href.replace(/http:\/\/[^\/]+\//, '').replace(/\.html/, '') + '/';
if ( t.indexOf(h) != -1 ) {
el.addClass('active');
}
});
/* wstecz / drukuj */
Array.each($$('.fn_wstecz'), function(el){
el.addEvent('click', function(e){e.stop();history.back();});
});
$$('.fn_drukuj, .realizacja_www').each(function(el){
el.addEvent('click', function(e){e.stop();window.open(this.href);});
});
Array.each($$('._popup'), function(el){
el.onclick=null; el.addEvent('click', function(e){e.stop();sPW(this.href);});
});
/* okienka overlay */
//_overlay = initOverlay();
/* DatePicker */
Array.each($$('.DatePicker'), function(el){
new DatePickerTop(el);
});
/* dodaj do ulubionych */
var dodajDoUlubionych = $('dodaj-do-ulubionych');
if (dodajDoUlubionych) {
dodajDoUlubionych.addEvent('click', function(event) {
event.stop();
var opis = 'Powiatowy Urząd Pracy w Tczewie';
if (window.sidebar) {
event.stop();
window.sidebar.addPanel(opis, window.location.href, "");
return;
} else if (window.external) {
event.stop();
if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
alert('aby dodać stronę do zakładek, wciśnij klawisze:\nCtrl + D');
} else {
window.external.AddFavorite(window.location.href, opis);
}
return;
} else if (window.opera && window.print) { /* Opera - do dopracowania */
dodajDoUlubionych.set('title',opis);
dodajDoUlubionych.set('href',window.location.href);
dodajDoUlubionych.set('rel','sidebar');
}
});
}
/* formularz newslettera */
if ( $('FormNewsletter') ) {
$('FormNewsletter').addEvent('submit', function(){
if (this.newsletter_email.value=='Twój e-mail'){
this.newsletter_email.value='';
};
return checkForm(['newsletter_email; Twój adres e-mail']);
});
$('newsletter_email').addEvents({
'focus': function(){
if ( this.value == 'Twój e-mail' ) {
this.value = '';
}
},
'blur': function(){
if ( this.value == '' ) {
this.value = 'Twój e-mail';
}
}
});
$('newsletter_dodaj').addEvent('click', function(){
$('newsletter_akcja').value = 'dodaj';
});
$('newsletter_usun').addEvent('click', function(){
$('newsletter_akcja').value = 'usun';
});
}
/* tipsy */
initTips();
/* #top itp. */
new Fx.SmoothScroll({duration: 500},window);
});
window.addEvent('load', function()
{
var a = $$('#tresc a');
Array.each(a, function(el){
if ( el.href.test(/(\.jpg|\.gif\.png)$/gi) && ! el.hasClass('mb') && ! el.href.test(/download/gi) ) {
el.addClass('showPhoto');
}
});
/* powiększanie zdjęć w treści - dajemy w window.load gdyż pozycja ikonek
wyliczana jest po załadowaniu zawartości */
box = new multiBox({
mbClass: '.mb, .showPhoto',
container: $(document.body),
movieSize: {w:640, h:550},
useOverlay: true,
addOverlayIcon: false,
opacity: 0.3,
initialWidth: 150,
initialHeight: 150,
showNumbers: true,
showControls: true,
slideControl: true,
slideshow: true,
slideshowTime: 6000,
descClassName: 'MultiBoxDesc'
});
});
/* powiększanie zdjęć w treści załadowanej przez ajax */
/*var Ajax = new Class ({
Extends: Ajax,
initialize: function(url, options){
this.parent(url, options);
this.addEvent('onComplete', function(){
if ( _multibox && this.response.text.indexOf('showPhoto') != -1 ){
_multibox.reinit();
}
if ( _overlay && (this.response.text.indexOf('_overlay') != -1 || this.response.text.indexOf('warstwa') != -1) ){
_overlay.reinit();
}
});
}
});*/
// zamykanie aktywnego okna popup przez ESC
// nie otwieraj okienek overlay w głównym oknie
if ( window.name == 'PopupWindow' )
{
document.addEvent('keyup', function(e) {
if ( e.key == 'esc' ) {
window.close();
}
});
}
else if ( window.name == 'OverlayWindow' ) {
if ( top.name == window.name ) {
top.location.href = '/main/index.html';
}
}
/*!
* classie - class helper functions
* from bonzo https://github.com/ded/bonzo
*
* classie.has( elem, 'my-class' ) -> true/false
* classie.add( elem, 'my-new-class' )
* classie.remove( elem, 'my-unwanted-class' )
* classie.toggle( elem, 'my-class' )
*/
/*jshint browser: true, strict: true, undef: true */
/*global define: false */
( function( window ) {
'use strict';
// class helper functions from bonzo https://github.com/ded/bonzo
function classReg( className ) {
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
}
// classList support for class management
// altho to be fair, the api sucks because it won't accept multiple classes at once
var hasClass, addClass, removeClass;
if ( 'classList' in document.documentElement ) {
hasClass = function( elem, c ) {
return elem.classList.contains( c );
};
addClass = function( elem, c ) {
elem.classList.add( c );
};
removeClass = function( elem, c ) {
elem.classList.remove( c );
};
}
else {
hasClass = function( elem, c ) {
return classReg( c ).test( elem.className );
};
addClass = function( elem, c ) {
if ( !hasClass( elem, c ) ) {
elem.className = elem.className + ' ' + c;
}
};
removeClass = function( elem, c ) {
elem.className = elem.className.replace( classReg( c ), ' ' );
};
}
function toggleClass( elem, c ) {
var fn = hasClass( elem, c ) ? removeClass : addClass;
fn( elem, c );
}
var classie = {
// full names
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
toggleClass: toggleClass,
// short names
has: hasClass,
add: addClass,
remove: removeClass,
toggle: toggleClass
};
// transport
if ( typeof define === 'function' && define.amd ) {
// AMD
define( classie );
} else {
// browser global
window.classie = classie;
}
})( window );
window.addEvent('domready', function()
{
if ( $('do-gory') ) {
$('do-gory').setStyle('opacity', 0);
$('do-gory').store('widoczny', 0);
}
/* przycisk wyszukiwarki */
if($('szukaj'))
{
$('szukaj').addEvent('click',function(event){
event.preventDefault();
$$('.wyszukaj').toggleClass('toggled');
});
}
window.onscroll = function()
{
if ( $('do-gory') )
{
var topFx = new Fx.Tween('do-gory', {property: 'opacity', duration: 'short'});
if ( window.pageYOffset > 0 ) {
if ( $('do-gory').retrieve('widoczny') == 0 ) {
topFx.cancel();
topFx.start(1);
$('do-gory').store('widoczny', 1);
}
}
else {
if ( $('do-gory').retrieve('widoczny') == 1 ) {
topFx.cancel();
topFx.start(0);
$('do-gory').store('widoczny', 0);
}
}
}
};
});