//	Majors Datamart Ajax Scripts

//	createXMLHttpRequest Script	

var xmlHttp;
var searchType = "";
var req;

function createXMLHttpRequest(){
	req = false;
    // branch for native XMLHttpRequest object
    if(window.XMLHttpRequest) {
    	try {
			xmlHttp = new XMLHttpRequest();
        } catch(e) {
			xmlHttp = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		xmlHttp = false;
        	}
		}
    }
}
function startProc(){
	if(xmlHttp.readyState != 4){	
		document.getElementById('proc').style.display = 'inline';
	}
}

function stopProc(){
	document.getElementById('proc').style.display = 'none';
}

function displaySubj(){ 
	startProc();
	if(xmlHttp.readyState == 4){
		stopProc();
		if(xmlHttp.status==200){	
			eval("document.getElementById('subj').innerHTML = xmlHttp.responseText");
		}
	}
}

function getSubj(dex,term){		//	used to display the layer with the correct form elements.

	
	createXMLHttpRequest();	
	
	xmlHttp.onreadystatechange = displaySubj;

	xmlHttp.open("GET", "getSubj.php?subjDex="+dex+"&term="+term, true);
	
	xmlHttp.send(null);
}

