// This function uses display to show/hide divs which clears the space taken up by a div function showhide(layerID, mode){ var currentRef = document.getElementById(layerID).style modes = new Array; modes[0] = 'none'; modes[1] = 'block'; if(isNaN(mode)) currentRef.display = (currentRef.display == 'none') ? 'block' : 'none' else currentRef.display = modes[mode] } // This function uses visibility to show/hide divs which preserves the space taken up by a div function switchVis(layerID, mode){ var currentRef = document.getElementById(layerID).style modes = new Array; modes[0] = 'hidden'; modes[1] = 'visible'; if(isNaN(mode)) currentRef.visibility = (currentRef.visibility == 'hidden') ? 'visible' : 'hidden' else currentRef.visibility = modes[mode] } function chState(field){ var ds_value = field.value; if (ds_value==0){ field.value=1; document.forms.searchForm.query.focus(); } else if (ds_value==1){ field.value=0; document.forms.searchForm.query.focus(); } } function preventEmptySearch() { var content; content = document.forms.searchForm.query.value; if (content =='') { document.forms.searchForm.send2.disabled=true; } else { document.forms.searchForm.send2.disabled=false; } } function chDivState () { var ds_value = document.forms.searchForm.divstate.value if (ds_value==0){ document.getElementById('simple').style.background='#00389C'; //active document.getElementById('advanced').style.background='#90c5f5'; //non-active }else if (ds_value==1){ document.getElementById('advanced').style.background='#00389C'; //active document.getElementById('simple').style.background='#90c5f5'; //non-active }else{ document.getElementById('simple').style.background='#00389C'; //active document.getElementById('advanced').style.background='#90c5f5'; //non-active } } function cleanUp(){ var kw=document.forms.searchForm.query.value; var notwanted=new Array('""',";",".",":","<",">","/","\\","\&","\$","\#","\%","\=","[]+"); for (var i=0; i < notwanted.length; i++){ var j=0; while (j < kw.length){ if (notwanted[i]=='""'){ kw=kw.replace(notwanted[i], '"'); }else{ kw=kw.replace(notwanted[i], ""); } j++; } } document.forms.searchForm.query.value=kw; document.forms.searchForm.send2.disabled=true; } function resetForm() { var df = ""; document.forms.searchForm.fromDate.value=df; document.forms.searchForm.toDate.value=df; var textinput=""; document.forms.searchForm.query.value=textinput; var sF_index=0; document.forms.searchForm.subFolder.selectedIndex=sF_index; var rT_index=0; document.forms.searchForm.resultType.selectedIndex=rT_index; var sR_index=0; document.forms.searchForm.sortResults.selectedIndex=sR_index; cal_01.hideCalendar(); cal_01.disabledDatesExpression = ""; cal_02.hideCalendar(); cal_02.disabledDatesExpression = ""; showhide('results', 0); document.forms.searchForm.query.focus(); document.forms.searchForm.send2.disabled=true; } function andConnect() { var current=document.forms.searchForm.query.value; if (current.length > 0){ current = current.toString().split('"').join(''); current = current.toString().split(' AND ').join(' '); current = current.toString().split(' OR ').join(' '); current = current.toString().split(' ').join(' AND '); document.forms.searchForm.query.value=current; } document.forms.searchForm.query.focus(); } function orConnect() { var current=document.forms.searchForm.query.value; if (current.length > 0){ current = current.toString().split('"').join(''); current = current.toString().split(' AND ').join(' '); current = current.toString().split(' OR ').join(' '); current = current.toString().split(' ').join(' OR '); document.forms.searchForm.query.value=current; } document.forms.searchForm.query.focus(); } function setQuotes() { var current=document.forms.searchForm.query.value; var result = current.match(/\s/); if (result){ if (current.length > 0){ current = current.toString().split('"').join(''); current = current.toString().split(' AND ').join(' '); current = current.toString().split(' OR ').join(' '); current = '"' + current + '"'; document.forms.searchForm.query.value=current; } } document.forms.searchForm.query.focus(); }