// dynamic array of linked categories -selcting one updates the other - uses fields in sbfKeywordArrays function setForum(name,form){ // form.ForumName.length = 0; j=0; for(i=0;i < Forumnumentries;i++) { if(tForum[i].indexOf(name)==0) { nChar = tForum[i].indexOf('~'); onlyemp[j]= tForum[i].substring(nChar+1,tForum[i].length); j++; } } for (nbOldEntry=form.ForumName.options.length-1;nbOldEntry>0;nbOldEntry--) form.ForumName.options[nbOldEntry]=null for(x=1; x<(j+1); x++) { form.ForumName.options[x]=new Option(onlyemp[x-1],onlyemp[x-1]) } form.ForumName.focus(); }; // to intercept the onKeyPress event function abortSubmit (e) {return (false)} function checkEnter(event){ //prevent return key var code = 0; if (getBrowserType() == 'N') {code = event.which;} else {code = event.keyCode;} // alert(code); if (code==13){ window.document.forms[0].onsubmit = abortSubmit; } } // function to grab Forum fromURL parameter function getForum() { urlStr= window.location.href; if(urlStr.indexOf("&Forum=")==-1){ return"" } else{ return (urlStr.substring(urlStr.indexOf("&Forum="))); } } // functions used for navigating between threads function openTopic(txtUnid) { var forum= getForum(); forumname= forum.split("&Start="); var videoURL = "/" + getPath () + "/0/" + txtUnid + "?opendocument" + forumname[0]; window.location.href = videoURL; } function openResponse(txtUnid) { var forum = getForum(); var url = "/" + getPath () + "/viewRepliesByUnid/" + txtUnid + "?opendocument" + forum; window.location.href = url; } function replyToTopic(txtUnid) { var forum = getForum(); var videoURL = "/" + getPath () + "/frmResponse?OpenForm&ParentUNID=" + txtUnid + "?opendocument" + forum; window.location.href = videoURL; } function replyToResponse(txtUnid) { var forum = getForum(); var videoURL = "/" + getPath () + "/frmRespToResp?OpenForm&ParentUNID=" + txtUnid + "?opendocument" + forum; window.location.href = videoURL; } //SEARCH FUNCTIONS // simple search function - to process query parameters function queryParameters(field, par){ return ("(FIELD+" + field + "+Contains+" + par +")"); } // search function function getSearchResults() { form=window.document.forms[0]; var searchString = form.SearchStringItem.value; if (searchString == "") { alert("Please enter a text string to search."); form.SearchStringItem.focus(); return; } else { // build search string searchURL = "/" + getPath() + "/viewSearch?SearchView&Query=" + searchString+ "&Start=1&Count=20" ; window.location.href = searchURL; } } // advanced search function - treat NN4 and Mac separately function getAdvancedSearchResults() { form=window.document.forms[0]; // get field values var kw= escape(form.SearchString.value); var catg = escape(getListValue(form.WebCategories)); if (catg=="All%20Categories"){catg=""} var forum = escape(getListValue(form.ForumName)); if (forum=="All%20Forums"){forum=""} // get checkbox values - if both are checked evaluate a OR operator var type=""; var checkType = false; for (i = 0; i < form.PostType.length; i++) { if (form.PostType[i].checked) { if (checkType==true){ type = type + "+OR+"+form.PostType[i].value ;} else{ type = form.PostType[i].value ; checkType = true; } } } if (checkType==false){ type=""} req=""; flag=true; link = "+AND+"; // BUILD SearchString in URL : req= req+ link + " (FIELD " + DocField + Operator + val + ") " if (kw !="") {req = "("+ kw + ")" ; flag=false }; if (req !="" && catg !="" ){ req=req + link}; if( catg !="" ) {req = req +queryParameters('WebCategories', catg) ; flag=false }; if (req !="" && forum !="" ){ req=req + link}; if( forum !="" ) {req = req +queryParameters('ForumName', forum); flag=false }; if (req !="" && type !=""){ req=req + link}; if( type !="") {req= req +queryParameters('PostType', type) ; flag=false }; // alert(req); // if nothing is selected perform a general search to get everything if (flag==true) { req = "*a+OR+*e+OR+*i+OR+*u"; searchURL = "/" + getPath() + "/viewSearch?SearchView&Query=" + req + "&Start=0&Count=20"; } else{ searchURL = "/" + getPath() + "/viewSearch?SearchView&Query=" + req + "&Forum=" + forum + "&Start=0&Count=20"; }; // load url window.location.href = searchURL; }; // used for help popups function openMessageBox(url){ winPopup = window.open(url,"winpopup","width=600, Height=550,alwaysRaised=yes,scrollbars=yes,resizable=yes");winPopup.focus(); } // compatible N & IE code to open url in a new window function openNewWindow (URL, WinName, Features) { window.open(URL, WinName, Features); } // Return the selected value from a listbox function getListValue(fieldName) { var i, nbSelected = 0; for (i = 0; i < fieldName.options.length; i++) { if (fieldName.options[i].selected && fieldName.options[i].text != '') {return fieldName.options[i].text;}; }; return ''; }; //Select the option evaluated to 'value' of the select type field 'fieldName' function selectListValue(fieldName,value) { var i, nbSelected = 0; for (i = 0; i < fieldName.options.length; i++) { if (fieldName.options[i].text == value) { fieldName.options[i].selected = true; }; }; return ''; } //function used in the breadcrumbs locator to browse the forums function openForum(field) { var key = getListValue(field); window.document.location.href='/' + getPath() + '/frmForumBrowse?ReadForm&Forum=' + escape(key) + '&Start=1&Count=8'; } // function used in the forum list to go to a forum function gotoForum(forum) { window.document.location.href='/' + getPath() + '/frmForumBrowse?ReadForm&Forum=' + escape(forum) + '&Start=1&Count=8'; } // Used to altern row colors in view function altern(docNumber) { var lastDocNumber = docNumber.lastIndexOf('.')>=0? docNumber.slice(docNumber.lastIndexOf('.')+1) : docNumber; return(lastDocNumber); }