function lf(img){
	var h = $('pHolder');
	var pc = h.getCoordinates();
	h.setHTML('');
	var holder = new Element('div',{'id':'holder'}).setStyles({'height':pc.height+'px','width':pc.width+'px'}).injectInside(h);
	img = '/thumb'+img + '&width='+pc.width;
	var i = new Asset.image(img, {id: 'photo'});
	var loadingIcon = ajaxLoading(holder);
	i.addEvent('load',function() {
		this.setStyles('position:absolute;top:-500px;left:0px;').injectInside(holder);
		loadingIcon.remove();
		imageStats = this.getCoordinates();
		this.getParent().setStyles('position:relative;overflow:hidden;height:'+imageStats.height+'px;width:'+imageStats.width+'px;');

		var fx = new Fx.Styles(this, {duration:800, wait:false});
		fx.start({'top':0});
	});
};
window.addEvent('domready',function(){
	$$('.addImages').each(function(item,k){
		item.setProperty('id','addImage'+k);
		item.addEvent('click',upImage);
	})
});
function getRow(ele) {
	var par = $(ele).getParent();
	var t   = par.getTag();
	if(t!='tr') return getRow(par);
	return par;
}
var upImage = function(eve) {
	var e   = new Event(eve).stop();
	var tr  = getRow(e.target.getProperty('id'));
	var np  = e.target.getProperty('rel');
	var ip 	= tr.getElement('.pHolder');
	var pc 	= ip.getCoordinates();
	var img = ip.getFirst();
	if(img.getStyle('bottom') != '0px') return;
	ip.setStyles({'height':pc.height,'width':pc.width});
	var fo = new Fx.Styles(img, {
		duration:800,
		onComplete:function(){
			var ni = new Asset.image('/thumb'+np+'&width='+(imgData.width - 10)+'&height='+(imgData.height-10), {'class':'pImage',
			onload: function(){
				ip.getElement('img').replaceWith(ni);
				var fx = new Fx.Styles(img, {duration:800}).start({'opacity':1});
			}
			});
		}
	}).start({'opacity':0});
}