Ext.onReady(function(){
							
		new Ext.Window({ id:'picbox', modal:true, closeAction:'hide', width:1, height:1, //autoWidth:true, autoHeight:true, 
			frame:false, closable:false, plain: true, resizable:false, 
			html:'<img src="" alt="Photo" onclick="Ext.getCmp(\'picbox\').hide()" style="cursor:pointer" />',
			listeners:{ 
				show: function(win){ win.center(); }, 
				beforeshow: function(win){ win.setSize(300,300); win.center(); },
				render: function(){ Ext.get('picbox').dom.title='Click to close'; }
			}
		});
		
		
});



function showPicture(pic,target){
	var win=Ext.getCmp('picbox');
	win.show(target);
	
	var img=new Image();
	img.src=pic;
	img.onload=function(){
		win.setWidth(img.width);
		win.setHeight(img.height);
		win.getEl().child('img').dom.src=img.src;
		win.center();
		Ext.getBody().child('.ext-el-mask').on('click',function(){ Ext.getCmp('picbox').hide() });
	}

}

