
var	YzAshman=function(attachWindow)
{
	this.items=[];

	attachWindow.ashman=this;
	
	if(attachWindow.__isDialog)
		attachWindow.attachEvent('onbeforeunload',YzAshmanWorkFunction ) ;	
	else
		attachWindow.attachEvent('onunload',YzAshmanWorkFunction ) ;		
}
	
YzAshman.prototype.addItem = function(dirtyItem,workFunction)
{
	this.items.push([dirtyItem,workFunction]) ;
}
	
function YzAshmanWorkFunction()
{
	try
	{
		var aItems = this.ashman.items;
		var iLenght = aItems.length ;
	
		for(var i=0; i<iLenght;i++)
		{
			var oItem = aItems[i];
			oItem[1].call(oItem[0]);
			aItems[i]=null;
		}
		this.ashman=null;
		
		
	}
	catch(e){}
}

