/* FILE ARCHIVED ON 22:06:44 Jan 16, 2009 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 21:02:20 Jun 10, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ function clearUser(form, url) { form.elements['clrusr'].value = 'true'; submitForm(form, url); } function setSort(form, url, sortVal, sortDirVal) { form.elements['sortfld'].value = sortVal; form.elements['sortdir'].value = sortDirVal; submitForm(form, url); } function loginGuest(form, url) { form.elements['guest'].value = 'true'; submitForm(form, url); } function checkRegistration(form, downloadUrl) { alertMsg = ""; userInput = form.elements['fname'].value; if ((userInput == null) || (userInput.length == 0)) { alertMsg = "first name"; } userInput = form.elements['lname'].value; if ((userInput == null) || (userInput.length == 0)) { if (alertMsg.length > 0) { alertMsg += ", "; } alertMsg += "last name"; } userInput = form.elements['email'].value; if ((userInput == null) || (userInput.length == 0)) { if (alertMsg.length > 0) { alertMsg += ", "; } alertMsg += "Email"; } userInput = form.elements['organization'].value; if ((userInput == null) || (userInput.length == 0)) { if (alertMsg.length > 0) { alertMsg += ", "; } alertMsg += "Organization"; } if (alertMsg.length > 0) { alertMsg = "The following field(s) need to be filled in: " + alertMsg; alert(alertMsg); } else { submitForm(form, downloadUrl); } } function validate(form) { var grump = form.grumpdata; var gpw = form.gpwdata; var format = form.type; var year = form.year; var resolut = form.resolut; var mess = ""; if ((grump.selectedIndex == 0) && (gpw.selectedIndex == 0)) mess = mess + " Data Product"; if (format.value == "") mess = mess + " Data Format"; if ( (typeof(year) != "undefined") && (year.value == "")) mess = mess + " Year"; if ( (typeof(resolut) != "undefined") && (resolut.value == "")) mess = mess + " Resolution"; if (mess != "") alert('The following field(s) need to be filled in: ' + mess); else submitForm(form, 'download.jsp'); return; } function submitForm(form, url) { form.action = url; form.submit(); } var getQuery = window.document.location.search; var pattern = /streamFile=true/i; if (getQuery.search(pattern) != -1) { getQuery = "/gpw/servlet/FileStream" + getQuery; //alert(getQuery); window.location.replace(getQuery); }