function loading(container, offset_x, offset_y){
	try{
		if(container == null)
			container = 'body';
		if(offset_x == null)
			offset_x = 0;
		if(offset_y == null)
			offset_y = 0;
			
		$(container).prepend("<div class='loader'></div>");
		var m_left = Math.round(($(container).width() / 2)-15+offset_x);
		
		var pos = $(container).position();
		var m_top = Math.round(pos.top+offset_y);
	
		$(container+' .loader').css({
			'position' : 'fixed',
			'margin-top' : m_top+'px',
			'margin-left' : m_left+'px'
		});
		$(container+' .loader').fadeIn(100);
	}catch(err){
		
	}		
}

function stopLoading(container){
	try{
		if(container == null)
			container = 'body';
		$(container+' .loader').fadeOut(500,function(){
			$(container+' .loader').remove();
		});
	}catch(err){
		
	}
}

