(function(f){var c=function(l,m){if(window.getComputedStyle){return getComputedStyle(l,m)}else{return l.currentStyle}};var a=function(l){var m=c(l).width;if(m=="auto"){return f(l).width()}else{return parseFloat(m)}};window.Elastic=function e(q){var N,M,K,I,C,P,r,D;var E,v,y,O,x,u,Q,B,t,m,H,A,F;var J,R,s,L,o,p,z,w,n;var S=/(^|\s+)group\-by\-(\d+)(\s+|$)/;var G=/(^|\s+)span\-(\d+)(\s+|$)/;u=[];B=t=0;E=f.find(".two-columns, .three-columns, .four-columns, .auto-columns",q);for(N=0,C=E.length;N<C;N++){v=E[N];y=v.className;if(y.indexOf("two-columns")>-1){Q=2}else{if(y.indexOf("three-columns")>-1){Q=3}else{if(y.indexOf("four-columns")>-1){Q=4}else{if(y.indexOf("auto-columns")>-1){Q=f.find(".column",v).length;if(S.test(y)){Q=Number(RegExp.$2)}}else{continue}}}}v=f.find("> .container",E[N])[0]||v;m=Math.round(a(v)/Q);O=f.find("> .column, > .fixed-column, > .elastic-column",v);for(M=0,P=O.length;M<P;M++){J=[];s=[];p=[];A=F=R=z=0;x=O[M];H=1;if(G.test(x.className)){H=Number(RegExp.$2)}x.escol=H;t+=H;if(t==Q||M==(P-1)){u.push(x);B=0;A=1}else{if(t<Q){u.push(x);B=t}else{if(t>Q){B=H;A=1;F=1}}}if(A){for(K=0,r=u.length;K<r;K++){w=u[K];n=w.className;if(n.indexOf("fixed-")>-1){J.push(w);R+=a(w)}else{if(n.indexOf("elastic-")>-1){s.push(w)}else{p.push(w);w.style.width="10px";w.style.width=(m*w.escol)+"px";z+=a(w)}}}D=s.length;if(D>0){o=Math.round((a(v)-(z+R))/D);L=o*D;if(D>1){for(I=0;I<D;I++){s[I].style.width=o+"px"}}s[D-1].style.width=(a(v)-(z+R+(L-o)))+"px"}else{if(p.length>0&&t==Q){p[p.length-1].style.width=(a(v)-((z-a(p[p.length-1]))+R))+"px"}}u=[];t=0}if(F){u=[x];t=H}}}for(N in e.helpers){if(e.helpers.hasOwnProperty(N)){e.helpers[N](q)}}};var e=window.Elastic;e.version="1.2.4";e.reset=function j(o){jQuery(document).trigger("elastic:beforeReset");var n,m,t,r,l,s,q;r=f.find(".same-height > *, .full-height, .equalized-height",o);for(n=0,l=r.length;n<l;n++){r[n].style.height=""}s=f.find(".vertical-center, .center",o);for(n=0,q=s.length;n<q;n++){s[n].parentNode.style.paddingTop=""}m=f(".column, .elastic-column",o);for(n=0,t=m.length;n<t;n++){m[n].parentNode.style.width=""}jQuery(document).trigger("elastic:reset")};e.refresh=function g(l){jQuery(document).trigger("elastic:beforeRefresh");e.reset(l);e(l);jQuery(document).trigger("elastic:refresh")};e.configuration={refreshOnResize:true};e.helpers={"full-width":function h(l){f(".full-width",l).each(function(){f(this).width(f(this.parentNode).width()-(f(this).outerWidth(true)-f(this).width()))})},"same-height":function i(l){f(".same-height",l).each(function(){var m=f(this).outerHeight(true)-(f(this).outerHeight(true)-f(this).height());f("> *",this).each(function(){f(this).css("height",m)})})},"equalized-height":function d(l){f(".equalized-height",l).each(function(){var m=f("> .column, > .container > .column",this);var n=0;m.each(function(){var o=f(this).outerHeight(true);n=(n>o)?n:o}).each(function(){f(this).css("height",n)})})},"full-height":function b(l){f(".full-height",l).each(function(){f(this).css("height",f(this.parentNode).height()-(f(this).outerHeight(true)-f(this).height()))})},center:function k(l){f(".vertical-center, .center",l).each(function(){var m=Math.round((f(this.parentNode).height()-f(this).outerHeight(true))/2);f(this.parentNode).css({paddingTop:m+"px",height:(f(this.parentNode).css("height"))?(f(this.parentNode).outerHeight()-m):""})})}}})(jQuery);jQuery(window).bind("load",function(){jQuery(document).trigger("elastic:beforeInitialize");var a=document.body.clientWidth;Elastic();if(a!=document.body.clientWidth){Elastic.refresh()}jQuery(window).bind("resize",function(){if(Elastic.configuration.refreshOnResize){Elastic.refresh()}});jQuery(document).bind("elastic",Elastic.refresh);jQuery(document).trigger("elastic:Initialize")});
