function back() { window.location = 'default.asp'; } function hideError(input, errId) { input.style.borderColor = ''; document.getElementById(errId).style.display = 'none'; } function showError(input, errId, errMsg) { var err = document.getElementById(errId); input.style.borderColor = '#cc0033'; err.style.display = 'block'; err.innerHTML = errMsg || 'Please enter some terms.'; } // Retrieves the selected option of a select element. function getSelectedOption(sel) { if (sel && sel.selectedIndex >= 0 && sel.selectedIndex < sel.options.length) { return sel.options[sel.selectedIndex]; } return {text: "", value: ""}; } // Retrieves the selected value of a select element. function getSelected(sel) { return getSelectedOption(sel).value; } function convertAfterDate(dt) { if (dt.indexOf(':') == -1) { return ''; } var tmp = dt.split(':'); var period; switch(tmp[1]) { case 'DY': period = 1; break; case 'WK': period = 7; break; case 'MO': period = 31; break; case 'YR': period = 365; break; default: period = 0; break; } return 'date > %currdate-' + (period * parseInt(tmp[0], 10)) + '%'; } function getMQ(propertyFile) { if (!propertyFile) { var propertyFile = 'properties.txt'; } var mq = LNParser.propertyFactory(propertyFile); if (CookieUtil.exists('lnaOC')) { mq.setOriginationCode(CookieUtil.read('lnaOC')); } mq.setTarget('mainFrame'); mq.set('ssl', 'f'); // This works around faulty EZProxy configurations. (Also for origin-www.lexisnexis.com) if (!isDev() && window.location.href.indexOf('cert') == -1) { mq.set('domain', document.location.host); } return mq; } function sendSearch(query, searchtype, source, date, other) { var mq = getMQ(); if (date && date != '') { query = appendValue({value: convertAfterDate(date)}, '', query); } mq.set('lrt', window.location + ''); mq.setSearch(query); mq.setSource(source); mq.setSearchtype(searchtype); mq.setTarget('_self'); if (other) { for (var i in other) { mq.set(i, other[i]); } } mq.submit(); }