function show_processando(mensagem, tempo_para_sumir)
{
    fecha_modal_processando();
    if (mensagem == null)
       mensagem = 'Processando..';

    jQuery('body').append('<div style="background:#fffade; border: 2px #FF9 solid; color:#666; font-family:\'Trebuchet MS\', Arial, Helvetica, sans-serif; font-size:12px; height: 40px; width:180px;" id="processando-modal"><span style="left: 10px;position:absolute;  top:13px;">'+mensagem+'</span></div>');
    jQuery('#processando-modal').dialog({
                height: 90,
                width: 290,
                modal: true,
                resizable: false,
                draggable: false,
                closeOnEscape: true,
                title: mensagem

                });
     var var_dialog = jQuery("#processando-modal").prev();
     jQuery(var_dialog).css('display','none');
     if(tempo_para_sumir != null)
     {
         setTimeout(fecha_modal_processando,tempo_para_sumir*1000);
     }
     else
         setTimeout(fecha_modal_processando,10000);
}
function fecha_modal_processando()
{
    if(jQuery('#processando-modal').dialog != undefined)
        jQuery('#processando-modal').dialog("destroy");
    jQuery('#processando-modal').remove();
}
function show_erro_processando(mensagem)
{
    if (mensagem == null)
       mensagem = 'Houve um erro de conexão';
    jQuery('#processando-modal').html('<div style= style="background:#f25151; border: 2px #F30 solid; color:#fff; font-family:\'Trebuchet MS\', Arial, Helvetica, sans-serif; font-size:12px; height: 40px; width:180px;" id="processando-modal"><span style="left: 10px;position:absolute;  top:13px;">'+mensagem+'</span></div>');
    setTimeout(fecha_modal_processando,2000);
}


// recebe como parametro [referencia do objeto que foi clicado]
function show_processando_pequeno(obj)
{
	var imgDir = link_loja_virtual+'img/ljvt/processando/processando_pequeno.gif';
	if(!(jQuery("#load_gif").length > 0))
	{
		jQuery('body').append('<div id="load_gif"></div>');
		jQuery('#load_gif').css('display','none');
		jQuery('#load_gif').append('<img src="'+ imgDir +'" />');
	}
	var position = jQuery(obj).offset();
	var posLeft = position.left;
	var posTop = position.top + 8;
	posLeft += jQuery(obj).width() + 15;
	jQuery("#load_gif").css({'position' : 'absolute', 'left' : posLeft, 'top' : posTop , 'z-index' : '2000', display:'' });
}

// remove o gif se ele existir
function finaliza_processando_pequeno()
{
	if((jQuery("#load_gif").length > 0))
		jQuery("#load_gif").remove();
}

/*
// exemplo de chamada
jQuery("a").click(function()
{
	var obj = $(this);
	loadGif(obj);
	return false;
});
*/
