function makeRequest(url,duv,parameters) {
	var httpRequest;

	if (window.XMLHttpRequest) { // Mozilla, Safari, ...
		httpRequest = new XMLHttpRequest();
		if (httpRequest.overrideMimeType) {
			httpRequest.overrideMimeType('text/xml');
			// See note below about this line
		}
	} 
	else if (window.ActiveXObject) { // IE
		try {
			httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e) {
					   try {
							httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
						   } 
						 catch (e) {}
					  }
								   }

	if (!httpRequest) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	// set type accordingly to anticipated content type
    //http_request.overrideMimeType('text/xml');
    //httpRequest.overrideMimeType('text/html');	
	httpRequest.onreadystatechange = function() { alertContents(httpRequest,duv); };
	httpRequest.open('GET', url + parameters, true);
	httpRequest.send(null);

}

function alertContents(httpRequest,duv) {
	if (httpRequest.readyState == 1) {
		document.getElementById(duv).style.backgroundColor='#ffdfe4';
		document.getElementById(duv).style.border='1px solid #de8686';
		document.getElementById(duv).innerHTML="<img src='images/loading.gif'> Loading Request";
	}
	if (httpRequest.readyState == 4) {
		if (httpRequest.status == 200) {
			document.getElementById(duv).style.backgroundColor='#e2ffde';
			document.getElementById(duv).style.border='1px solid #92df88';
			document.getElementById(duv).innerHTML=httpRequest.responseText;
			
			
		} else {
			alert('There was a problem with the request.');
		}
	}

}

 function get(obj,file,duv) {
      var getstr = "?";
      for (i=0; i<obj.childNodes.length; i++) {
         if (obj.childNodes[i].tagName == "INPUT") {
            if (obj.childNodes[i].type == "text") {
               getstr += obj.childNodes[i].name + "=" + escape(encodeURI(obj.childNodes[i].value)) + "&";
            }
            if (obj.childNodes[i].type == "hidden") {
               getstr += obj.childNodes[i].name + "=" + escape(encodeURI(obj.childNodes[i].value)) + "&";
            }
			if (obj.childNodes[i].type == "checkbox") {
               if (obj.childNodes[i].checked) {
                  getstr += obj.childNodes[i].name + "=" + escape(encodeURI(obj.childNodes[i].value)) + "&";
               } else {
                  getstr += obj.childNodes[i].name + "=&";
               }
            }
            if (obj.childNodes[i].type == "radio") {
               if (obj.childNodes[i].checked) {
                  getstr += obj.childNodes[i].name + "=" + escape(encodeURI(obj.childNodes[i].value)) + "&";
               }
            }
         }   
         if (obj.childNodes[i].tagName == "SELECT") {
            var sel = obj.childNodes[i];
            getstr += sel.name + "=" + escape(encodeURI(sel.options[sel.selectedIndex].value)) + "&";
         }
         if (obj.childNodes[i].tagName == "TEXTAREA") {
            getstr += obj.childNodes[i].name + "=" + escape(encodeURI(obj.childNodes[i].value)) + "&";
         }
         
      }
      makeRequest(file,duv,getstr);
   }
