﻿function showwaiting(id)
{
    var height = $("#"+id).height();
    var width = $("#"+id).width();
    e = document.getElementById(id);
    var divtop = parseInt((parseInt(height)-15)/2)+parseInt(getTop(e))+3;
    var divleft = parseInt(getLeft(e)) + parseInt(width)-15;
    $("#loading").css({"top":divtop+"px","left":divleft+"px"});
    $("#loading").show();
}

function removewaiting()
{
    $("#loading").fadeOut(1000);
}

document.write("<div style=\"height:15px; width:15px; position:absolute; display:none;z-index:10000\" id=\"loading\"><img src=\"" + imageUrl + "\" height=15 width=15 /></div>");

function getTop(e){
    var offset=e.offsetTop;
    if(e.offsetParent!=null) offset+=getTop(e.offsetParent);
    return offset;
}

function getLeft(e){
    var offset=e.offsetLeft;
    if(e.offsetParent!=null) offset+=getLeft(e.offsetParent);
    return offset;
}
