daum.Tweener={framerate:60,is_stop:false,options:{delay:0,transition:function(e,a,g,f){return g*Math.sin(e/f*(Math.PI/2))+a},onStart:null,onUpdate:null,onComplete:null},propertys:["left","top","opacity","width","height"],is_loop:false,objects:[],to:function(c,b,a){this.is_stop=false;var d={};d.target=daum.$(c);d.duration=b;d.prop={};daum.extend(d,this.options);daum.extend(d,a);daum.Function.timeout(function(){if(this.is_stop){return}for(var e in a){if(this.propertys.indexOf(e)==-1){continue}var f="";if(e=="top"||e=="left"||e=="width"||e=="height"){f=parseInt(daum.getStyle(d.target,e).replace("px",""));if(isNaN(f)){f=0}}else{if(e=="opacity"){f=this.getOpacity(d.target)/100;if(isNaN(f)){f=1}}}d.prop[e]={b:f,c:a[e]-f}}d.stime=(new Date()-0);d.etime=d.duration*1000+d.stime;if(typeof d.onStart=="function"){d.onStart.call(this)}this.objects.push(d);if(!this.is_loop){this.is_loop=true;this.loop.call(this)}}.bind(this),d.delay*1000)},stop:function(){this.objects=[];this.is_stop=true},fadeOut:function(b,a,c){if(!a){a=0.3}this.to(b,a,{opacity:0,onComplete:c})},fadeIn:function(b,a,c){if(!a){a=0.3}this.to(b,a,{opacity:1,onComplete:c})},slideDown:function(c,b,d){if(c.getAttribute("slide")=="1"){return}if(!b){b=0.3}var a=parseInt(daum.getStyle(c,"height"),10);if(a==0&&c.getAttribute("oh")){a=c.getAttribute("oh")}c.style.height=0;c.setAttribute("slide","1");this.to(c,b,{height:a,onStart:function(){daum.show(c)},onComplete:function(){c.removeAttribute("slide");if(typeof d=="function"){d()}}})},slideUp:function(c,b,d){if(c.getAttribute("slide")=="1"){return}if(!b){b=0.3}var a=parseInt(daum.getStyle(c,"height"),10);if(a==0){return}c.setAttribute("oh",a);c.setAttribute("slide","1");this.to(c,b,{height:0,onComplete:function(){c.removeAttribute("slide");if(typeof d=="function"){d()}}})},loop:function(){var a=(new Date()-0);for(var g=0;g<this.objects.length;g++){var b=this.objects[g];var l=a-b.stime;var j=b.etime-b.stime;if(l>=j){for(var k in b.prop){var c=b.prop[k];try{this.setProperty(b,k,c.b+c.c)}catch(h){}}this.objects.splice(g,1);if(typeof b.onUpdate=="function"){b.onUpdate.call(this)}if(typeof b.onComplete=="function"){b.onComplete.call(this)}}else{for(var k in b.prop){var c=b.prop[k];var f=b.transition(l,c.b,c.c,j);try{this.setProperty(b,k,f)}catch(h){}}}if(typeof b.onUpdate=="function"){b.onUpdate.call(this)}}if(this.objects.length>0){daum.Function.timeout(function(){this.loop()}.bind(this),1000/daum.Tweener.framerate)}else{this.is_loop=false}},setProperty:function(c,b,a){if(b=="top"||b=="left"||b=="width"||b=="height"){c.target.style[b]=a+"px"}else{if(b=="opacity"){daum.setOpacity(c.target,a)}}},getOpacity:function(a){if(daum.Browser.ie){var b=(new RegExp("alpha\\s*\\(opacity\\s*=\\s*(\\d+)\\)")).exec(a.style.filter+"");if(b){return parseInt(b[1])}else{return 1}}else{return Math.round((a.style.opacity?parseFloat(a.style.opacity):1)*100)}}};

