function makeObject(){
var x; 
var browser = navigator.appName; 
if(browser == "Microsoft Internet Explorer"){
x = new ActiveXObject("Microsoft.XMLHTTP");
}else{
x = new XMLHttpRequest();
}
return x;
}

//Now let's get on to the next part.

var lyr = '';
var txt = '';

var request = makeObject();

//The javascript variable request now holds our request object.
//Without this, there's no need to continue reading because it won't work ;)

//Below you will find a snippet of code. I will explain it piece by piece later on.

function info1(tlyr,ttxt){
//request.open('get', 'test.php?id=' + document.form_select.select_select.selectedIndex);
//	alert('fino1');

//alert('info:'+tlyr+' : '+ttxt);
lyr = tlyr;
txt = ttxt + '&RANDOM=' + (Math.random() * Date.parse(new Date()));  // added to force ie to fetch live page instead of cache

//alert('info(lyr: '+lyr+' txt: '+txt+')');
	var scrollerlen = document.getElementById('alumRegList').innerHTML.length;
//alert('scrollerlen: ' + scrollerlen);
if (scrollerlen < 500000) {
	request = makeObject();
	
	request.open('get', 'http://nursingdev.med.yale.edu/Alum/Reunion/2007/getRegList.php5');// + document.form_select.select_select.selectedIndex');
	request.onreadystatechange = parseInfo; 
	
	request.send('');

	}	
}


/* request.open('get', 'test.php?id=4');  */
/* //+ document.form_select.select_select.selectedIndex); */
/*  */
/* //The function open() is used to open a connection. */
/* //Parameters are 'method' and 'url'. For this tutorial we use GET. */
/* //We send it to 'test.php?id=' and add the index from our SELECT form field. */
/*  */
/* request.onreadystatechange = parseInfo; */
/* //alert(request.responseText); */
/* //This tells the script to call parseInfo() when the ready state is changed. */
/*  */
/* request.send(''); */




//This sends whatever we need to send. Unless you're using POST as method, the parameter is to remain empty.

function parseInfo(){

//	alert('parse(lyr: '+lyr+' txt: '+txt+')');
	if(request.readyState == 1){
		document.getElementById(lyr).innerHTML = '<img src="/resources/graphics-misc/ajax-loader.gif" border=0>';
	}
	if(request.readyState == 4){ 
		//alert('here and now');
		var answer = request.responseText;
		var pretext = '';

		if (answer.length < 30) { 
			answer = "";//'<p class=intl_p><a onClick="info1("alumRegList",1);" href="javascript:void(0);" >Click here if content fails to load<\/a><\/p>';
			
			} else {
			//answer = '<h3 class="titleBanner">Grey Matters - Reflections from the Dean</h3>'.answer;
			pretext = '<h3 class="titleBanner">Join those who have already registered. <a href="https://intranet.nursing.yale.edu/Alum/reunion_2007.aspx">Register today</a>.</h3>';
		
		
		document.getElementById(lyr).innerHTML = pretext + answer;
		document.getElementById(lyr).style.visibility = "visible";
		}

	}
}


//This piece of code is initiated when the data is sent from the function info1().
//It checks for status; 1 means loading, 2 means loaded and 4 means finished.
//While it's loading, we add the text 'loading...' to our div with the id 'my_div'.
//After it's done loading, we get the response from the server.

/* if(request.readyState == 1){ */
/* 	document.getElementById('scroller').innerHTML = 'Loading...'; */
/* } */
/*  */
/* //While we are still waiting for a response, we replace whatever's in the div # 'my_div' with */
/* //the text 'Loading...'. */
/*  */
/* if(request.readyState == 4){  */
/* 	var answer = request.responseText; */
/* 	document.getElementById('scroller').innerHTML = answer; */
/* } */
/*  */



