function LaunchZipSearch(controlname)
	{
		searchURL = "index.aspx?section_id=12&page_id=105&zip=" + document.getElementById(controlname).value;
		
		document.location = searchURL;
	}
	
function onEnterSubmitZipSearch(event, controlname)
{
	if (document.all) {
		if (window.event && window.event.keyCode == 13)
			LaunchZipSearch(controlname);
        else
			return true;
    }
    else {
		if (event && event.which == 13)
			LaunchZipSearch(controlname);
        else
            return true;
    }
    
    return false;
}


function setNSHomepage(URL) {  // this HAS to be signed if it is to run on the web
  var Text = '';
  Text += 'Due to Netscapes security handling, making this page your homepage, will show you a dialog with a warning.\n';
  Text += 'If you do not wish to grant this site the access to your browser settings,';
  Text += ' you can manually copy the current location and paste it in the location field in Edit / Preferences / Navigator.';
  if (confirm(Text)) {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
    navigator.preference('browser.startup.homepage',URL);
  }
  
}

function MakeQLHomePage(obj)
{
	isIE = false;
	navVer = navigator.appVersion;
	ver = parseFloat(navVer);
	IEPos = navVer.indexOf('MSIE');
	if (IEPos !=-1) {
		isIE = true;
		ver = parseFloat(navVer.substring(IEPos+5,navVer.indexOf(';',IEPos)));
	}
	
	alert (obj);

	isIE5up = (isIE && ver >= 5);

	HomePage = 'www.queenslibrary.org';
	if (document.layers) setNSHomepage(HomePage);
	else if (isIE5up) {
	    obj.style.behavior='url(#default#homepage)';
		obj.setHomePage(HomePage);
	}
	else alert('Sorry, the browser you are using does not support automatically setting QueensLibrary.org as your Homepage.  Please try adding QueensLibrary.org manually.');
}