Ext.onReady(function(){
	try{
		var func=Ext.getBody().query('.thumbs li a')[0].onclick.toString();
		var thumbImg=func.substring(func.indexOf("thumb(")+7,func.lastIndexOf(",")-1);
		thumb(thumbImg);
	}catch(e){}
});



function thumb(imgSrc,a){
	var scr=Ext.get('screenImg');
	if (a && !Ext.isIE){
		var an=Ext.get(a).child('img');
		var ghost=Ext.get(a).createChild({ tag:'img', src:an.dom.src, width:an.getWidth(), height:an.getHeight() });
		ghost.shift({ x:scr.getX(), y:scr.getY(), width:scr.getWidth(), height:scr.getHeight(), opacity: 0, duration: 0.4, remove: true });
	}
	scr.child('img').fadeOut({ easing: 'easeOut', duration: 0.2,	callback: function(){
			var image = new Image(), newImg=Ext.get('screenImg').child('img');
			image.src = imgSrc;	newImg.dom.src=image.src;
			if (image.complete) newImg.fadeIn({ easing: 'easeIn', duration: 0.2 }); 
			else { // image not yet cached
				Ext.get('screenImg').mask('Loading...', 'image-loading-mask');
				image.onload = function(){ newImg.fadeIn({ easing: 'easeIn', duration: 0.2, callback: function(){Ext.get('screenImg').unmask()} }) }
				image.onerror = function(){ Ext.get('screenImg').unmask() }
			}
	} });
}
