/*
 *
 *	JELLY JavaScript Library by Peter Boere --// v. 1.12 //-- 
 *
 * Goals of library: 
 *		One global variable - risk of clashing with other scripts is minimized
 * 	Preserve standard JavaScript API - enhance not reinvent
 *		Powerful and Lightweight - Crossbrowser events, animation, ajax etc. without the bloat
 *
 * Browser support:
 *		A-Grade browsers - as defined by Yahoo! Yui http://developer.yahoo.com/yui/articles/gbs/
 *
 */
var JELLY=function(){var B={addClass:function(C,D){C.className+=C.className?" "+D:D},removeClass:function(C,E){var D=new RegExp("(^|\\s|\\b)"+E+"(\\s|$)","g");C.className=C.className.replace(D," ").normalize()},hasClass:function(C,E){var D=new RegExp("(^|\\s)"+E+"(\\s|$)");return D.test(C.className)},toggleClass:function(C,D){JELLY.hasClass(C,D)?JELLY.removeClass(C,D):JELLY.addClass(C,D)},createElement:function(F,C){var E=document.createElement(F);for(var D in C){switch(D){case"setHTML":E.innerHTML=C[D];break;case"class":E.className=C[D];break;case"style":E.style.cssText=C[D];break;default:E.setAttribute(D,C[D])}}return E},insertElement:function(E,C,D){D=D||"bottom";switch(D){case"before":return C.parentNode.insertBefore(E,C);case"after":return C.parentNode.insertBefore(E,C.nextSibling);case"top":return C.insertBefore(E,C.firstChild);default:return C.appendChild(E)}},replaceElement:function(D,C){return D.parentNode.replaceChild(C,D)},removeElement:function(C){return C.parentNode.removeChild(C)},getRelative:function(E,D,C){switch(D){case"next":return A(E,"sibling",{type:"next",factor:C});case"previous":return A(E,"sibling",{type:"previous",factor:C});case"first":return A(E,"child",{type:"first"});case"last":return A(E,"child",{type:"last"});case"parent":return A(E,"parent",{factor:C})}},getXY:function(C){var D=[0,0];while(C!=null){D[0]+=C.offsetLeft;D[1]+=C.offsetTop;C=C.offsetParent}return D},setXY:function(D,C,F,E){var E=E||"px";D.style.left=C+E;D.style.top=F+E},getStyle:function(E,G,C){var F;if(G=="opacity"){if(E.__opacity==undefined){E.__opacity=1}return E.__opacity}if(E.style[G]){F=E.style[G]}else{if(E.currentStyle){F=E.currentStyle[G]}else{if(document.defaultView&&document.defaultView.getComputedStyle){G=G.toCssCase();var D=document.defaultView.getComputedStyle(E,"");F=D?D.getPropertyValue(G):null}else{return null}}}if(G.toLowerCase().indexOf("color")!=-1){return F.cssColorToArray()}return C!==false?parseInt(F,10):F},setOpacity:function(C,D){if(C.filters){JELLY.setOpacity=function(E,F){if(E.__opacity==undefined){E.__opacity=1}E.style.filter=(F==1)?"":"alpha(opacity="+F*100+")";E.__opacity=F}}else{JELLY.setOpacity=function(E,F){if(E.__opacity==undefined){E.__opacity=1}E.style.opacity=E.__opacity=F}}JELLY.setOpacity(C,D)},getByClass:function(H,F){var D=[],F=F||document.getElementsByTagName("*"),G=new RegExp("(^|\\s)"+H+"(\\s|$)");for(var E=0,C=F.length;E<C;E++){if(G.test(F[E].className)){D[D.length]=F[E]}}return D},Q:function(R){var D=R,S=function(E){return document.getElementById(E)},H=function(W){var V,U=W.length,E=[];for(V=0;V<U;V++){E[V]=W[V]}return E},T=function(E,U){return H((U||document).getElementsByTagName(E))},Q=JELLY.getByClass;if(D.item&&typeof D.length!=undefined){return H(D)}else{D.normalize()}if(!D.has(" ")){if(D.has("#")){return S(D.split("#")[1])}if(!D.has(".")){return T(D)}else{if(D.split(".")[0]!=""){return Q(D.split(".")[1],T(D.split(".")[0]))}else{return Q(D.split(".")[1])}}}else{var F=D.split(" "),C=F[0].has("#")?C=S(F[0].split("#")[1]):false;if(C){if(!F[1].has(".")){return T(F[1],C)}else{if(F[1].split(".")[0]!=""){return Q(F[1].split(".")[1],T(F[1].split(".")[0],C))}else{return Q(F[1].split(".")[1],T("*",C))}}}else{var P,N,M=[],K=[];if(F[0].has(".")){P=F[0].split(".")[0]?Q(F[0].split(".")[1],T(F[0].split(".")[0])):Q(F[0].split(".")[1])}else{P=T(F[0])}N=!F[1].has(".")?"tag":F[1].split(".")[0]!=""?"tag.class":".class";var I=P.length,G=0,J,L,O;switch(N){case"tag":for(G;G<I;G++){J=T(F[1],P[G]);if(J.length!==0){K=K.concat(J)}}break;case"tag.class":L=F[1].split(".")[1];O=F[1].split(".")[0];for(G;G<I;G++){J=Q(L,T(O,P[G]));if(J.length!==0){K=K.concat(J)}}break;case".class":L=F[1].split(".")[1];for(G;G<I;G++){J=Q(L,T("*",P[G]));if(J.length!==0){K=K.concat(J)}}}while(K[0]){J=K.pop();if(J.__Q_marked==undefined){J.__Q_marked=true;M[M.length]=J}}for(G=0;M[G];G++){M[G].__Q_marked=undefined}return M}}},addEvent:function(E,G,H){var D=!!E.addEventListener,K=!!E.attachEvent,F=G.has("mouseenter"),I=G.has("mouseleave"),J=arguments.callee,C;if(K&&!D){C=function(L){L=JELLY.fixEvent(L);H.call(E,L)}}if(F||I){C=function(L){L=JELLY.fixEvent(L);if(!JELLY.mouseEnterLeave.call(E,L)){return }H.call(E,L)};G=F?"mouseover":"mouseout"}J.log=J.log||[];J.log.push([E,G,C||H]);if(D){return E.addEventListener(G,C||H,false)}if(K){return E.attachEvent("on"+G,C)}return false},removeEvent:function(E,D,C){!!E.removeEventListener?E.removeEventListener(D,C,false):E.detachEvent("on"+D,C)},purgeEventLog:function(){if(JELLY.addEvent.log.length>1){var C=JELLY.addEvent.log,D,E;for(D=0;C[D];D++){E=C[D];if(E[0]==window&&E[1]=="unload"){continue}JELLY.removeEvent(E[0],E[1],E[2])}}},fixEvent:function(C){C=C||window.event;if(window.event&&!window.opera){C.target=C.srcElement;C.relatedTarget=function(){switch(C.type){case"mouseover":return C.fromElement;case"mouseout":return C.toElement}}();C.stopPropagation=function(){C.cancelBubble=true};C.preventDefault=function(){C.returnValue=false};C.pageX=C.clientX+document.documentElement.scrollLeft;C.pageY=C.clientY+document.documentElement.scrollTop}return C},mouseEnterLeave:function(F){var E,D;if(F.relatedTarget){E=F.relatedTarget;if(E.nodeType!=1||E==this){return false}var C=this.getElementsByTagName("*");for(D=0;C[D];D++){if(E==C[D]){return false}}}return true},stopEvent:function(C){C=JELLY.fixEvent(C);C.stopPropagation();C.preventDefault()},getCookie:function(D){var C=new RegExp(D+"=([^; ]+)").exec(document.cookie);if(!C){return null}return unescape(C[1])},setCookie:function(D,F,C,H,E,G){if(C){C=new Date(new Date().getTime()+((1000*60*60*24)*C)).toGMTString()}document.cookie=D+"="+escape(F)+(C?";expires="+C:"")+(H?";path="+H:"")+(E?";domain="+E:"")+(G?";secure":"")},removeCookie:function(C,E,D){if(JELLY.getCookie(C)){document.cookie=C+"="+(E?";path="+E:"")+(D?";domain="+D:"")+(";expires="+new Date(0))}},getViewport:function(){if(typeof window.innerWidth!="undefined"){return[window.innerWidth,window.innerHeight]}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){return[document.documentElement.clientWidth,document.documentElement.clientHeight]}else{return[document.body.clientWidth||0,document.body.clientHeight||0]}}},parseQueryString:function(E){E=E||window;if(E.href.has("?")){var C=E.href.split("?")[1].split("&"),D=C.length-1,F={};do{var G=C[D].split("=");F[G[0]]=G[1]}while(D--);return F}return false},extend:function(F,C,D){var E;if(D!==false){for(E in C){F[E]=C[E]}}else{for(E in C){if(!F[E]){F[E]=C[E]}}}return F},browser:{ie:!!window.ActiveXObject,ie6:!!(window.ActiveXObject&&!window.XMLHttpRequest),ie7:!!(window.ActiveXObject&&window.XMLHttpRequest)},local:"for(var i in JELLY){if(i!='local')eval('var '+i+'=JELLY.'+i)};i=undefined;"};function A(E,F,D){var C=D.factor||1;switch(F){case"sibling":do{do{E=E[D.type+"Sibling"]}while(E&&E.nodeType!=1)}while(E&&--C);break;case"child":if(D.type=="first"){E=E.firstChild;while(E&&E.nodeType!=1){E=E.nextSibling}}else{if(D.type=="last"){E=E.lastChild;while(E&&E.nodeType!=1){E=E.previousSibling}}}break;case"parent":do{E=E.parentNode}while(E&&--C)}return E||false}return B}();JELLY.extend(Array.prototype,{forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}}},false);Array.prototype.each=Array.prototype.forEach;JELLY.extend(String.prototype,{has:function(A){return this.indexOf(A)!=-1?true:false},trim:function(){return this.replace(/^\s+|\s+$/g,"")},normalize:function(){return this.replace(/\s{2,}/g," ").trim()},toCssCase:function(){return this.replace(/([A-Z])/g,"-$1").toLowerCase()},cssToCamelCase:function(){return this.replace(/-\D/gi,function(A){return A.charAt(A.length-1).toUpperCase()})},cssRgbToHex:function(){var A=this.match(/[\d]{1,3}/g),C=[],B;for(B=0;B<3;B++){var D=(A[B]-0).toString(16);C.push(D.length==1?"0"+D:D)}return"#"+C.join("")},cssHexToArray:function(){var C=this.match(/^#([\w]{1,2})([\w]{1,2})([\w]{1,2})$/),A=[],B;for(B=1;B<C.length;B++){if(C[B].length==1){C[B]+=C[B]}A.push(parseInt(C[B],16))}return A},cssColorToArray:function(){if(this.has("#")){return this.cssHexToArray()}return this.cssRgbToHex().cssHexToArray()}},false);if(JELLY.browser.ie6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}JELLY.addClass(document.documentElement,"js");JELLY.addEvent(window,"unload",JELLY.purgeEventLog);
/*
 *
 * AJAX MODULE
 * 
 */
JELLY.Ajax=function(B,A){this.updateElement=B;JELLY.extend(this,A||{});this.feedbackElement=this.feedbackElement||this.updateElement};JELLY.Ajax.prototype={onstart:function(){},onsuccess:function(){this.updateElement.innerHTML=this._xhr.responseText},oncomplete:function(){},ontimeout:function(){alert("Server busy, please try again later")},timeout:12000,nocache:false,feedbackClass:"loading",feedback:function(A){this.inprogress=A;A?JELLY.addClass(this.feedbackElement,this.feedbackClass):JELLY.removeClass(this.feedbackElement,this.feedbackClass)},request:function(B,A){var C;if(A.formElement){this._xhr.open("POST",B,true);this._xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");C=this.serializeFormData(A.formElement)}else{this._xhr.open("GET",B,true)}if(this.nocache){this._xhr.setRequestHeader("If-Modifed-Since","Sat, 1 Jan 2000 00:00:00 GMT")}this._xhr.send(C||null)},send:function(B,A){if(this.inprogress){return false}this._xhr=this._getXHR();if(this._xhr){this.feedback(true);this.onstart();var C=this;this._xhr.onreadystatechange=function(){if(C._httpSuccess()){clearTimeout(C.timer);C.onsuccess();C.feedback(false);C.oncomplete.call(C);C._xhr=null}};this.timer=setTimeout(function(){C._httpFail.call(C)},this.timeout);this.request(B,A||{});return true}return false},serializeFormData:function(A){var E=[],G=[],H,C,F,D;function B(K,J){E[E.length]=(K.name+"="+encodeURIComponent(J).replace(/%20/g,"+"))}for(F=0;F<A.elements.length;F++){H=A.elements[F];switch(H.nodeName.toLowerCase()){case"input":switch(H.type.toLowerCase()){case"submit":break;case"checkbox":if(H.checked){B(H,H.value||"on")}break;case"radio":C=true;for(D=0;D<G.length;D++){if(G[D]==H.name){C=false}}if(C){G[G.length]=H.name}break;default:B(H,H.value)}break;default:B(H,H.value)}}for(F=0;F<G.length;F++){var I=A[G[F]];for(D=0;D<I.length;D++){if(I[D].checked){B(I[D],I[D].value||"on");break}}}return E.join("&")},_getXHR:function(){var B=false;if(window.XMLHttpRequest){B=new XMLHttpRequest()}else{if(window.ActiveXObject){try{B=new ActiveXObject("Msxml2.XMLHTTP")}catch(A){try{B=new ActiveXObject("Microsoft.XMLHTTP")}catch(A){}}}}return B},_httpSuccess:function(){return !!(this._xhr.readyState==4&&(this._xhr.status==200||this._xhr.status==304||(this._xhr.status==undefined&&/webkit/.test(navigator.userAgent.toLowerCase()))))},_httpFail:function(){if(this._xhr!==null){this._xhr.abort()}this.feedback(false);this.ontimeout()}};
/*
 *
 * ANIMATION MODULE  
 * Credits : Moofx, Transition equations by Robert Penner.
 *
 */
JELLY.transitions={linear:function(H,E,F,G){return F*H/G+E},quadIn:function(H,E,F,G){return F*(H/=G)*H+E},quadOut:function(H,E,F,G){return -F*(H/=G)*(H-2)+E},quadInOut:function(H,E,F,G){if((H/=G/2)<1){return F/2*H*H+E}return -F/2*((--H)*(H-2)-1)+E},cubicIn:function(H,E,F,G){return F*(H/=G)*H*H+E},cubicOut:function(H,E,F,G){return F*((H=H/G-1)*H*H+1)+E},cubicInOut:function(H,E,F,G){if((H/=G/2)<1){return F/2*H*H*H+E}return F/2*((H-=2)*H*H+2)+E},quartIn:function(H,E,F,G){return F*(H/=G)*H*H*H+E},quartOut:function(H,E,F,G){return -F*((H=H/G-1)*H*H*H-1)+E},quartInOut:function(H,E,F,G){if((H/=G/2)<1){return F/2*H*H*H*H+E}return -F/2*((H-=2)*H*H*H-2)+E},quintIn:function(H,E,F,G){return F*(H/=G)*H*H*H*H+E},quintOut:function(H,E,F,G){return F*((H=H/G-1)*H*H*H*H+1)+E},quintInOut:function(H,E,F,G){if((H/=G/2)<1){return F/2*H*H*H*H*H+E}return F/2*((H-=2)*H*H*H*H+2)+E},sineIn:function(H,E,F,G){return -F*Math.cos(H/G*(Math.PI/2))+F+E},sineOut:function(H,E,F,G){return F*Math.sin(H/G*(Math.PI/2))+E},sineInOut:function(H,E,F,G){return -F/2*(Math.cos(Math.PI*H/G)-1)+E},expoIn:function(H,E,F,G){return(H==0)?E:F*Math.pow(2,10*(H/G-1))+E},expoOut:function(H,E,F,G){return(H==G)?E+F:F*(-Math.pow(2,-10*H/G)+1)+E},expoInOut:function(H,E,F,G){if(H==0){return E}if(H==G){return E+F}if((H/=G/2)<1){return F/2*Math.pow(2,10*(H-1))+E}return F/2*(-Math.pow(2,-10*--H)+2)+E},circIn:function(H,E,F,G){return -F*(Math.sqrt(1-(H/=G)*H)-1)+E},circOut:function(H,E,F,G){return F*Math.sqrt(1-(H=H/G-1)*H)+E},circInOut:function(H,E,F,G){if((H/=G/2)<1){return -F/2*(Math.sqrt(1-H*H)-1)+E}return F/2*(Math.sqrt(1-(H-=2)*H)+1)+E},elasticIn:function(M,H,I,J,N,K){if(M==0){return H}if((M/=J)==1){return H+I}if(!K){K=J*0.3}if(!N){N=1}if(N<Math.abs(I)){N=I;var L=K/4}else{var L=K/(2*Math.PI)*Math.asin(I/N)}return -(N*Math.pow(2,10*(M-=1))*Math.sin((M*J-L)*(2*Math.PI)/K))+H},elasticOut:function(M,H,I,J,N,K){if(M==0){return H}if((M/=J)==1){return H+I}if(!K){K=J*0.3}if(!N){N=1}if(N<Math.abs(I)){N=I;var L=K/4}else{var L=K/(2*Math.PI)*Math.asin(I/N)}return N*Math.pow(2,-10*M)*Math.sin((M*J-L)*(2*Math.PI)/K)+I+H},elasticInOut:function(M,H,I,J,N,K){if(M==0){return H}if((M/=J/2)==2){return H+I}if(!K){K=J*(0.3*1.5)}if(!N){N=1}if(N<Math.abs(I)){N=I;var L=K/4}else{var L=K/(2*Math.PI)*Math.asin(I/N)}if(M<1){return -0.5*(N*Math.pow(2,10*(M-=1))*Math.sin((M*J-L)*(2*Math.PI)/K))+H}return N*Math.pow(2,-10*(M-=1))*Math.sin((M*J-L)*(2*Math.PI)/K)*0.5+I+H},backOffset:1.70158,backIn:function(J,F,G,H,I){if(!I){I=JELLY.transitions.backOffset}return G*(J/=H)*J*((I+1)*J-I)+F},backOut:function(J,F,G,H,I){if(!I){I=JELLY.transitions.backOffset}return G*((J=J/H-1)*J*((I+1)*J+I)+1)+F},backInOut:function(J,F,G,H,I){if(!I){I=JELLY.transitions.backOffset}if((J/=H/2)<1){return G/2*(J*J*(((I*=(1.525))+1)*J-I))+F}return G/2*((J-=2)*J*(((I*=(1.525))+1)*J+I)+2)+F},bounceIn:function(H,E,F,G){return F-JELLY.transitions.bounceOut(G-H,0,F,G)+E},bounceOut:function(H,E,F,G){if((H/=G)<(1/2.75)){return F*(7.5625*H*H)+E}else{if(H<(2/2.75)){return F*(7.5625*(H-=(1.5/2.75))*H+0.75)+E}else{if(H<(2.5/2.75)){return F*(7.5625*(H-=(2.25/2.75))*H+0.9375)+E}else{return F*(7.5625*(H-=(2.625/2.75))*H+0.984375)+E}}}},bounceInOut:function(H,E,F,G){if(H<G/2){return JELLY.transitions.bounceIn(H*2,0,F,G)*0.5+E}return JELLY.transitions.bounceOut(H*2-G,0,F,G)*0.5+F*0.5+E}};JELLY.Tween=function(B,A){this.element=B;JELLY.extend(this,A||{})};JELLY.Tween.prototype={oncomplete:function(){},transition:JELLY.transitions.sineInOut,duration:500,unit:"px",wait:false,timerSpeed:20,setDuration:function(A){this.duration=A;return this},setTransition:function(A){this.transition=JELLY.transitions[A];return this},setOpacity:function(A){JELLY.setOpacity(this.element,A);return this},then:function(A){this.chains=this.chains||[];this.chains.push(A);return this},stop:function(){clearInterval(this.timer);this.timer=null;return this},start:function(C,A){if(!this.wait){this.stop()}if(this.timer){return }if(typeof C!="string"){this.props=C;this.values=A}else{this.props=[C];this.values=[A]}var B=this.values.length-1;do{this.props[B]=this.props[B].cssToCamelCase();if(this.props[B].toLowerCase().indexOf("color")!=-1){if(this.values[B].constructor!=Array){this.values[B]=[JELLY.getStyle(this.element,this.props[B]),this.values[B].cssHexToArray()]}else{this.values[B]=[this.values[B][0].cssHexToArray(),this.values[B][1].cssHexToArray()]}this.values[B].color=true}else{if(this.values[B].constructor!=Array){this.values[B]=[JELLY.getStyle(this.element,this.props[B]),this.values[B]]}}}while(B--);this.time=new Date().getTime();var D=this;this.timer=setInterval(function(){D._step.call(D)},D.timerSpeed);return this},_step:function(){var A=new Date().getTime();if(A<this.time+this.duration){this.cTime=A-this.time}else{this.stop();this._tidyUp();this.oncomplete();return this._callChain()}this._increase()},_tidyUp:function(){var A=this.props.length-1;do{this.values[A].color?this.element.style[this.props[A]]="rgb("+this.values[A][1].join(",")+")":this._setStyle(this.props[A],this.values[A][1])}while(A--)},_increase:function(){var A=this.props.length-1;do{this.values[A].color?this.element.style[this.props[A]]="rgb("+Math.round(this._compute(this.values[A][0][0],this.values[A][1][0]))+","+Math.round(this._compute(this.values[A][0][1],this.values[A][1][1]))+","+Math.round(this._compute(this.values[A][0][2],this.values[A][1][2]))+")":this._setStyle(this.props[A],this._compute(this.values[A][0],this.values[A][1]))}while(A--)},_compute:function(B,A){return this.transition(this.cTime,B,(A-B),this.duration)},_setStyle:function(A,B){A=="opacity"?this.setOpacity(B):this.element.style[A]=B+this.unit},_callChain:function(){if(this.chains&&this.chains.length){var A=this;setTimeout(function(){(A.chains.shift()).call(A)},10)}}};
/*
 *
 * SCROLL CLASS   
 *
 */
JELLY.Scroll=function(B,A){this.element=B;JELLY.extend(this,A||{})};JELLY.Scroll.prototype=JELLY.extend(new JELLY.Tween(),{start:function(A,D){if(!this.wait){this.stop()}if(this.timer){return }if(this.element==window){var C=this.getWindowScroll();if(A.constructor!=Array){A=[C[0],A]}if(D.constructor!=Array){D=[C[0],D]}this._increase=function(){this.element.scrollTo(this._compute(this.values[0][0],this.values[0][1]),this._compute(this.values[1][0],this.values[1][1]))}}else{if(A.constructor!=Array){A=[this.element.scrollLeft,A]}if(D.constructor!=Array){D=[this.element.scrollTop,D]}this._increase=function(){this.element.scrollLeft=this._compute(this.values[0][0],this.values[0][1]);this.element.scrollTop=this._compute(this.values[1][0],this.values[1][1])}}this.values=[A,D];this.time=new Date().getTime();var B=this;this.timer=setInterval(function(){B._step.call(B)},B.timerSpeed);return this},getWindowScroll:function(){var A=[0,0];if(typeof window.pageYOffset!="undefined"){A=[window.pageXOffset,window.pageYOffset]}else{if(typeof document.documentElement.scrollTop!="undefined"&&(document.documentElement.scrollTop>0||document.documentElement.scrollLeft>0)){A=[document.documentElement.scrollLeft,document.documentElement.scrollTop]}}return A},_tidyUp:function(){if(this.element==window){this.element.scrollTo(this.values[0][1],this.values[1][1])}else{this.element.scrollLeft=this.values[0][1];this.element.scrollTop=this.values[1][1]}}});