function getTop(obj){
    var curtop = 0;
    if (obj.offsetParent) {
        do {
            curtop += obj.offsetTop;
        } while (obj = obj.offsetParent);
    }
    return curtop;
    }
function getLeft(obj){
    var curleft = 0;
    if (obj.offsetParent) {
        do {
            curleft += obj.offsetLeft;
        } while (obj = obj.offsetParent);
    }
    return curleft;
    }
    function getFilename(str){
        var result = "";
        var st = str.lastIndexOf("\\");
        if(st!=-1){
            result = str.substring(st+1);
        }else{
        result=str;
    }
    return result;
}

function getComboboxValue(id){
    var dropdownIndex = document.getElementById(id).selectedIndex;
    return document.getElementById(id)[dropdownIndex].text;
}
function count(txt,lbl,max){
    var len = max-document.getElementById(txt).value.length;
    if(len>=0){
        document.getElementById(lbl).innerHTML=""+len;
        document.getElementById(lbl).style.color="green";
    }else{
    var str = document.getElementById(txt).value.substring(0,max);
    document.getElementById(txt).value=str;
    document.getElementById(lbl).innerHTML="0";
    document.getElementById(lbl).style.color="red";
}
}
var t = null;
function showFragment(paneContents,target){
    t=target;
    AjaxRequest("GET",paneContents+"&ssq="+Math.random(),showFragmentResult,null);
}
function showFragmentResult() 
{ 
    if (xmlHttp.readyState==4)
        { 
            if(t!=null){
                document.getElementById(t).innerHTML= xmlHttp.responseText;
                t=null;
            }
        }
    }
    var nextUrl;
    function successive(url1,url2){
        nextUrl = url2;
        AjaxRequest("GET",url1+"&ssq="+Math.random(),successiveResult,null);
    }
    
    function successiveResult() 
    { 
        if (xmlHttp.readyState==4)
            { 
                document.getElementById("gpPane").innerHTML= xmlHttp.responseText;
                if(nextUrl!=null){
                    showPane("GET",nextUrl,null);
                    nextUrl=null;
                }
            }
        }
        
