(function(l){var a=function(m,n){if(window.getComputedStyle){return window.getComputedStyle(m,n)}else{return m.currentStyle}};var b=function(n){var m=a(n).width;if(m=="auto"||m.indexOf("px")<0){return l(n).width()}else{return parseFloat(m)}};window.Elastic=function e(ae){var H,C,K,L,T,N,ad,o,af,m,A,ac,y,aa,s,U,t,I,z,Y,V,E,G,F,q,B,O,M,n,J,X,Z,S,w,W,ab,D,x,p,Q=/(^|\s+)on\-(\d+)(\s+|$)/,P=/(^|\s+)span\-(\d+)(\s+|$)/,u=/(^|\s+)adaptive\-(\d+)\-(\d+)(\s+|$)/;I=[];Y=V=0;A=l.find(".columns",ae);for(K=0,ad=A.length;K<ad;K++){ac=A[K];aa=ac.className;if(aa.indexOf("on-")>-1&&Q.test(aa)){z=Number(RegExp.$2)}else{z=l.find("> .column, > .container > .column",ac).length}ac=l.find("> .container",ac)[0]||ac;y=b(ac);E=y/z;G=Math.round(E);if(aa.indexOf("adaptive-")>-1&&u.test(aa)){x=Number(RegExp.$2);p=Number(RegExp.$3);if(G>p){while(G>p){z=z+1;E=y/z;G=Math.round(E)}}else{if(G<x){while(G<x){z=z-1;E=y/z;G=Math.round(E)}}}}s=l.find("> .column",ac);for(L=0,o=s.length;L<o;L++){O=[];n=[];S=[];q=B=M=w=0;U=s[L];t=U.className;F=1;if(t.indexOf("span-")>-1&&P.test(t)){F=Number(RegExp.$2)}U.escol=F=((F<=z)?F:z);V+=F;if(V==z||L==(o-1)||t.indexOf("final")>-1){I.push(U);Y=0;q=1}else{if(V<z){I.push(U);Y=V}else{if(V>z){Y=F;q=1;B=1}}}if(q){for(T=0,af=I.length;T<af;T++){W=I[T];ab=W.className;if(ab.indexOf("fixed")>-1){O.push(W);M+=b(W)}else{if(ab.indexOf("elastic")>-1){n.push(W)}else{S.push(W);if(W==I[af-1]){W.style.width=Math.round(E*W.escol)+"px"}else{W.style.width=Math.round(G*W.escol)+"px"}w=w+b(W)}}}m=n.length;if(m>0){D=y-(w+M);if(D<=0){continue}Z=D/m;X=Math.round(Z);J=X*m;for(N=0;N<m;N++){n[N].style.width=X+"px"}if(J>D){C=J-D+1;for(H=1;H<C;H++){n[n.length-H].style.width=(X-1)+"px"}}else{if(J<D){C=D-J+1;for(H=1;H<C;H++){n[n.length-H].style.width=(X+1)+"px"}}}var v=0;for(var R=0;R<m-1;R++){v+=Number(n[R].style.width.replace("px",""))}n[m-1].style.width=(y-(w+M+(v)))+"px"}else{if(U.escol==z&&O.length===0){U.style.width=y+"px"}else{if(S.length>0&&O.length===0&&V==z){if(w>y){C=w-y+1;for(H=1;H<C;H++){S[S.length-H].style.width=((G-1)*S[S.length-H].escol)+"px"}}else{if(w<y){C=y-w+1;for(H=1;H<C;H++){S[S.length-H].style.width=((G+1)*S[S.length-H].escol)+"px"}}}var v=0;for(var R=0;R<S.length-1;R++){v+=Number(S[R].style.width.replace("px",""))}W.style.width=(y-(v))+"px"}else{if(V<z&&t.indexOf("final")>-1){U.style["margin"+((aa.indexOf("inverted")>-1)?"Left":"Right")]=(y-w-M)+"px"}}}}I=[];V=0}if(B){I=[U];V=F}}}for(K in e.helpers){if(e.helpers.hasOwnProperty(K)){e.helpers[K](ae)}}};var e=window.Elastic;e.version="2.0.3";e.reset=function g(u){var t=l(document);t.trigger("elastic:beforeReset");var n,y,v,z,x,s,r,q,o;z=l.find(".same-height > *, .full-height, .elastic-height",u);for(n=0,x=z.length;n<x;n++){z[n].style.height=""}s=l.find(".vertical-center, .center, .bottom",u);for(n=0,r=s.length;n<r;n++){s[n].parentNode.style.paddingTop="";s[n].parentNode.style.height=""}y=l.find(".column:not(.fixed), .full-width",u);for(n=0,v=y.length;n<v;n++){y[n].style.width=""}q=l.find(".column.final",u);for(n=0,o=q.length;n<o;n++){q[n].style.marginLeft="";q[n].style.marginRight=""}t.trigger("elastic:reset")};e.refresh=function f(n){var m=l(document);m.trigger("elastic:beforeRefresh");e.reset(n);e(n);m.trigger("elastic:refresh")};e.configuration={refreshOnResize:true};e.helpers={"full-width":function c(n){var o,m;var q=l.find(".full-width",n);var p=q.length;for(o=0;o<p;o++){m=l(q[o]);m.width(m.parent().width()-(m.outerWidth(true)-m.width()))}},"same-height":function h(m){l(".same-height",m).each(function(){var o=l("> *",this);var n=0;o.each(function(){var p=l(this).outerHeight(true);n=(n>p)?n:p}).each(function(){l(this).css("height",n)})})},"full-height":function i(m){l(".full-height",m).each(function(){var n=l(this);n.css("height",l(this.parentNode).height()-(n.outerHeight(true)-n.height()))})},"elastic-height":function j(m){l(".elastic-height",m).each(function(){var o=l(this);var n=0;l("> *:not(.elastic-height)",this.parentNode).each(function(){n+=l(this).outerHeight(true)});o.css("height",Math.round(o.parent().height()-n));e.refresh(this)})},center:function d(m){l(".vertical-center, .center",m).each(function(){var o=l(this.parentNode);var n=Math.round((o.height()-l(this).outerHeight(true))/2);o.css({paddingTop:n+"px",height:(o.css("height"))?(o.outerHeight()-n):""})})},bottom:function k(m){l(".bottom",m).each(function(){var o=l(this.parentNode);var n=Math.round(o.height()-l(this).outerHeight(true));o.css({paddingTop:n+"px",height:(o.css("height"))?(o.outerHeight()-n):""})})}};l(document).bind("elastic:beforeInitialize",function(){var m=/(^|\s+)display\s+([\w\_\-\d]+)(\s+|$)/;l(".display").each(function n(){m.test(this.className);var o=".position-"+RegExp.$2;l(o).removeClass(o).appendTo(this)})})})(jQuery);jQuery(window).bind("load",function(){var a=jQuery(document);var c=document.body.clientWidth;a.trigger("elastic:beforeInitialize");Elastic();if(c!=document.body.clientWidth){Elastic.refresh()}jQuery(window).bind("resize",function b(){if(Elastic.configuration.refreshOnResize){Elastic.refresh()}});a.bind("elastic",Elastic.refresh);a.trigger("elastic:initialize")});