// JavaScript Document

function getXMLHTTPRequest()	/*build a xml http request object */
	{
	try{
			req = new XMLHttpRequest();
		}
	catch(err1){
				try{
						req = new ActiveXObject("Msxml2.XMLHTTP");
					}
				catch(err2){
							try{
									req = new ActiveXObject("Microsoft.XMLHTTP");
								}
							catch(err3){
											req = false;
										}
							}
				}
				return req;
	}
					
	var http = getXMLHTTPRequest();	/* instantiate an xml http request object */
	
function getInfo(typeOfFile,fileToReturn)		/* prepare the variables to be passed */
/* two variables are passed, the first is the type of file and corresponds to the folder in which the returned file is kept, ie projects or faq */
/* the second variable is the name of the file being retrieved, without the .php extension */
	{
		var myurl = typeOfFile+"/"+fileToReturn+'.php';
		myRand = parseInt(Math.random()*999999999999999);
		var modurl = myurl+"?rand="+myRand;
		http.open("GET", modurl, true);
		http.onreadystatechange = useHttpResponse;
		http.send(null);
	}
	
function useHttpResponse()	/* check for a response */
	{
		if(http.readyState == 4)
			{
				if(http.status == 200)
					{
						var returnedInfo = http.responseText;
						document.getElementById('rightColContent').innerHTML = returnedInfo;
					}
			}
		else
			{
				document.getElementById('rightColContent').innerHTML = '<img src="layoutImages/ajaxLoader.jpg" width="200px" height="150px" id="ajaxLoader"/>';
			}
	}