var xmlHttp

function showUser(campus_id, str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="getcourse.asp"
url=url+"?Term="+str
url=url+"&campus_id="+campus_id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

clearcourseno();
clearsection();
}

function stateChanged() 
{ 
if (xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3)
 { //Do nothing.  This fixed a bug in the statement below, presumably where a numeric was being compared to a string
 }
else if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
 } 
}

var xmlHttp1
var str1

function showUser1(campus_id, str1)
{ 
xmlHttp1=GetXmlHttpObject()
if (xmlHttp1==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="getcourseno.asp"
url=url+"?Course="+str1
url=url+"&campus_id="+campus_id
url=url+"&term="+document.register.term.value
url=url+"&sid="+Math.random()
xmlHttp1.onreadystatechange=stateChanged1 
xmlHttp1.open("GET",url,true)
xmlHttp1.send(null)

clearsection();
}

function stateChanged1() 
{ 
if (xmlHttp1.readyState==1 || xmlHttp1.readyState==2 || xmlHttp1.readyState==3)
 { //Do nothing.  This fixed a bug in the statement below, presumably where a numeric was being compared to a string
 }
else if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
 { 
 document.getElementById("txtCourse").innerHTML=xmlHttp1.responseText 
 //document.getElementById("course_txt").value=str1 
 } 
}

var xmlHttp2

function showUser2(campus_id, str, coursetxt)
{ 
xmlHttp2=GetXmlHttpObject()
if (xmlHttp2==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="getsource.asp"
url=url+"?CourseNo="+str
url=url+"&campus_id="+campus_id
url=url+"&term="+document.register.term.value
url=url+"&sid="+Math.random()
url=url+"&Course1="+coursetxt
xmlHttp2.onreadystatechange=stateChanged2 
xmlHttp2.open("GET",url,true)
xmlHttp2.send(null)
}

function stateChanged2() 
{ 
if (xmlHttp2.readyState==1 || xmlHttp2.readyState==2 || xmlHttp2.readyState==3)
 { //Do nothing.  This fixed a bug in the statement below, presumably where a numeric was being compared to a string
 }
else if (xmlHttp2.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtSection").innerHTML=xmlHttp2.responseText 
 
 } 
}

var xmlHttp33

function showUser33(campus_id)
{ 
xmlHttp33=GetXmlHttpObject()
if (xmlHttp33==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="getsemester.asp"
url=url+"?campus_id="+campus_id
url=url+"&sid="+Math.random()
xmlHttp33.onreadystatechange=stateChanged33 
xmlHttp33.open("GET",url,true)
xmlHttp33.send(null)

cleardept();
clearcourseno();
clearsection();
}

function stateChanged33() 
{ 
if (xmlHttp33.readyState==1 || xmlHttp33.readyState==2 || xmlHttp33.readyState==3)
 { //Do nothing.  This fixed a bug in the statement below, presumably where a numeric was being compared to a string
 }
else if (xmlHttp33.readyState==4 || xmlHttp33.readyState=="complete")
 { 
 document.getElementById("txtSemester").innerHTML=xmlHttp33.responseText 
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

function getCampusID()
{
	if (document.register.campus_id.length == undefined) {
		return document.register.campus_id.value;
	}
	else {
		for (var i=0; i < document.register.campus_id.length; i++)
	 	  {
	 	  if (document.register.campus_id[i].checked)
	 	     {
	 	     return document.register.campus_id[i].value;
	 	     }
	 	  }
	}
}

function clearout()
{
	clearsemester();
	cleardept();
	clearcourseno();
	clearsection();
	
	showUser33(getCampusID());
}

function clearsemester()
{
	//Remove any course options other than the first blank option
  var elSel = document.getElementById('term');
  var i;
  for (i = elSel.length - 1; i>=1; i--) {
  	elSel.remove(i);
  }
}

function cleardept()
{
	//Remove any course options other than the first blank option
  var elSel = document.getElementById('Course');
  var i;
  for (i = elSel.length - 1; i>=1; i--) {
  	elSel.remove(i);
  }
}

function clearcourseno()
{
	//Remove any courseno options other than the first blank option
  var elSel = document.getElementById('CourseNo');
  var i;
  for (i = elSel.length - 1; i>=1; i--) {
  	elSel.remove(i);
  }
}

function clearsection()
{
	//Remove any section options other than the first blank option
  var elSel = document.getElementById('Section');
  var i;
  for (i = elSel.length - 1; i>=1; i--) {
  	elSel.remove(i);
  }
}