function Popup(n){this.drawed=false;this.visible=false;this.configured=false;this.n=n;this.configure=function(options){if(typeof options=="undefined"){var opt={};} else{opt=options;} if(typeof opt.type=="undefined"){return false;} if(typeof opt.modal=="undefined"){opt.modal=false;} if(typeof opt.bg=="undefined"){opt.bg='light';} if(typeof opt.width=="undefined"){opt.width='100px';} if(typeof opt.height=="undefined"){opt.height='100px';} if(typeof opt.top=="undefined"){opt.top="centered";} if(typeof opt.left=="undefined"){opt.left="centered";} this.type=opt.type.toLowerCase();this.modal=opt.modal;this.bg=opt.bg.toLowerCase();this.imp=PopupFactory.get(this.type);this.imp.configure(options);this.imp.n=this.n;this.width=opt.width;this.height=opt.height;this.left=opt.left;this.top=opt.top;this.configured=true;} this.draw=function(){if($('.popup-container').size()==0){$('body').append('
');} if(this.drawed==false){str='