function popup(
	element,
	start_left,start_top,
	start_width,start_height,
	end_left,end_top,
	end_width,end_height
){
	this.onBeforeClose = null;
	this.onAfterClose = null;
	this.onClose = null;
	
	this.onBeforeOpen = null;
	this.onAfterOpen = null;
	this.onOpen = null;
	
	this.onBeforeHide = null;
	this.onAfterHide = null;
	this.onHide = null;
	
	this.onBeforeShow = null;
	this.onAfterShow = null;
	this.onShow = null;
	
	
	this.element = element;
	this.backgroundImage = this.element.down('.background').src;
	this.start_left = start_left;
	this.start_top = start_top;
	this.start_width = start_width;
	this.start_height = start_height;
	
	this.end_left = end_left;
	this.end_top = end_top;
	this.end_width = end_width;
	this.end_height = end_height;
	
	this.progress = 0;
	
	if (ie6){
		this.element.down('.background').src = './images/blank.gif'; 
		this.element.down('.background').runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.backgroundImage+"',sizingMethod='scale');";
	}
	
	this.open = function(){
		if (Math.round(this.progress*100)/100 <=0){
			this._onBeforeOpen();
			this.doOpen();
		}
	}
	
	this.doOpen = function(){
		this.progress +=  1 / steps;
		this._draw();
		if (Math.round(this.progress*100)/100 < 1){
			window.setTimeout(this.doOpen.bind(this),delay);
		}else{
			this._onAfterOpen();
		}
	}
	
	this._onBeforeOpen = function(){
		if (this.onBeforeOpen != null) this.onBeforeOpen;		
		this.progress = 0;
		// inhaltsbereich ausblenden da es sich nicht zoomen läßt
		this.element.down('.content').style.display = 'none';
		// hintergrund auf Image bringen damit der zoom funktioniert
		if (ie6){
			this.element.down('.background').src = './images/blank.gif'; 
			this.element.down('.background').runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.backgroundImage+"',sizingMethod='scale');";
		}else{
			this.element.down('.background').src = this.backgroundImage;
		}
		// an richtige position bringen
		this._draw();
		this.element.style.display = 'block';
	}
	
	this._onAfterOpen = function(){
		this.element.down('.content').style.display = 'block';
		if (this.onAfterOpen != null)this.onAfterOpen();
	}
	//----------------------------------------------------------
	this.close = function(){
		if (Math.round(this.progress*100)/100 >=1){
			this._onBeforeClose();
			this.doClose();
		}	
	}
	
	this.doClose = function(){
		this.progress -=  1 / steps;
		this._draw(this.element);
		if (Math.round(this.progress*100)/100 > 0){
			window.setTimeout(this.doClose.bind(this),delay);
		}else{
			this._onAfterClose();
		}
	}
	
	this._onBeforeClose = function(){
		if (this.onBeforeClose != null) this.onBeforeClose;	
		this.progress = 1;
		this.element.down('.content').style.display = 'none';
		this._draw();
	}
	
	this._onAfterClose = function(){
		this.element.style.display = 'none';
		if (this.do_after_close != null){
			this.do_after_close();
		}
		if (this.onAfterClose != null)this.onAfterClose();
	}

	this._draw = function(){
		this.element.style.left		= calc(this.start_left,		this.end_left	,this.progress)+'px';
		this.element.style.top		= calc(this.start_top,		this.end_top	,this.progress)+'px';
		this.element.style.width	= calc(this.start_width,	this.end_width	,this.progress)+'px';
		this.element.style.height	= calc(this.start_height,	this.end_height	,this.progress)+'px';
	}
}





