Sign In
|
Sign Up
|
Help
|
Invite
Advanced Search
Ask A Question
Community
Recent Changes
My:
Contributions
'; } else { // $('paginationSpan').style.display = '' $('result_pagination').style.display = '' $('num_display').style.display = '' $('pageCount').value = parseInt(data.pageInfo.pageCount); $('fetchSize').value = parseInt(data.pageInfo.fetchSize); $('currentPage').value = parseInt(data.pageInfo.currentPage); $('recordCount').value = parseInt(data.pageInfo.recordCount); $('searchResult').style.display = ''; $('result_pagination').style.display = ''; //display the first page setPaginationInfo(); displayPage(1); //display suggested Category if (data.suggestedCategory[0] == "noSuggestion") { for (var i = 0; i < 2; i++) { var index = i + 1; var cId = 'categoryhint' + index; $(cId).innerHTML = " " } //display suggested Keywords for (var i = 0; i < 10; i++) { var index = i + 1; var kId = 'keywordhint' + index; $(kId).innerHTML = " " } // obj.objArray = [] } else { var CIndex = data.suggestedCategory.length > 2? 2:data.suggestedCategory.length for (var i = 0; i < CIndex; i++) { var index = i + 1; var cId = 'categoryhint' + index; $(cId).innerHTML = '
' + data.suggestedCategory[i].string + '
'; } //display suggested Keywords var KIndex = data.suggestedKeywords.length > 10? 10:data.suggestedKeywords.length for (var i = 0; i < KIndex; i++) { var index = i + 1; var kId = 'keywordhint' + index; $(kId).innerHTML = '
' + data.suggestedKeywords[i] + '
'; } } } } function addKeyword(keyword) { var keywords = $('keywords').value; if (keywords != '') { $('keywords').value = keywords + ' ' + keyword; } else { $('keywords').value = keyword; } } function setCategory(code, category) { $('category').value = code; $('selectedCategory').innerHTML = category; } function clearCategory() { $('selectedCategory').innerHTML = "All"; $('category').value = '0' } function validationLightbox() { if ($('q_name').value == '') { alert("The query name is required.") } else { saveQuery($F('q_name')) } } function saveQuery(queryName) { $('targetAction').value = 'checkQueryName'; var param = Form.serialize($('searchForm')) + '&queryName=' + queryName; var myAjax = new Ajax.Request( "query.view", { method: 'post', parameters: param, onComplete: afterCheckName }); } function afterCheckName(originalRequest) { var data = eval("(" + originalRequest.responseText + ")"); if(data.exsit == 'N'){ $('targetAction').value = 'saveQuery'; var param = Form.serialize($('searchForm')) + '&queryName=' + data.queryName; var myAjax = new Ajax.Request( "query.view", { method: 'post', parameters: param, onComplete: closeLightBox }); }else{ if(confirm("The query name has already exsited, Do you want to overwrite?")){ $('targetAction').value = 'overwriteQuery'; var param = Form.serialize($('searchForm')) + '&queryName=' + data.queryName; var myAjax = new Ajax.Request( "query.view", { method: 'post', parameters: param, onComplete: closeLightBox }); } } } function closeLightBox(originalRequest) { stopLightbox(); } function testNumeric(obj) { if ($F('id') == '') { $('id').focus(); return false; } if (isNaN($F('id'))) { alert('The question id should be a number.'); $('id').value = ''; $('id').focus(); return false; } return true; } function onNumericFieldKeyPress(e) { var keyCode,keychar,numcheck; if (window.event) {// IE keyCode = e.keyCode; } else if (e.which) {// Netscape/Firefox/Opera keyCode = e.which; } keychar = String.fromCharCode(keyCode); numcheck = /\d/; if (numcheck.test(keychar) || keyCode == 8 || keyCode == undefined) { return true; } if (keyCode == 13) { $('searchBtn').onclick(); } return false; } function chooseCategory(cat, inheritsStr) { // var obj = document.getElementById("rootCat"); // obj.focus(); $('category').value = cat; $('selectedCategory').innerHTML = inheritsStr; } window.onload=function(){ $('selectedCategory').innerHTML = "All";$('category').value = '0';$('hidCate').value='0' $('ssearchKeywords').style.display = "none"; $('ssearchSubmit').style.display = "none"; var keywords = ""; if (keywords.length > 0) searchKeywords(keywords); } function KeyDown(event){ if(event.keyCode==13){ document.getElementById("searchBtn").click(); return false; } }
Home
|
About Us
|
Terms of Use
|
Privacy Policy
|
Browse Questions
| RSS Feed
Copyright ©2010 WISTEME LLC. All Rights Reserved.