function browseChg(isFirst, pageNum, sArg, sType, ordBy, fromWhere) {
	var str = "browse.php?first_time=" + isFirst + "&page=" + pageNum + "&searchArg=" + sArg + "&searchType=" + sType + "&orderBy=" + ordBy + "&fromWhere=" + fromWhere;
//alert ("js string (str) = " + str);
		location.href = str;
}

function browseChgAdv(isFirst, pageNum, sArg1, sArg2, sArg3, sArg4, sType1, sType2, sType3, sType4, conj1, conj2, conj3, ordBy, fromWhere) {
	var str = "browse.php?first_time=" + isFirst + "&page=" + pageNum 
+ "&searchArg1=" + sArg1 + "&searchArg2=" +  sArg2 + "&searchArg3=" + sArg3 + "&searchArg4=" + sArg4  + "&searchType1=" + sType1 + "&searchType2=" + sType2 + "&searchType3=" + sType3+ "&searchType4=" + sType4   +"&conj1=" + conj1 + "&conj2=" + conj2 + "&conj3=" + conj3 + "&orderBy=" + ordBy  + "&fromWhere=" + fromWhere;   
//alert ("js string (str) = " + str);
	location.href = str;
}	

function searchChg(isFirst, pageNum, sArg, sType, ordBy, mode, countTotal, fromWhere) {
var str = "search.php?first_time=" + isFirst + "&page=" + pageNum + "&searchArg=" + sArg + "&searchType=" + sType + "&orderBy=" + ordBy + "&mode=" + mode + "&countTotal=" + countTotal + "&fromWhere=" + fromWhere;
//alert ("js string (str) = " + str);
location.href = str;
}

function advsearchChg(isFirst, pageNum, sArg1, sArg2, sArg3, sArg4, sType1, sType2, sType3, sType4, conj1, conj2, conj3, ordBy, mode, countTotal, fromWhere) {
//alert("advsearchChg in the js file.  first = " + isFirst + "  page number = " + pageNum + "  searchArg1 = " + sArg1  + "  searchArg2 = " + sArg2  + "  searchArg3 = " + sArg3  + "  searchArg4 = " + sArg4 + "  searchType1 = " + sType1 + "  order by is " + ordBy + " runmode = " + mode + "Total count = " + countTotal + "Author count = " + countAuthors + "Journal count = " + countJournals + "Subject count = " + countSubjects  + "from Where is " + fromWhere);
var str = "advanced_search_results.php?first_time=" + isFirst + "&page=" + pageNum + "&searchArg1=" + sArg1 + "&searchArg2=" + sArg2 + "&searchArg3=" + sArg3 + "&searchArg4=" + sArg4  + "&searchType1=" + sType1 + "&searchType2=" + sType2 + "&searchType3=" + sType3 + "&searchType4=" + sType4 + "&conj1=" + conj1 + "&conj2=" + conj2 + "&conj3=" + conj3 + "&orderBy=" + ordBy + "&mode=" + mode + "&countTotal=" + countTotal + "&fromWhere=" + fromWhere;
//alert ("js string (str) = " + str);
location.href = str;
}

function changeBoxStatus(low, high, how){
	var boxes = new Array();
//alert(low, high);
	for (var i = low; i <= high; i++) {
		boxes[i] = document.getElementById("cb"+i);
		if (how == 'set'){
			boxes[i].checked = true;
		} else {
			boxes[i].checked = false;
		}
	}
}

function newBrowseType(type) {
	// change the browse type on the A-Z clicks of the Browse page
	var xtype;
	switch(type)
	{
	case 0:
	  xtype = 'primaryauthor';
	  break;    
	case 1:
	  xtype = 'name';
	  break;
	case 2:
	  xtype = 'subject';
	  break;
	 default:
	  xtype = 'name';
	} 
	//alert("arrived in newBrowseType");
	var caps = new Array();
	var letters = new Array(" ", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
	for (var i = 1; i <= 26; i++) {
		caps[i] = document.getElementById("letters"+i);
		caps[i].href = "browse.php?first_time=no&searchArg=" + letters[i] + "&searchType=" + xtype;
	}
}

function checkEnter(e, sArg, sType){ //e is event object passed from function invocation
	var isFirst = "no";
	var pageNum = 0;
	var fromWhere = "self";
	var ordBy = sType;
	var characterCode //literal character code will be stored in this variable

	if (e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else {
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}  

	if (characterCode == 13) { //if generated character code is equal to ascii 13 (if enter key)
		var str = "browse.php?first_time=" + isFirst + "&page=" + pageNum + "&searchArg=" + sArg + "&searchType=" + sType + "&orderBy=" + ordBy + "&fromWhere=" + fromWhere;
		location.href = str;
	}   
}







