//<script type="text/javascript" language="javascript"> 

   var http_request = false; 
   var theControl = '';
   var openCloseState = new Array();
   
   function makeRequest(url,control,openClose) { 
       theControl = control;
	   
	   if(!(openClose)) {openCloseState[theControl] = "closed"; }
	   
       if (window.XMLHttpRequest) { // Mozilla, Safari,... 
           http_request = new XMLHttpRequest(); 
       } else if (window.ActiveXObject) { // IE 
           http_request = new ActiveXObject("Microsoft.XMLHTTP"); 
       } 
       http_request.onreadystatechange = alertContents; 
       http_request.open('GET', url, true); 
       http_request.send(null); 

   } 

   function alertContents() {
//	alert('hello');
       if (http_request.readyState == 4) {
		    swapImage(theControl, 'hidden');
           if (http_request.status == 200) {
		       if (!(openCloseState[theControl])) {openCloseState[theControl] = "closed"; } 
		   	   if (openCloseState[theControl] == "closed") {
			   	   document.getElementById(theControl).innerHTML = http_request.responseText;
				   openCloseState[theControl] = "open";
//				   swapImage(theControl, "arrow_open.gif");
				   document.getElementById(theControl).style.border = "solid 1px";
				   
			   } else {
			       document.getElementById(theControl).innerHTML = "";
				   openCloseState[theControl] = "closed";
//				   swapImage(theControl, "arrow_close.gif");
//				   document.getElementById(theControl).style.display = "content_list";
				   document.getElementById(theControl).style.border = "solid 0px";
				   
			   }
			    
           } else { 
               alert('There was a problem with the request.'); 
           } 
       } else {
			swapImage(theControl, 'visible');
	   }
   }
   
   function swapImage(theControl, imgState) {
   		var newControl = "wait_" + theControl;
		
		//document.getElementById(newControl).style.visibility = imgState;
		document.getElementById(theControl).innerHTML = "<img src='/ssd_support/images/wait_indicator.gif' border=0>";
		return;
	}

    
   
//</script> 
