

function AJAX_RESPONSE(htmltarget, response ){
	// display the div at the proper position 
	htmltarget.innerHTML = response;
}

function AJAX_WD(URLIN) { 

	// pass the query the user has typed. 
	// Also, pass the id for a div to update, and the function to call to update this div. 
	var myurl = URLIN
	//  
	htmltarget = document.getElementById("tabcontents"); 
	// Clear prior HTML prevent blink
	htmltarget.innerHTML = "<img src='/images07/transparent.gif' height='300px'";

	// Issue URL request and load response into target HTML : 
	AJAX_Update(myurl, htmltarget, AJAX_RESPONSE); 
	
} 
function AJAX_WD_TGT(URLIN,HTMLDIV) { 

	// pass the query the user has typed. 
	// Also, pass the id for a div to update, and the function to call to update this div. 
	var myurl = URLIN
	//  
	htmltarget = document.getElementById(HTMLDIV); 
	// Clear prior HTML prevent blink
	htmltarget.innerHTML = "";

	// Issue URL request and load response into target HTML : 
	AJAX_Update(myurl, htmltarget, AJAX_RESPONSE); 
	
} 


var _ms_AJAX_Request_ActiveX = ""; // Holds type of ActiveX to instantiate

function AJAX_Update(url, obj, func)
{
  if (!url) return false;  // Don't run if missing the url parm. 
 
  // code for Mozilla, etc.
	if (window.XMLHttpRequest)
  {
  	var xmlhttp=new XMLHttpRequest();
  }
	
	// code for IE
	else if (window.ActiveXObject)
   {
      // Instantiate the latest MS ActiveX Objects
      if (_ms_AJAX_Request_ActiveX) 
	  {
         xmlhttp = new ActiveXObject(_ms_AJAX_Request_ActiveX);
      } 
	  else 
			{
				// loops through the various versions of XMLHTTP to ensure we're using the latest
	    	var versions = ["Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP",
                       "Microsoft.XMLHTTP"];
         	for (var i = 0; i < versions.length ; i++)
			{
         	 try 
			 {
		   	      // try to create the object
		   	      // if it doesn't work, we'll try again
		   	     // if it does work, we'll save a reference to the proper one to speed up future instantiations
               xmlhttp  = new ActiveXObject(versions[i]);
               if (xmlhttp) 
			   {
                 _ms_AJAX_Request_ActiveX = versions[i];
                 break;
               }
             }
             catch (objException) 
 			 {
                  // trap -  try next one
             } 
           }
        }
	}
    if (!xmlhttp) return false;
   if (func) 
    xmlhttp.onreadystatechange = function(){
      if (xmlhttp.readyState != 4) return;
      if (xmlhttp.status == 200)
        func(obj, xmlhttp.responseText);
      else 
        alert("An error occurred" + http.status);
  };
    else
      xmlhttp.onreadystatechange = function() { return; }
  // Do the actual request:   
		 xmlhttp.open('GET', url, true);
     xmlhttp.send(null);
	  
  
		return false;
}

