function searchOnKeyPress(DBPath) // Colin added 6-16-06; mod 9-06-06 { var frm = window.document.forms[0]; var e = window.event; // alert( e.keyCode ); if (e.keyCode == 13) // returns 13 for Enter { if ( Trim(frm.SimpleSearch.value) == "" ) { alert("Please enter a Keyword or Phrase and then click Search"); frm.SimpleSearch.focus() ; return false; } else { pathAndFile = location.pathname.split( ".nsf" ); if ( pathAndFile[0] == "/" ) { location.href = DBPath + "/vwSearch/?SearchView&Query=" + frm.SimpleSearch.value + "&Start=1&Count=50" ; } else { location.href = "vwSearch/?SearchView&Query=" + frm.SimpleSearch.value + "&Start=1&Count=50" ; } return false; } // if ( Trim(frm. } // if (e.key } // = = = End searchOnKeyPress() = = = function searchOnClick(DBPath) // Colin added 6-16-06; 09-07-06 { var frm = window.document.forms[0]; //alert( DBPath ); if ( Trim(frm.SimpleSearch.value) == "" ) { alert("Please enter a Keyword or Phrase and then click Search"); frm.SimpleSearch.focus() ; return false; } else { pathAndFile = location.pathname.split( ".nsf" ); if ( pathAndFile[0] == "/" ) { location.href = DBPath + "/vwSearch/?SearchView&Query=" + frm.SimpleSearch.value + "&Start=1&Count=50" ; } else { location.href = "vwSearch/?SearchView&Query=" + frm.SimpleSearch.value + "&Start=1&Count=50" ; } //if ( path return false; } // if ( Trim(frm.S } // = = = End searchOnClick() = = = function searchOffLocOnClick(DBPath) // Colin added 10-08-09; rev 11-03-09 { var frm = window.document.forms[0]; var srchString = frm.OffLoc.options[frm.OffLoc.selectedIndex].value; //alert( srchString ); if ( Trim( srchString ) == "" ) { alert("Please select a location to search for."); frm.OffLoc.focus() ; return false; } else { var s = new String( srchString ); // var srchStr = "FIELD OffLoc contains " + srchString ; // 11/12/09 //var country = s.slice(0,2); //var state = s.slice(3,5); //var city = s.slice(6, s.length); var sArr = s.split("-"); var country = sArr[0]; var state = sArr[1]; var city = sArr[2]; var srchStr = "[loccntry] contains " + country + " AND [stprov] contains " + state + " AND [loccity] contains " + city ; pathAndFile = location.pathname.split( ".nsf" ); if ( pathAndFile[0] == "/" ) { // location.href = DBPath + "/vwSearch/?SearchView&Query=" + srchString + "&SearchMax=0&SearchOrder=4" ; location.href = DBPath + "/vwSearch/?SearchView&Query=" + srchStr + "&Start=1&Count=50" ; } else { // location.href = "vwSearch/?SearchView&Query=" + srchString + "&SearchMax=0&SearchOrder=4" ; location.href = "vwSearch/?SearchView&Query=" + srchStr + "&Start=1&Count=50" ; } //if ( path return false; } // if ( Trim(frm.S } // = = = End searchOffLocOnClick() = = = function applyOnClick( folderName, reqNo, cntrycd) // Colin revised 11/19/09 - CMR 19724 - Canada application // Colin added 10/13/2009 - CMR 19506 { var frm = window.document.forms[0]; // set applicant tracking db and form based on country code if (cntrycd == 'CA') { location.href = "/" + folderName + "/maxHireCanada.nsf/frmApplication?openForm&ReqID=" + reqNo ; } else { location.href = "/" + folderName + "/candidatetracking.nsf/frmJobApp?readForm&page=1&ReqID=" + reqNo ; } return false; } // = = = End applyOnClick() = = = function Trim(str) { for (i=0;i < str.length;i++) { if (str.charAt(i) != " ") break; } for (j=str.length - 1 ;j >= 0; j--) { if (str.charAt(j) != " ") break; } str = str.substring(i,j+1); return escape(str); } function gosearch() { string=Trim(document.forms[0].SimpleSearch.value); var f = document.frmDS if ( string=="") { alert("Please enter Search Phrase"); return; } //-------------------------------------- if (spacecheck(string)) { return; } pathAndFile = location.pathname.split( ".nsf" ); DBPath = pathAndFile[0] + '.nsf' if (document.forms[0].SearchList.selectedIndex == 1) { location.href= "https://corpapp.maxinc.com/MAXNet/MAXNetMultiDBSearch.nsf/MAXNetSearch/?SearchView&Query="+ string+"&Start=1&Count=50" } else { location.href= DBPath +"/Search/?SearchView&Query="+ string+"&Start=1&Count=50" } } //***********************************************// function spacecheck(strp) { var l = strp.length; var flag1=0; for (var i=0; i" | s1=="(" | s1==")" | s1=="!") { flag1=0; break; } } } if (flag1==0) { alert("Please enter a valid search phrase"); return true; } } //-------------------- n = (document.layers) ? 1:0 ie = (document.all) ? 1:0 //-------------------- function formHandler(form) { var URL = form.shortcuts.options[form.shortcuts.selectedIndex].value; window.location.href = URL; }