// JavaScript Document
/*THIS SCRIPT CONTROLS THE MULTIPLE SEARCH AREA ON THE LIBRARY HOME PAGE*/

function rusearch() {
	var url="http://hokhmah.stmarys-ca.edu:2048/login?url=http://refuniv.odyssi.com/cgi-bin/member/search/r?dbs+ruprime:@and+";
	var searchInputEl = document.getElementById("ruSearchInput");
	document.location=url + encodeURIComponent(searchInputEl.value);
}

function getKeyValue(e,form) {
   var key=e.keyCode || e.which;
   if (key==13) {
       rusearch();
   }
} 

var tab    = new Array('albertTab','databaseTab','referenceTab','multiTab','periodicalsTab','reservesTab');
var tabCnt = new Array();
tabCnt[0]  = "<p>Search Albert to find books, movies, etc.. (will open in a new window)</p>"
			+ "<form action='http://albert.stmarys-ca.edu/search/' method='post' target='pop' "
			+ "onsubmit=\"window.open('', 'pop', "
			+"'width=750,height=500,status=yes,resizable=yes,scrollbars=yes,toolbar=yes')\">"
			+ "<select name='searchtype'><option value='X'>Keyword</option>"
			+ "<option value='t'>Title</option>"
			+ "<option value='a'>Author</option>"
			+ "<option value='d'>Subject</option>"
			+ "<option value='c'>SMC Call Number</option>"
			+ "<option value='i'>ISBN/ISSN Number</option></select>&nbsp;"
			+ "<input type='text' name='searcharg' size='25' maxlength='75' />"
			+ "<input type='hidden' name='SORT' value='D' />&nbsp;"
			+ "<input type='submit' name='submit' value='Submit' class='submit' />"
			+ "</form><br /><p><a href='http://albert.stmarys-ca.edu/search/X'>Advanced Search</a></p>";
			
tabCnt[1]  = "<p>Search the list of Online Databases by Title:</p>"
			+ "<form action='/databases/search.php' method='get'>"
			+ "<input type='text' name='keyword' size='25' maxlength='75' />"
			+ "<input type=\"submit\" value=\"Search!\"></form>"
			+ "<p><a href='http://library.stmarys-ca.edu/databases/index.html'>Browse list of Databases</a></p>";
tabCnt[2]  = "<p>Search Reference Universe, an index to thousands of reference titles, to find available encyclopedias and handbooks.</p>"
           + "<div><div id='ruSearchBox'>"
           + "<input type='text' id='ruSearchInput' size='30' onKeyPress='getKeyValue(event,this.form)' />"
           + "<div style='display:inline'>&nbsp;<input type='submit' name='submit' value='Submit' class='submit' onclick='rusearch()'/></div></div></div>" 
tabCnt[3]  = "<p>Find articles within all of our top 20 databases</p><FORM class=formborder name=searchForm "
			+ "action='http://hokhmah.stmarys-ca.edu:2048/form?qurl="
			+ "http://xr8br6br2s.cs.serialssolutions.com/resultFrameset.jsp' method=post>"
			+ "<INPUT type=hidden value=XR8BR6BR2S name=SS_LibHash>"
			+ "<INPUT type=hidden value=&rdquo;&rdquo; name=dbIDList>"
			+ "<INPUT type=hidden value=basic name=searchType>"
			+ "<INPUT type=hidden value=start name=action>"
			+ "<INPUT type=hidden value=default name=catGroupList>"
			+ "<INPUT type=hidden value=Category name=searchBy>"
			+ "<INPUT type=hidden value=32978 name=catID>"
			+ "<INPUT maxLength=1000 size=30 name=term>&nbsp;"
			+ "<SELECT name=field0> <OPTION selected>Title</OPTION>"
			+ "<OPTION>Author</OPTION> <OPTION>Subject</OPTION> <OPTION>ISSN</OPTION>"
			+ "<OPTION>Any</OPTION></SELECT>&nbsp;"
			+ "<INPUT type='submit' name='submit' value='Submit' class='submit' />"
			+ "</FORM><br /><p><a href='http://hokhmah.stmarys-ca.edu:2048/"
			+ "login?url=http://xr8br6br2s.cs.serialssolutions.com/'>Advanced Search</a></p>";
tabCnt[4]  = "<p><b>Find </b>periodicals by title or ISSN</p>"
			+ "<form method='get' action='http://xr8br6br2s.search.serialssolutions.com/' "
			+ "target='pop' onsubmit=\"window.open('', 'pop', 'width=750,height=500,status=yes,resizable=yes,scrollbars=yes,toolbar=yes')\">"
			+ "<input value='1.0' name='V' type='hidden'>"
			+ "<input value='100' name='N' type='hidden'>"
			+ "<input name='L' value='XR8BR6BR2S' type='hidden'>"
			+ "<select name='S'>"
			+ "<option value='T_B'>Title begins with</option>"
			+ "<option value='T_M'>Title equals</option>"
			+ "<option value='T_W_A'>Title contains all words</option>"
			+ "<option value='I_M'>ISSN equals</option>"
			+ "</select>&nbsp;"
			+ "<input name='C' value=''>"
			+ "&nbsp;<input type='submit' name='submit' value='Submit' class='submit' />"
			+ "</form><br /><p><a href='http://xr8br6br2s.search.serialssolutions.com/'>"
			+ "<strong>Browse</strong> periodicals by subject</a></p>";
tabCnt[5]  = "<p>Search for course reserves by:</p>"
			+ "<select id='srchBy' name='searchBy'>"
			+ "<option value='c'>Course Title&nbsp;</option>"
			+ "<option value='i'>Instructor</option>"
			+ "</select>"
			+ "<form method='get' id='rsrv' action='http://albert.stmarys-ca.edu/search/r' "
			+ "target='pop' onsubmit=\"if(document.getElementById('srchBy').value=='i'){ document.getElementById('rsrv').action='http://albert.stmarys-ca.edu/search/p';}window.open('', 'pop', 'width=750,height=500,status=yes,resizable=yes,scrollbars=yes,toolbar=yes')\">"
			+ " <input name='SEARCH' size='25' value='' type='text' />"
			+ "&nbsp;<input type='submit' name='submit' value='Submit' class='submit' />"
			+ "</form>";
			
function switchMulti(element){
	for( var i = 0; i < 6 ; i++ ){
		if(tab[i] == element.parentNode.id){
			document.getElementById(tab[i]).className = "current";
			document.getElementById('multiple_search_content').innerHTML = tabCnt[i];
		}else{
			document.getElementById(tab[i]).className = "";	
		}
	}
}
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			