var f, hash; var load = function() { f = doc.frm; _activeCategory(); hash = 1; }; win.onload = load; function _activeCategory() { if(f && f.category) { var lis = doc.getElementById("ul_category").getElementsByTagName("li"); for(var i = 0; i < lis.length; i++) { if(lis[i].id == ("li_" + f.category.value)) { lis[i].setAttribute("class", "ov"); lis[i].setAttribute("className", "ov"); } else { lis[i].setAttribute("class", ""); lis[i].setAttribute("className", ""); } } _ajaxList(true); } else alert(noFormMsg); } function _ajaxList(_flag) { if(xmlhttp && f && f.selectPage && f.category) { xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200 && doc.getElementById("faqList")) { doc.getElementById("faqList").innerHTML = xmlhttp.responseText.toString(); if(_flag) _hideBlind(); _checkAjaxError(); } }; _showBlind(); if(doc.location.hash && doc.location.hash.toString().length > 1) f.selectPage.value = doc.location.hash.toString().replace("#", ""); doc.location.hash = ""; xmlhttp.open("POST", "ajax/faq_list", true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send("selectPage=" + f.selectPage.value + "&category=" + f.category.value); } else alert(noFormMsg); } function _setCategory(_code) { if(f && f.category) { f.category.value = _code; _activeCategory(); } else alert(noFormMsg); } function _view(_idx) { if(f && f.idx) { f.idx.value = _idx; _go("faq_view"); } else alert(noFormMsg); }