<!--

function validated(string) {
	var i = 0;
	var output = '';
	for(valid="123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\""; i < string.length; i++) {
		if(valid.indexOf(string.charAt(i)) != -1) { output += string.charAt(i); }
		else { output += " "; }
	}
	return output;
}

function redirectSearch () {
	var search_type = "web";
	var validated_input = validated(document.redirect_search.query.value);

	if(document.redirect_search.search_type.options[document.redirect_search.search_type.selectedIndex].value) {
	  search_type = document.redirect_search.search_type.options[document.redirect_search.search_type.selectedIndex].value
	}

   if(search_type == "phone") {
	  url = "http://www.unimelb.edu.au/cgi-bin/phone/phone.pl";
	  query_string = "pattern="+escape(document.redirect_search.query.value);
	  window.open(url+"?"+query_string, "window1");
	}
	else if(search_type == "email") {
	  url = "http://www.unimelb.edu.au/cgi-bin/email.pl";
	  query_string = "name="+escape(document.redirect_search.query.value);
	  window.open(url+"?"+query_string, "window1");
	}
	else if(search_type == "uni") {
		url = "http://websearch.its.unimelb.edu.au/query.html";
		query_string = "col=unimelb&ht=0&ws=0&qm=0&st=1&nh=25&lk=1&rf=0&rq=0&si=1&qt="+escape(document.redirect_search.query.value);
		window.open(url+"?"+query_string, "window1");
	}
	else if(search_type == "law") {
		url = "http://www.google.com/u/UniversityofMelbourneLawSchool";
		query_string = "domains=law.unimelb.edu.au&sitesearch=law.unimelb.edu.au&q="+escape(document.redirect_search.query.value);
		window.open(url+"?"+query_string, "window1");
	}
	else {
	  url = "http://www.google.com/search";
	  query_string = "hl=en&btnG=Google+Search&q="+escape(document.redirect_search.query.value);
	  window.open(url+"?"+query_string, "window1");
	}
	return(false);
}

// -->

