/*! jsMorph v0.4.0 http://jsMorph.com/ | http://jsMorph.com/license */var jsMorph=function(g,a,e,f,j,i,c){var k=(function(y,p,l,E,v,u){var o={},A,H,I,m=y.style,z,q,x,w=0,D,G,F=[],s=function(n){return[n.offsetWidth,n.offsetHeight,n.offsetLeft,n.offsetTop]},r=function(){if(document.body.currentStyle){return function(n,J){return n.currentStyle[J.replace(/\-(\w)/g,function(){return arguments[1].toUpperCase()})]}}else{return function(n,J){return document.defaultView.getComputedStyle(n,null).getPropertyValue(J)}}}(),C=function(M){var K={},N,n=M.style,L=document.createElement("div"),J=L.style;J.cssText="position:absolute;left:0;top:-10ex;width:10em;height:72pt;";M.appendChild(L);N=s(L).concat(s(M));K={em:N[0]/10,pt:N[1]/72,pc:N[1]/6,"in":N[1],cm:N[1]/2.54,mm:N[1]/25.4,ex:Math.abs(N[3])/10,"%font":N[0]/1000,"%line":N[0]/1000};J.cssText+=";font-size:"+p["font-size"]+(p["font-family"]?";font-family:"+p["font-family"]:"")+";";N=s(L);M.removeChild(L);K.exn=Math.abs(N[3]/10);q=n.cssText;n.cssText+=";position:absolute;left:0%;top:0%;";N=s(M);n.cssText+=";left:-100%;top:-100%;";N=N.concat(s(M));n.cssText=q;K["%outX"]=(N[2]-N[6])/100;K["%outY"]=(N[3]-N[7])/100;return K},t=function(J,L,K){if(J[2]!="px"&&J[2]!=""){if(J[2]!="%"){J[1]*=K[J[2]]}else{if(!L.match(/^(font)/)){J[1]*=L.match(/width|left|right|padding|margin|text-ind/)?K["%outX"]:K["%outY"]}else{J[1]*=K["%"+L.split("-")[0]]}}}};y.initStyle=y.style.cssText;if(p["font-size"]){z=/([\-0-9\.]+)([a-z%]+)(!*)/.exec(p["font-size"])}for(var B in p){if(!(B.replace(/\-(\w)/g,function(){return arguments[1].toUpperCase()}) in m)){delete (p[B]);continue}I=/([\-0-9\.]+)([a-z%]*)(\s*!*)/.exec(p[B])||[];p[B]=p[B].toString().replace("!","");H=/([\-0-9\.]+)(\D*)/.exec(r(y,B.match(/^(padding|margin)$/)?B+"-left":B.match(/^(border-width)$/)?"border-left-width":B.match(/(border-radius)$/)?(x=(B.match(/^(\-\w+\-)/)||["",""])[1])+"border-"+(x=="-moz-"?"radius-topleft":"top-left-radius"):B))||["0px",0,"px"];if(!H[1]&&B.match(/^(height|width)/)){m.zoom=1;F[0]=/([\-0-9\.]+)([a-z%]*)/.exec(r(y,"padding-"+(B=="width"?"left":"top")));F[1]=/([\-0-9\.]+)([a-z%]*)/.exec(r(y,"padding-"+(B=="width"?"right":"bottom")));if((F[0]&&F[0][2]!="px")||(F[1]&&F[1][2]!="px")){t(F[0],"padding",A||(A=C(y)));t(F[1],"padding",A)}H=["",(B=="width"?y.clientWidth:y.clientHeight)-F[0][B=="width"?0:1]-F[1][B=="width"?0:1],"px"]}if((H[2]&&H[2]!="px")||(H[2]!=I[2])){t(H,B,A||(A=C(y)));t(I,B,A);if(z&&B!="font-size"){if(I[2]=="em"){I[1]*=z[1]/(z[2]!="em"?A.em:1)}if(I[2]=="ex"){I[1]*=A.exn/A.ex}}}H[1]=parseFloat(H[1]);D=parseFloat(I[1])-H[1];if(w<Math.abs(D)){w=D}o[B]={full:H[1],delta:D,unit:I[2]==""?"":"px"}}w=12+Math.abs(l/w*(!E&&E!=0?1:E));if(u.speed&&w>u.speed){}else{u.speed=w}o.speed=w;if(v){v(o,A)}return o}),b=function(l){if(!l){return new Date().getTime()-b.sT||0}else{b.sT=new Date().getTime();return 0}},d=function(r,u,B,v,C,s,q){var A,z,l=false,D,w,t,E,p,o;for(var y=C.length;y--;){D=C[y];E=D.params;p=D.prop;o=D.initProp;w=r-(D.newTime||0)-E.delay;if(s&&!s[y]&&!D.newTime){continue}A="";if(w>0){t=(B||D.obj.backwards);z=D.ease(w/E.duration);if(w<E.duration){l=true;D.done=null;for(var x in p){A+=";"+x+":"+(o[x].full+(!t?z:1-z)*o[x].delta)+o[x].unit}D.objStyle.cssText+=A}else{if(!D.done){if(E.doEnd){if(!t){for(var x in p){A+=";"+x+":"+p[x]}D.objStyle.cssText+=A}else{D.objStyle.cssText=D.obj.initStyle}}else{for(var x in p){A+=";"+x+":"+(o[x].full+(!t?o[x].delta:0))+o[x].unit}D.objStyle.cssText+=A}if(D.onMorphEnd){D.onMorphEnd(D.obj,u(),v,o.speed,q.speed,D.objStyle.cssText)}D.done=true;D.newTime=null}}if(D.onMorph){D.onMorph(D.obj,D.objStyle,r,v+1,o.speed,q.speed,z,D.objStyle.cssText)}}else{l=true}}if(l){q.timer=window.setTimeout(function(){d(u(),u,B,++v,C,s,q)},q.speed)}else{q.timer=null;if(y<=0&&q.onMorphEnd){q.onMorphEnd(s,u(),v,q.speed)}}},h=[];this.reset=function(t,l,r,s,v,u,o){for(var p=h.length;p--;){for(var q in h[p]){q=null}h[p]=null;h.pop()}if(t){this.concat(t,l,r,s,v,u,o)}return this};this.init=function(r){var q=h.length,p,o;for(var s=r?q-1:0,l=q;s<l;s++){if(h[s].obj.initStyle!=undefined&&r==undefined){p=h[s].obj.style;o=p.cssText;if(h[s].obj.initStyle!=o){p.cssText=h[s].obj.initStyle}else{o=null}}h[s]["initProp"]=k(h[s].obj,h[s].prop,h[s].params.duration,h[s].params.speed,h[s].onMorphInit,this);if(o&&r==undefined){p.cssText=o}}return this};this.concat=function(o,t,r,q,m,p,l){if(!o.pop&&!o.item){o=[o]}if(!r){r={}}for(var s=o.length;s--;){if(typeof o[s]=="string"){o[s]=document.getElementById(o[s])}h[h.length]={obj:o[s],objStyle:o[s].style,prop:t,params:{duration:r.duration||500,delay:r.delay||0,speed:r.speed!=undefined?r.speed:1,doEnd:r.doEnd!=undefined?r.doEnd:true},ease:q||function(u){return u},onMorphInit:m,onMorph:p,onMorphEnd:l};this.init(true)}return this};if(g){this.concat(g,a,e,f,j,i,c)}this.stop=function(l){window.clearTimeout(this.timer)};this.start=function(p){var o=b();if(p&&(p.pop||p.item)){arguments=p}for(var q=[],r=arguments.length;r--;){for(var l=h.length;l--;){if(h[l].obj==arguments[r]){h[l].newTime=this.timer?o:0.1;q[l]=true}}}window.clearTimeout(this.timer);d(this.timer?o:b(true),b,this.backwards,1,h,q.length?q:null,this);return this}};

