function ajax(url,param,titulo,tamanho,toggle,tipo) //usa jquery
{
    if(!tipo) tipo = "POST"
     $.ajax({
       type: tipo,
       url: url,
       data: param,
       success: function(html){
         $("#pg_tit").html(titulo);
         $("#in_page").html(html);
         if(tamanho) $("#page_over").css('width',tamanho);
         if(!toggle) $("#page_over").toggle();
       }
     });

}

function ajaxDireto(url,param,retorno,tipo) //usa jquery
{
    //$("#"+retorno).html('Aguarde carregando...');
    
    if(!tipo) tipo = "POST"
     $.ajax({
       type: tipo,
       url: url,
       data: param,
       success: function(html){
         $("#"+retorno).html(html);
       }
     });

}

function sendPost(form,prefixo,url,param,retorno)
{
    forme = eval("document."+form);
    var reto;
    for(x = 0; x < forme.elements.length; x++)
    {
        if(forme.elements[x].name.search(prefixo) != '-1')
        {
            if(forme.elements[x].type == 'radio' && forme.elements[x].checked)
                reto += '&'+forme.elements[x].name.replace(prefixo,'')+"="+forme.elements[x].value;
            else if(forme.elements[x].type != 'radio' && forme.elements[x].type != 'checkbox')
                reto += '&'+forme.elements[x].name.replace(prefixo,'')+"="+forme.elements[x].value;
        }
    }
    reto = reto.replace('undefined','');
    //$('#'+retorno).html(reto);
    ajaxDireto(url,param+reto,retorno);
}

