function Loading(div,carga){

if(carga == 1)
{
new Insertion.Top(div, 'Cargando...')
}
else if(carga == 2)
{
obj = document.createElement('div');
obj.innerHTML = 'Cargando...';
obj.id = 'cargando';
/*
obj.style.color = '#FFFFFF';
obj.style.background = '#FF0000';
obj.style.top = '0px';
obj.style.right = '3px';
obj.style.position = 'absolute';
obj.style.width = '100px';
obj.style.heigth = '200px';
obj.style.border = '1px solid #000000';
*/
document.body.appendChild(obj);
}
}
function Complete()
{
var doc = document.getElementById('cargando');
document.body.removeChild(doc);
}
function phpajax(id,url,prm,carga)
{
new Ajax.Updater(id, url,
{
encode: 'UTF-8',
evalScripts: true,
postBody: prm,
onLoading: Loading(id,carga),
onComplete: Complete
}
);
}