function createRequestObject(){
   var req;
   if(window.XMLHttpRequest){
      //Firefox, Safari, Opera...
      req = new XMLHttpRequest();
   }else if(window.ActiveXObject){
      //Internet Explorer 5+ - ja Not a Bug - just sucks.
      req = new ActiveXObject("Microsoft.XMLHTTP");
   }else{
      //There is an error creating the object, just as an old browser is being used.
      alert('This feature will not work with your browser.');
   }
   return req;
}

//ja - IE bugfix
function handleDivTag(divtag){
   var divtag;
   return divtag;
}

function sendRequest(act,divtag) {
   http.open('get', act);
   http.onreadystatechange = handleResponse;
   divhandler.divtag = divtag;
   http.send(null);
}

function handleResponse() {
	if(http.readyState == 4 && http.status == 200){
		var response = http.responseText;
		if(response){
			// UPDATE the content
			document.getElementById(divhandler.divtag).innerHTML = response;
		}
	}
} 
function divHiddenOnOff(div){
	if (document.getElementById(div).style.visibility == 'hidden'){
		document.getElementById(div).style.visibility = 'visible';
	}else{
		document.getElementById(div).style.visibility = 'hidden';
	}
}

//*************************************************

// Make the XMLHttpRequest object
var http = createRequestObject();
// Create the Divtag Handler -- Mainly an IE 6 Fix
var divhandler = new handleDivTag(null);
