function clearForm(){
	document.article_search.journal_title.value = '';
	document.article_search.article_title.value = '';
	document.article_search.author.value = '';
	document.article_search.year.value = '';
	document.article_search.volume.value = '';
	document.article_search.issue.value = '';
	document.article_search.spage.value = '';
}

function validate(){
	if (document.article_search.journal_title.value.length < 1){
		alert("You must enter a journal title.");
		return false;
	}
	if (document.article_search.article_title.value.length < 1){
		alert("You must enter an article title.");
		return false;
	}
	if (document.article_search.author.value.length < 1){
		alert("You must enter an author's last name.");
		return false;
	}
	if (document.article_search.year.value.length < 1){
		alert("You must enter a year.");
		return false;
	}
	if (document.article_search.volume.value.length < 1){
		alert("You must enter a volume.");
		return false;
	}
	if (document.article_search.spage.value.length < 1){
		alert("You must enter a start page.");
		return false;
	}

}

function windowOpen(url,width,height) {
 	myWindow = window.open("","windowRef","width=" + width + ",height=" + height+",location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
    	myWindow.location.href = url;
   	if (!myWindow.opener) myWindow.opener = self;
}

<!--PULL DOWN MENU WHERE YOU CAN OPEN SPECIFIED PAGES IN NEW WINDOW-->

function openWindow(url){
	popupWin = window.open(url, "targetWin", "menubar,toolbar,scrollbars,width=640,height=480");
}

function formHandler(){
	var URL = document.form.site.options[document.form.site.selectedIndex].value;
	var i = URL.indexOf("newwin:");
	if (i==0) {
		URL = URL.substring(7,URL.length);
		openWindow(URL);
	}else {
   		window.location.href = URL;
 	}
}

function formHandler2(){
	var URL = document.form1.site.options[document.form1.site.selectedIndex].value;
	var i = URL.indexOf("newwin:");
	if (i==0) {
		URL = URL.substring(7,URL.length);
		openWindow(URL);
	}else {
		window.location.href = URL;
	}
}

function moveToTop(){
	window.scrollTo(0,0);
}

var xmlHttp
var in_src
var in_val
var in_val2

var resp1
var resp2

function getAJAX(src, val, val2){

	in_src = src
	in_val = val
	in_val2 = val2


	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	} 
   
	var url= "subcat.php?data="+in_src+"&val="+ escape(in_val)+"&val2="+escape(in_val2)

	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)

}


function stateChanged(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){

 		if (xmlHttp.status != 200) {
			alert('Error : Status '+xmlHttp.status+' returned.');
		}

 		var cType = xmlHttp.getResponseHeader("Content-Type")

		var reg = new RegExp("text/html")
		result = reg.test(cType)

		if (result){
			sendOutput()
		}else{
			alert(cType)
		}

   	} 
} 


function GetXmlHttpObject(){ 
	var objXMLHttp=null
	if (window.XMLHttpRequest){
  		objXMLHttp=new XMLHttpRequest()
  	}else if (window.ActiveXObject){
  		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  	}
	return objXMLHttp
}

function sendOutput(){
	document.getElementById(in_src).innerHTML =  xmlHttp.responseText
}


