// Set global variables var hideDDTimer_polls = false; var hideDDTimer_activity = false; var hideDDTimer_groupSettings = false; var totCheckboxes = 0; var cursorPosX = 0; var cursorPosY = 0; var moveObject = false; var moveObjectId = ''; var baseUrl = 'http://www.kommeralla.se/'; /** * Make sure that a given participant has a correct email and that both the name and the email is given * @return boolean participantOk is true if everything is ok, otherwise false */ function checkParticipantInfo() { if (DHTMLObj("participantName").value != "" && DHTMLObj("participantEmail").value != "") { alert('true'); return true; } else { alert('false'); return false; } } /** * Returns an instance of an object that is cross browser compatible * @param object object is the object to use */ function DHTMLObj(object) { if (document.all) { // Explorer 4,5 return document.all[object]; } else if (document.getElementById) { // Netscape 6 return document.getElementById(object); } else if (document.layers) { // ?vriga l?sare document[object].open(); return document[object]; } } /** * An empty function that doesn't do anything. * Used to enable the use of "dead" links. */ function doNothing() { } /** * Get vertical scroll position * @return int value of the vertical scrolled offset */ function getScrollOffset() { var b = document.body; var d = document.documentElement; if (b && b.scrollTop) return body.scrollTop; if (d && d.scrollTop) return d.scrollTop; if (window.pageYOffset) return window.pageYOffset; return 0; } /** * Hide a given drop down menu if the hideDropDown timer is set to true * @param string objId is the dhtml id of the drop down to hide */ function hideDDMenu(objId) { if (objId == "div_dd_polls" && hideDDTimer_polls != false) { hideDDTimer_polls = false; DHTMLObj(objId).style.display = 'none'; } else if (objId == "div_dd_activity" && hideDDTimer_activity != false) { hideDDTimer_activity = false; DHTMLObj(objId).style.display = 'none'; } else if (objId == "div_dd_groupSettings" && hideDDTimer_groupSettings != false) { hideDDTimer_settings = false; DHTMLObj(objId).style.display = 'none'; } } /** * Opens a new window without menubar etc. * @param string openPage is the URL to the page to be opened * @param int w sets the width of the opened page * @param int h sets the height of the opened page */ function newWin (openPage, w, h) { var centerScreen = Math.floor((screen.width / 2) - (w/2)); var properties="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no"; properties+=",width=" + w + ",height=" + h + ",top=15,left=" +centerScreen; unik=new Date(); unik=unik.getSeconds()+"_"+unik.getMinutes()+"_"+unik.getHours(); window.open(openPage, unik, properties); } /** * Open a given drop down menu and stop the hideDropDown timer * @param string objId is the dhtml id of the drop down to open */ function openDDMenu(objId) { if (objId == "div_dd_polls") { hideDDTimer_polls = false; strActivityStyle = 'none'; strGroupStyle = 'none'; strMembersStyle = 'block'; } else if (objId == "div_dd_activity") { hideDDTimer_activity = false; strActivityStyle = 'block'; strGroupStyle = 'none'; strMembersStyle = 'none'; } else if (objId == "div_dd_groupSettings") { hideDDTimer_groupSettings = false; strActivityStyle = 'none'; strGroupStyle = 'block'; strMembersStyle = 'none'; } if (DHTMLObj("div_dd_activity")) { DHTMLObj("div_dd_activity").style.display = strActivityStyle; } if(DHTMLObj("div_dd_groupSettings")) { DHTMLObj("div_dd_groupSettings").style.display = strGroupStyle; } if (DHTMLObj("div_dd_polls")) { DHTMLObj("div_dd_polls").style.display = strMembersStyle; } } /** * Select/Unselect all checkboxes with the given id contantinated with a counter 0 to the global variable totCheckboxes * @param string objId is the id of the checkboxes to select/unselect */ function selectAll(objId) { if (DHTMLObj('chk_select_all') && DHTMLObj('chk_select_all').checked) { bolChecked = true; } else { bolChecked = false; } for (i=0; i