Aroma.DivView=function(b,a){Aroma.AbstractView.call(this,b,a);this.stage=document.createElement("div");this.viewport=document.createElement("div");this.stageFrag=document.createDocumentFragment();this.viewport.appendChild(this.stage);this.alignstage=function(){this.stage.style.position="absolute";this.stage.style.left=(this.vpWidth-this.width)/2+"px";this.stage.style.top=(this.vpHeight-this.height)/2+"px"}};Aroma.DivView.prototype=new Aroma.AbstractView;Aroma.DivView.prototype.constructor=Aroma.DivView;Aroma.DivView.prototype.setup=function(){this.stage.style.background='url("'+this.oldSource.src+'") no-repeat';this.stage.style.position="absolute";this.stage.style.overflow="hidden"};Aroma.DivView.prototype.dispose=function(){Aroma.AbstractView.prototype.dispose.call(this);this._pieceList=[];this.viewport.removeChild(this.stage)};Aroma.DivView.prototype.setSize=function(b,a){Aroma.AbstractView.prototype.setSize.call(this,b,a);this.stage.style.width=b+"px";this.stage.style.height=a+"px";this.alignstage()};Aroma.DivView.prototype.setViewPortSize=function(b,a){Aroma.AbstractView.prototype.setViewPortSize.call(this,b,a);this.viewport.style.width=b+"px";this.viewport.style.height=a+"px";this.alignstage()};Aroma.DivView.prototype.prepare=function(){this.stage.appendChild(this.stageFrag);this.stageFrag=null};Aroma.DivView.prototype.getPieceAt=function(b,c,e){var d=this.posToID(b,c);if(this._pieceList[d]!=null)return this._pieceList[d];var a=new Aroma.DivPiece,f=this.getPieceBounds(b,c);a.col=b;a.row=c;a.bounds=f;a.view=this;e.piece=a;ConcatObject.concat(a.options,e.getPieceOptions());a.setup(this.newSource,this.oldSource);this.stageFrag.appendChild(a.div);this._pieceList[d]=a;return a};Aroma.DivPiece=function(){Aroma.Piece.call(this);this.options={dir:"b",push:false};this.setLoc=function(a,b){var c=this.bounds.height,d=this.bounds.width;if(a=="l"||a=="r"){this.proxy.new_x=(a=="r"?1:-1)*(d-d*b*.01);if(this.options.push)this.proxy.old_x=(a=="r"?-1:1)*d*b*.01}if(a=="t"||a=="b"){this.proxy.new_y=(a=="b"?1:-1)*(c-c*b*.01);if(this.options.push)this.proxy.old_y=(a=="b"?-1:1)*c*b*.01}}};Aroma.DivPiece.prototype=new Aroma.Piece;Aroma.DivPiece.prototype.constructor=Aroma.DivPiece;Aroma.DivPiece.prototype.setup=function(a,b){this.newSource=a;this.oldSource=b;this.proxy={x:0,y:0,slide:0,opacity:100,old_x:0,old_y:0,new_x:0,new_y:0,piece:this};this.div=document.createElement("div");this.origin_x=this.bounds.x;this.origin_y=this.bounds.y;this.div.style.position="absolute";this.div.style.overflow="hidden";this.div.style.width=this.bounds.width+"px";this.div.style.height=this.bounds.height+"px";this.div.style.left=this.origin_x+"px";this.div.style.top=this.origin_y+"px";this.div.style.backgroundImage='url("'+b.src+'")';this.div.style.backgroundPosition=-this.bounds.x+"px "+-this.bounds.y+"px";this.img_div=document.createElement("div");this.img_div.style.position="relative";this.img_div.style.width=this.bounds.width+"px";this.img_div.style.height=this.bounds.height+"px";this.img_div.style.backgroundImage='url("'+a.src+'")';this.img_div.style.backgroundPosition=-this.bounds.x+"px "+-this.bounds.y+"px";this.img_div.style.filter="inherit";this.div.appendChild(this.img_div)};Aroma.DivPiece.prototype.dispose=function(){this.div.removeChild(this.img_div);this.view.stage.removeChild(this.div);this.img_div=null;this.div=null;this.proxy.piece=null;this.proxy=null;this.oldSource=null;this.newSource=null;this.view=null;this.options=null;this.bounds=null};Aroma.DivPiece.prototype.proxyUpdate=function(){this.piece.div.style.left=this.x+this.piece.origin_x+"px";this.piece.div.style.top=this.y+this.piece.origin_y+"px";this.piece.setLoc(this.piece.options.dir.charAt(0),this.slide);this.piece.options.dir.length==2&&this.piece.setLoc(this.piece.options.dir.charAt(1),this.slide);this.piece.img_div.style.left=this.new_x+"px";this.piece.img_div.style.top=this.new_y+"px";if(this.piece.options.push)this.piece.div.style.backgroundPosition=this.old_x-this.piece.origin_x+"px "+(this.old_y-this.piece.origin_y)+"px";this.piece.div.style.filter="alpha(opacity="+this.opacity+")";this.piece.div.style.opacity=this.opacity/100;this.piece.div.style.MozOpacity=this.opacity/100;this.piece.div.style.KhtmlOpacity=this.opacity/100;this.piece.div.style.MSOpacity=this.opacity/100}