// Build 20090624163704@JAMES-NB  Copyright(c) 2006-2008, Walkr.CN http://www.walkr.cn

var SimpleWindow=Class.create();SimpleWindow.prototype={initialize:function(name,options){this.name=name;this.showing=false;this.movable=false;this.options=Object.extend({movable:true,width:500,height:500},options||{});},getContent:function(){return this.getHTMLElement();},getHTMLElement:function(){if(!this.htmlElement)
this._createUI();return this.htmlElement;},_createUI:function(){var div=document.createElement('DIV');div.style.position='absolute';div.style.zIndex='2999';div.style.width=this.options.width+'px';div.style.height=this.options.height+'px';div.style.background='#ffffff';div.style.border='13px solid #d1d1d1';div.innerHTML='';document.body.appendChild(div);div.style.display='none';this.htmlElement=div;},show:function(){if(this.showing)
this.hide();var el=this.getHTMLElement();if(Element.getStyle(el,"position")!="absolute"){Element.setStyle(el,{position:'absolute'});}
el.style.display="block";this.showing=true;},showCenter:function(){this._centerPos();this.show();},hide:function(){this.showing=false;this.getHTMLElement().style.display='none';},_centerPos:function(){var el=this.getHTMLElement();var w=parseInt(el.style.width);var h=parseInt(el.style.height);var ws=Position.getViewportSize();var x=Math.round((ws.w-w)/2)+Position.docScrollLeft();var y=Math.round((ws.h-h)/2)+Position.docScrollTop();el.style.left=x+"px";el.style.top=y+"px";}};