//Set image loader
$(document).ready(function(){
	var dummy=document.createElement("DIV");

	$(dummy).load("/oxo_loading.gif",function(){
		$(".load").each(function(){
			var oldImg=$(this);
			var src=$(this).attr("src");
			var pos=$(this).position();
			var height=$(this).attr("height");
			var width=$(this).attr("width");
	
			var div=document.createElement("DIV");
							
			$(div).css({
			
				"position":"absolute",
				"top":pos.top+'px',
				"left":pos.left+'px',
				"height":height+'px',
				"width":width+'px',
				"background-position":"center center",
				"background-repeat":"no-repeat",
				"background-image":"url('/oxo_loading.gif')",
				"z-index":"100000"
			
			});
			
			$("body").append($(div));
			
			//$(div).html(pos.top+"|"+pos.left);
			var dummy2=document.createElement("DIV");
			$(dummy2).load(src,function(){
				$(div).fadeOut();
				$(div).remove();
				$(oldImg).css({
				
					'visibility':"visible"
				
				});
				$(dummy2).remove();
			});
		});
		$(dummy).remove();
	});
	
});