function encodeXML(theString) {
return theString.replace(/&/g, '&')
.replace(//g, '>')
.replace(/"/g, '"');
}
function trim(stringToTrim) {
return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
}
function checkSearch(submitFormObj) {
var searchString = trim(submitFormObj.searchstring.value);
searchString = encodeXML(searchString);
var checkBox = document.getElementById("searchAll");
if (searchString=="") {
if (confirm("Show *all* data in the PARC Catalog?")) {
searchString = "%";
} else {
return false;
}
}
if (!checkBox.checked && searchString!="%") {
submitFormObj.query.value = ""
+"Web-Search"
+"eml://ecoinformatics.org/eml-2.1.1"
+"eml://ecoinformatics.org/eml-2.1.0"
+"eml://ecoinformatics.org/eml-2.0.1"
+"eml://ecoinformatics.org/eml-2.0.0"
+"metadata"
+"originator/individualName/surName"
+"originator/individualName/givenName"
+"creator/individualName/surName"
+"creator/individualName/givenName"
+"originator/organizationName"
+"creator/organizationName"
+"dataset/title"
+"dataset/title/value"
+"keyword"
+"keyword/value"
//fgdc fields
+"idinfo/citation/citeinfo/title"
+"idinfo/citation/citeinfo/origin"
+"idinfo/keywords/theme/themekey"
+""
+""
+""
+"Palmyra Atoll Research Consortium"
+"creator/organizationName"
+""
+""
+""
+""
+"" + searchString + ""
+"creator/individualName/surName"
+""
+""
+"" + searchString + ""
+"creator/individualName/givenName"
+""
+""
+"" + searchString + ""
+"keyword"
+""
+""
+"" + searchString + ""
+"keyword/value"
+""
+""
+"" + searchString + ""
+"para"
+""
+""
+"" + searchString + ""
+"geographicDescription"
+""
+""
+"" + searchString + ""
+"literalLayout"
+""
+""
+"" + searchString + ""
+"dataset/title"
+""
+""
+"" + searchString + ""
+"dataset/title/value"
+""
+""
+"" + searchString + ""
+"@packageId"
+""
+""
+"" + searchString + ""
+"abstract/para"
+""
+""
+"" + searchString + ""
+"abstract/para/value"
+""
+""
+""
+"";
} else {
queryTermString = "";
if (searchString != "%"){
queryTermString = ""
+"" + searchString + ""
+"";
}
submitFormObj.query.value = ""
+"Web-Search"
+"eml://ecoinformatics.org/eml-2.1.1"
+"eml://ecoinformatics.org/eml-2.1.0"
+"eml://ecoinformatics.org/eml-2.0.1"
+"eml://ecoinformatics.org/eml-2.0.0"
+"metadata"
+"originator/individualName/surName"
+"originator/individualName/givenName"
+"creator/individualName/surName"
+"creator/individualName/givenName"
+"originator/organizationName"
+"creator/organizationName"
+"dataset/title"
+"dataset/title/value"
+"keyword"
+"keyword/value"
//fgdc fields
+"idinfo/citation/citeinfo/title"
+"idinfo/citation/citeinfo/origin"
+"idinfo/keywords/theme/themekey"
+""
+""
+""
+"Palmyra Atoll Research Consortium"
+"creator/organizationName"
+""
+""
+ queryTermString
+""
+"";
}
return true;
}
function browseAll(searchFormId) {
var searchForm = document.getElementById(searchFormId);
var searchString = searchForm.searchstring;
var checkBox = document.getElementById("searchAll");
searchString.value="";
checkBox.checked = true;
if (checkSearch(searchForm)) {
searchForm.submit();
}
}
function searchAll(){
var checkBox = document.getElementById("searchCheckBox");
if (checkBox.checked == true) {
alert("You have selected to search all possible existing fields. This search will take longer.");
}
}