
function doSearch(eid, isbn, bookType) {

	var searchForm = document.getElementById("searchForm");
	if(!searchForm) {
		return;
	}
	
	// The search is done under either an "open" url or a "registered" url:
	var urlType = "o"; // assume "open" unless we determine otherwise...

	// The drop down is optional
	var selected_index = searchForm.elements["searchScope"].selectedIndex;
	if(typeof(selected_index) != 'undefined'){
		var searchType = searchForm.elements["searchScope"].options[selected_index].value;
		if (!(searchType == "ThisTitle"  || searchType == "AllTitles")) {
			// They have to at least be registered/logged in:
			urlType = "r";
		}										 
	}

	// The search url various depending...
	var searchUrl = "../" + urlType + "/search.do?method=getSearchResults&refreshType=page";

	if(eid && eid != "") {	
		searchUrl = searchUrl + "&eid=" + eid;
	}
	if(isbn && isbn != "") {								
		searchUrl = searchUrl + "&isbn=" + isbn;				
	}
	if(bookType && bookType != "") {								
		searchUrl = searchUrl + "&bookType=" + bookType;				
	}
	searchForm.action=searchUrl;
	searchForm.submit();
}

