
    
function ajaxRequest(url,reportDiv) {
    var oDiv = document.getElementById(reportDiv);
    oDiv.innerHTML = "<div align='center'><img src='images/aniglobe.gif' alt='Loading' title='Loading'></div>";
    if (window.XMLHttpRequest) {
	    xhr = new XMLHttpRequest();
    } 
    else if (window.ActiveXObject) {
	try {
	        xhr = new ActiveXObject("Microsoft.XMLHTTP");
        } catch(e) {
	        xhr = false;
        }
    }
    	
    if (!xhr) {
        alert('Cannot create XMLHTTP instance');
        return false;
    }
    // define customized function updatePage within application
xhr.onreadystatechange = function() { updateSearchWindow(reportDiv); };

    xhr.open('GET', url, true);
    xhr.send(null);

}

function updateSearchWindow(reportDiv) {
    if (xhr.readyState==4 || xhr.readyState=="complete") { 
        var reportDiv = document.getElementById(reportDiv);
        if (reportDiv) {
	reportDiv.style.display="inline";        
            reportDiv.innerHTML=xhr.responseText;
        }
    }         
}
    
  
function hidediv(pass) {
    var divs = document.getElementsByTagName('div');
    for(i=0;i<divs.length;i++){
        if(divs[i].id.match(pass)){//if they are 'see' divs
            if (document.getElementById) // DOM3 = IE5, NS6
                divs[i].style.display="none";// show/hide
            else
                if (document.layers) // Netscape 4
                    document.layers[divs[i]].display = 'none';
                else // IE 4
                    document.all.hideshow.divs[i].visibility = 'none';
            }
    }
}

function showdiv(pass) {
    var divs = document.getElementsByTagName('div');
    for(i=0;i<divs.length;i++){
        if(divs[i].id.match(pass)){
            if (document.getElementById)
                divs[i].style.display="block";
            else
                if (document.layers) // Netscape 4
                    document.layers[divs[i]].display = 'block';
                else // IE 4
                    document.all.hideshow.divs[i].display = 'display';
        }
    }
}
    
function toggleLayer(whichLayer) {
    var elem, vis;
    if(document.getElementById) // this is the way the standards work
        elem = document.getElementById(whichLayer);
    else if(document.all) // this is the way old msie versions work
        elem = document.all[whichLayer];
    else if(document.layers) // this is the way nn4 works
        elem = document.layers[whichLayer];
    vis = elem.style;
    // if the style.display value is blank we try to figure it out here
    if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
        vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
    vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

