/** * Popup a new window for operatearea input. * @param popupUrl The url of popupUrl jsp file (since webRoot may varies) */ function popupOperateArea(popupUrl) { openBrWindow(popupUrl, '', 'width=700,height=250,left=200,top=150'); } /** * Popup a new window for operatearea input. * @param popupUrl The url of popupUrl jsp file (since webRoot may varies) */ function popupOperateArea2(popupUrl) { openBrWindow(popupUrl, '', 'width=700,height=400,left=200,top=150'); } /** * Popup a new window for operatearea input. * @param popupUrl The url of popupUrl jsp file (since webRoot may varies) */ function popupOperateArea3(popupUrl) { openBrWindow(popupUrl, '', 'width=610,height=500,left=200,top=150,status=yes'); } function popupSelfArea(popupUrl) { openBrWindow(popupUrl, '_self'); } /** * Popup a new window for operatearea input. * @param popupUrl The url of popupUrl jsp file (since webRoot may varies) */ function popupOperateArea4(popupUrl) { openBrWindow(popupUrl, '', 'width=650,height=410,left=200,top=150'); } /** * Popup a new window for operatearea input. * @param popupUrl The url of popupUrl jsp file (since webRoot may varies) */ function popupOperateArea5(popupUrl) { openBrWindow(popupUrl, '', 'width=700,height=500,left=200,top=150'); } /** * Popup a new window for textarea input. * @param inputId The Id of the textarea element in the parent window * @param action Should be either "edit" or "view" * @param popupUrl The url of popupTextArea.jsp (since webRoot may varies) */ function popupTextArea(inputId, action, popupUrl) { // newWin = openBrWindow(popupUrl+'?inputId='+inputId+'&action='+action, '', 'width=200,height=100,left=400,top=350'); openBrWindow(popupUrl+'?inputId='+inputId+'&action='+action, '', 'width=200,height=100,left=400,top=350'); } /** * Get the inner text of specified element. */ function getInnerText(inputId) { return document.getElementById(inputId).innerText; } /** * Set the inner text of specified element. */ function setInnerText(inputId, value) { document.getElementById(inputId).innerText = value; } /** * Get the defined selected checkboxes number * @param selectElementArray the checkbox array */ function getSelectedNum (selectElementArray) { var total = 0; if (selectElementArray != null) { var max = selectElementArray.length; if (max==null) { if (selectElementArray.checked == true) total = 1; } if (max > 1) { for (var index = 0; index < max; index++) if (selectElementArray[index].checked == true) total += 1; } else { if (selectElementArray.checked == true) total = 1; } } return total; } /** * Chang all the selection's status by changing first checkbox's status */ function changeSelect (element, selectName) { if (element.checked) { selectAllSelection (eval ("element.form." + selectName)); } else { clearAllSelection (eval ("element.form." + selectName)); } } /** * Chang all the selection's status by clicking the image */ function changeSelect2(element, selectName) { if (element.value=="true") { selectAllSelection (eval ("element.form." + selectName)); element.value = "false"; } else { clearAllSelection (eval ("element.form." + selectName)); element.value = "true"; } } /** * Clear all the selection for the given selection name * @param selectElementArray */ function clearAllSelection (selectElementArray) { if (selectElementArray != null) { var numberOfChoice = selectElementArray.length; if (numberOfChoice==null) selectElementArray.checked = false; if (numberOfChoice > 1) for (var index = 0; index < numberOfChoice; index++) if (selectElementArray[index].checked == true) selectElementArray[index].checked=false else selectElementArray.checked = false; } } /** * Clear the first selection for the given selection name * @param selectElementArray */ function clearFirstSelection (selectElementArray) { if (selectElementArray != null) { var numberOfChoice = selectElementArray.length; if (numberOfChoice==null) selectElementArray.checked = false; if (numberOfChoice > 1) for (var index = 0; index < numberOfChoice; index++) if (selectElementArray[index].checked == true) { selectElementArray[index].checked=false; break; } else selectElementArray.checked = false; } } /** * Select all the selection for the given selection name * @param selectElementArray */ function selectAllSelection (selectElementArray) { if (selectElementArray != null) { var numberOfChoice = selectElementArray.length; if (numberOfChoice==null) selectElementArray.checked = true; if (numberOfChoice > 1) for (var index = 0; index < numberOfChoice; index++) if (selectElementArray[index].checked == false) selectElementArray[index].checked=true else selectElementArray.checked = true; } } /** * Get the first selected checkboxes value * @param selectElementArray the checkbox array */ function getFirstSelectedValue(selectElementArray) { if (selectElementArray != null) { var max = selectElementArray.length; // the selectElementArray is not a array, only a select object if (max==null) { if (selectElementArray.checked == true) { return selectElementArray.value; } } for (var index = 0; index < max; index++) { if (selectElementArray[index].checked == true) { return selectElementArray[index].value; } } } return null; } /** * Get the first selected checkboxes value * @param selectElementArray the checkbox array */ function getAllSelectedValue (selectElementArray) { var array = new Array (); if (selectElementArray != null) { var max = selectElementArray.length; // the selectElementArray is not a array, only a select object if (max==null) { if (selectElementArray.checked == true) { arraypush (array, selectElementArray.value); return array; } } for (var index=0; index=0;i--) { var option = select.options[i]; select.removeChild(option); } } /** * Get the specified select element value. */ function getSelectedValue(select) { if (null==select.options) return null; for (i=0;i=0;j--) { // if the form contains the element, remove it if (form.contains(elements[j])) { form.removeChild(elements[j]); } } } // append the new elements from inner iframes for (i=0;i