var g_TabNo = "0"; var g_SubTabNo = "0"; var g_SubTabURL = ""; var g_SubTabHeader = ""; var g_SubTabFooter = ""; var g_TabTitle = ""; var g_SubTabTitle = ""; var g_QuickNavTitle = ""; rnd.today = new Date(); rnd.seed = rnd.today.getTime(); function rnd() { rnd.seed = (rnd.seed*9301+49297) % 233280; return rnd.seed/(233280.0); } function rand(number) { return Math.ceil(rnd()*number); } function showQuickNav(oID, sAction, nReload) { var quickNavID = document.getElementById(oID); var quickNavName = document.getElementById(oID + 'Name'); var quickNavImgDID = document.getElementById(oID + 'DID'); var quickNavImgRID = document.getElementById(oID + 'RID'); if (quickNavName != null) {g_QuickNavTitle = quickNavName.innerText; } if (sAction == "Home") { sitestat(_nedstaturi + computeSiteStatCounter()); g_QuickNavTitle = ""; window.location.href = _db_pathabsolute; return; } if (quickNavID != null) { if (quickNavID.style.display == 'none' || sAction == 'expand') { quickNavID.style.display = 'block'; var quickNavFrame = window.frames[ oID + 'Frame']; sitestat(_nedstaturi + computeSiteStatCounter()); g_QuickNavTitle = ""; if ((quickNavFrame != null) && (nReload == 1)) quickNavFrame.location.reload(); } else { quickNavID.style.display = 'none'; } if (quickNavImgDID.style.display == 'none' || sAction == 'expand') { quickNavImgDID.style.display = 'inline'; } else { quickNavImgDID.style.display = 'none'; } if (quickNavImgRID.style.display == 'none' || sAction == 'expand') { quickNavImgRID.style.display = 'inline'; } else { quickNavImgRID.style.display = 'none'; } } } function checkEventList(eventList) { for(i = 0; i < eventList.length; i++) { if(eventList[i].checked) { return true; } } return false; } function checkCheckbox(frm, fieldname) { for (var i = 0; i< frm.elements.length; i++) { var elemCheck= frm.elements[i]; if (elemCheck.name == fieldname) { if (elemCheck.checked) return true; } } } function updateContent( subTabContent, subTabHeader, subTabFooter) { var oContentHeader = document.getElementById("contentHeader"); var oContentFrame = document.getElementById("contentFrame"); var oContentFooter = document.getElementById("contentFooter"); if (oContentHeader != null && subTabHeader != null) { oContentHeader.innerHTML = subTabHeader; } if (oContentFrame != null && subTabContent != null) { oContentFrame.innerHTML = subTabContent; } if (oContentHeader != null && subTabFooter != null) { oContentHeader.innerHTML = subTabHeader; } } function updateContentFrame(subtabURL, subtabHeader, subtabFooter) { var subtabFrame = ""; if(subtabURL != null && subtabURL.length > 0) { subtabFrame = ""; } updateContent(subtabFrame, subtabHeader, subtabFooter); } function swapDisplay(oID1, oID2) { if(oID1 != null && oID2 != null){ oID1.style.display = 'none'; oID2.style.display = 'inline'; } } function tabOn(tabNo){ var tabIDActive; var tabIDName; var tabIDSelected; var nPos = 0; g_QuickNavTitle = ""; for (idx = 0; idx < allTabIds.length; idx++) { tabIDActive = document.getElementById("tab" + allTabIds[idx] + "active"); tabIDSelected = document.getElementById("tab" + allTabIds[idx] + "selected"); if ((tabIDActive != null) && (tabIDSelected != null)) { if (tabNo == allTabIds[idx]) { tabIDName = document.getElementById("tab" + tabNo + "name"); if(tabIDName != null) { g_TabTitle = tabIDName.innerText; } swapDisplay(tabIDActive, tabIDSelected); nPos = idx + 1; } else { swapDisplay(tabIDSelected, tabIDActive); } } } if (nPos > 0) { eval(allSubTabDefs[nPos-1]); } } function subtabOn(tabNo, subtabNo, subtabURL, subtabHeader, subtabFooter) { var tabIDActive; var tabIDName; var tabIDSelected; var bSetContent = false; g_QuickNavTitle = ""; subtabMiscOff(); for (ididx = 0; ididx < allTabIds.length; ididx++) { sID = allTabIds[ididx]; tabSubTab = document.getElementById("subtab" + sID); if (tabSubTab != null) { if (tabNo == sID) { for (idx = 1; idx <= parseInt(allSubTabCounts[ididx], 10); idx++) { tabIDActive = document.getElementById("subtab" + sID + "" + idx + "active"); tabIDSelected = document.getElementById("subtab" + sID + "" + idx + "selected"); if (idx == subtabNo) { if (tabNo != "0") { g_TabNo = tabNo; g_SubTabNo = subtabNo; g_SubTabURL = subtabURL; g_SubTabHeader = subtabHeader; g_SubTabFooter = subtabFooter; } tabIDName = document.getElementById("subtab" + sID + "" + idx + "name"); if (tabIDName != null) { g_SubTabTitle = tabIDName.innerText; } swapDisplay(tabIDActive, tabIDSelected); bSetContent = true; updateContentFrame(subtabURL, subtabHeader, subtabFooter); } else { swapDisplay(tabIDSelected, tabIDActive); } } tabSubTab.style.display = "block"; } else { tabSubTab.style.display = "none"; } } } if(!bSetContent) { updateContent( '', '', ''); } } function subtabMiscOn(subtabTitle, subtabURL, subtabHeader, subtabFooter, bKeep) { tabOn("0"); subtabOn("0", "0"); var tabSubTab = document.getElementById("subMisc"); var tabSubTabTitle = document.getElementById("subMiscTitle"); if (tabSubTab != null && subtabTitle != null) { var g_subTabTitle = subtabTitle; tabSubTabTitle.innerHTML = subtabTitle; tabSubTab.style.display = "block"; updateContentFrame(subtabURL, subtabHeader, subtabFooter); } } function tabRefresh() { subtabOn(g_TabNo, g_SubTabNo, g_SubTabURL, g_SubTabHeader, g_SubTabFooter); } function subtabMiscOff() { var tabSubTab = document.getElementById("subMisc"); if (tabSubTab != null) { tabSubTab.style.display = "none"; } } function resetFrame() { if (parent != null) { if (parent._form == "Event") { parent.tabRefresh(); } else { if (parent._form == "Welcome") { parent.initWelcome(); } } } } function showForm(sName, uniqueId, sAction) { if(sAction == 'read' || sAction == 'reload') { updateContentFrame( _db_path + "/0/" + uniqueId + "?OpenDocument&eventUNID=" + _event_unid, "" , ""); } else if(sAction == 'create') { if (uniqueId.length > 0) { updateContentFrame( _db_path + "/" + sName + "?OpenForm&eventUNID=" + _event_unid + "&parentUNID=" + uniqueId, "", ""); } else { updateContentFrame( _db_path + "/" + sName + "?OpenForm&eventUNID=" + _event_unid + "&parentUNID=" + _event_unid, "", ""); } } else if(sAction == 'closenew') { updateContentFrame( _db_path + "/" + sName + "?ReadForm&eventUNID=" + _event_unid + "&action=1", "", ""); } else if(sAction == 'searchresults') { updateContentFrame( _db_path + "/" + sName + "?SearchView&query=" + uniqueId + "&eventUNID=" + _event_unid + "&count=0", "", ""); } } function showDiscussion(uniqueId, sAction) { showForm("discussionmain", uniqueId, sAction); } function showDiscussionResponse(uniqueId, sAction) { showForm("discussionresponse", uniqueId, sAction); } function showDiscussionView(uniqueId, sAction) { showForm("discussionmainview", uniqueId, sAction); } function showDiscussionSearch(uniqueId, sAction) { showForm("discussionsearch", uniqueId, sAction); } function showDiscussionSearchResults(uniqueId, sQuery) { showForm("sealldiscussions", uniqueId, sQuery); } function showMember(uniqueId, sAction) { showForm("member", uniqueId, sAction); } function showPreQuestion(uniqueId, sAction) { subtabMiscOn("Pre-Event Question", _db_path + "/0/" + uniqueId + "?OpenDocument&eventUNID=" + _event_unid, "" , ""); } function showTopic() { subtabMiscOn("Topic Proposal", _db_path + "/topicproposal?OpenForm&eventUNID=" + _event_unid, "" , ""); } function showBackground(uniqueId, sAction) { subtabMiscOn("Event Information", _db_path + '/webAllBackgroundTextByRef/' + uniqueId + 'Event?OpenDocument&action=1&eventUnid=' + uniqueId + '&' + rnd(), "" , ""); } function displayNoDocumentsMsg() { var oTmp; var collH2 = document.body.getElementsByTagName("H2"); if (collH2 != null) { for(i = 0; i < collH2.length; i++) { oTmp = collH2[i].childNodes[0]; if(oTmp.hasChildNodes()) { oTmp = oTmp.childNodes[0]; } if(oTmp.nodeValue == "No documents found") { var oID = document.getElementById('documentNone'); var oDocList = document.getElementById('documentList'); if (oID != null) { if (oDocList != null) { oDocList.style.display = 'none'; } oTmp.parentNode.style.display = 'none'; oID.style.display = 'block'; } } } } } function loadEvent(uniqueId) { if (parent != null) { parent.window.location = _db_path + '/0/' + uniqueId + '?OpenDocument'; } else { window.location = _db_path + '/0/' + uniqueId + '?OpenDocument'; } } function loadEventInfoFrame(docUNID, sAction) { var sURL; if (docUNID == "" && sAction == "") { return; } else { if (sAction == 'read') { sURL = _db_path + '/0/' + docUNID + '?OpenDocument&eventUnid=' + _event_unid + '&' + rnd(); } else if (sAction == 'readprop') { sURL = _db_path + '/0/' + docUNID + '?OpenDocument&eventUnid=' + _event_unid + '&' + rnd(); } else if (sAction == 'close') { sURL = ''; } else if (sAction == 'newtopicproposal') { sURL = _db_path + '/topicproposal?OpenForm&eventUnid=' + _event_unid + '&action=1&' + rnd(); } else if (sAction == 'background') { if (_form = 'Welcome') { sURL = _db_path + '/webAllBackgroundTextByRef/' + docUNID + 'Event?OpenDocument&action=1&defaultpalette=1&' + rnd(); } else { sURL = _db_path + '/webAllBackgroundTextByRef/' + docUNID + 'Event?OpenDocument&action=1&eventUnid=' + _event_unid + '&' + rnd(); } } else if (sAction == 'url' ) { sURL = docUNID; } else { sURL = _db_path + '/0/' + docUNID + '?OpenDocumenteventUnid=' + _event_unid + '&' + rnd(); } var oFrame; if (parent._form != "Event") { //oFrame = document.getElementById('eventInfoFrame'); oFrame = frames['eventInfoFrame']; if (oFrame != null) { //oFrame.src = sURL; oFrame.location.href = sURL; } } else { updateContentFrame(sURL, '', ''); } } } function loadRegistrationForm() { var frm; var eventList = null; if (_form == "Welcome") { eventList = parent.document.forms[0].registerEvent; frm = parent.document.forms[0]; } else { if (frames[_forthevents_frame_id] != null) { eventList = frames[_forthevents_frame_id].document.forms[0].registerEvent; frm = frames[_forthevents_frame_id].document.forms[0]; } else { return; } } if (eventList != null) { if (!checkCheckbox( frm, "registerEvent")) { alert('Please ensure you select at least one event before you register.'); } else { var eventArray = new Array(); var eventArrayIndex = 0; var docString = ""; for(i = 0; i < eventList.length; i++) { if(eventList[i].checked) { eventArray[eventArrayIndex] = eventList[i].value; eventArrayIndex++; } } if ( _form == 'Event' ) { subtabMiscOn("Registration", _db_path + '/Registration?OpenForm&action=1&eventUNID=' + _event_unid + '&' + rnd(), "" , ""); } else { loadEventInfoFrame( _db_path + '/Registration?OpenForm&action=1&' + rnd(), 'url'); } } } } function showFeedback(uniqueId, sAction) { showForm("feedback", uniqueId, sAction); } function loadFeedbackForm(sTitle) { if ( _form == "Event") { subtabMiscOn(sTitle, _db_path + '/feedback?openform&parentUnid=' + _doc_unid + '&eventUnid=' + _event_unid, '', ''); } } function writeDiscussionResponseHTML(unid, fieldArray) { document.writeln('