/* * Faq Page */ Namespace.Register("FaqPage") FaqPage.answerToHighlight = 0; FaqPage.currentCategory = -1; FaqPage.init = function(catId, itemId, answerId) { highLightMainNavigation("faq"); FaqPage.showItem(catId, itemId, answerId); } FaqPage.showCategory = function(catId) { if (catId != FaqPage.currentCategory) { FaqPage.currentCategory = catId; highLightTab("cat"+catId); updateContent("/faq_item.htm","faqitems",{'id':catId}); $("faqcontent").update("Please select a topic"); } } FaqPage.showItem = function (catId, itemId, answerId) { if (answerId == undefined || answerId == null) { answerId = 0; } if (catId != FaqPage.currentCategory) { FaqPage.currentCategory = catId; highLightTab("cat"+catId); updateContent("/faq_item.htm","faqitems",{'id':catId}); } FaqPage.answerToHighlight = answerId; getContent("/faq_answers.htm","faqcontent",{'id': itemId},FaqPage.onShowItem); } FaqPage.onShowItem = function (result) { if (FaqPage.answerToHighlight != 0) { FaqPage.showAnswer(FaqPage.answerToHighlight); FaqPage.answerToHighlight = 0; } } FaqPage.showAnswer = function(answerid) { FaqPage.hideAllAnswers(); var el = $("answer"+answerid); if (el) { el.show(); } AjaxManager.countAnswerHit(answerid); } FaqPage.search= function() { updateContent("/faq_answers.htm", "faqcontent", { term : $F("term") }); } FaqPage.showAllAnswers = function() { var elements = $$('div.answer'); elements.each(function(item) { item.show(); }); $('expandAll').hide(); $('collapseAll').show(); } FaqPage.hideAllAnswers = function() { var elements = $$('div.answer'); elements.each(function(item) { item.hide(); }); $('expandAll').show(); $('collapseAll').hide(); }