function submitWithProgress(frm)
{
    startLoading();
    document.forms[frm].submit();
}

function redirectWithProgress(url)
{
    startLoading();
    document.location.href=url;
}

function startLoading()
{
    var el=document.getElementById('progress');

    var winWidth=630,winHeight=460;
    var divWidth=0,divHeight=0;
    var winl=0,wint=0;

    if(parseInt(navigator.appVersion)>3)
    {
        divHeight=el.offsetHeight;
        divWidth=el.offsetWidth;

        if(navigator.appName=='Netscape')
        {
            winWidth=window.innerWidth;
            winHeight=window.innerHeight;
        }
        else if(navigator.appName.indexOf('Microsoft')!=-1)
        {
            winWidth=document.body.offsetWidth;
            winHeight=document.body.offsetHeight;
        }
    }

    winl = (winWidth-divWidth)/2;
    wint = (winHeight-divHeight)/2;

    if (winl<0) winl=0;
    if (wint<0) wint=0;

    el.style.visibility='visible';
    el.style.left = parseInt(winl) + 'px';
    el.style.top  = parseInt(wint) + 'px';

}