var xcNode = []; var prevRow; var prevRowBgColor; var dom = (document.getElementsByTagName) ? true : false; var ie5 = (document.getElementsByTagName && document.all) ? true : false; var arrowUp, arrowDown; var objWin; var objWinNew1; var isEmptyItemRemoved=true; var APPLICATION_NAME; var isEmptyTransferItemRemoved=true; var isPageExist = false; var fileUploadManager=false; var optionsCount = 0; var arrTranslatedText = []; var arrSelectableRow = []; var arrSelectableId = []; var arrRadioChecked = []; var arrDateRangeValue = []; var arrStartDateRange = []; var arrEndDateRange = []; var subMenuVisibleId = null; var mainMenuVisibleId; var context = null; var tableIds =""; var fileUploadNullStatus = null; var eventHandler ; var isParent= true; var recursehighLightParentIfNeeded=false; var selRowForhighLightParentIfNeeded = null; var mainMenuX = 0; var mainMenuY = 0; var menuWidth = 0; var NS4 = (document.layers) ? true : false; var IE4 = (document.all) ? true : false; var XScale= 1024; var YScale = 768; var MIN_HEIGHT = 60; var EDITABLE_CELL_ID_VAL_DELIMITER="~"; var EDITABLE_CELL_CELL_DELIMITER="&"; var transferBoxSplParent; //var loginNothappened=true; var transferBoxParent; var transferBoxChild1; var transferBoxChild2; document.onclick = getMouseClickTarget; document.oncontextmenu=suppressRightClick; document.onkeydown = getKeyDownTarget; document.onfocusin =focusModalSecondary; document.onfocusin =focusModal; window.onbeforeunload = unloadPage; document.onmousedown = storeEventSource; function justADelay() { var i=0; } function resizeContentFrame() { /* if(loginNothappened == true && APPLICATION_NAME != "ExceedPortalServer") { window.location.href= context + "/system/logout.jsp?LOGOUT_REASON=User Not Logged In"; }*/ setTimeout('justADelay()',500); var height = document.body.clientHeight - 24; var width = document.body.clientWidth; var div = document.getElementById('breadcrumbdiv'); if (div != null) { var currentWidth = parseInt(div.style.width); var currentHeight = parseInt(div.style.height); if (currentWidth != width && width > 10) { div.style.width = width - 10; } if (currentHeight != height && height > 10) { // ???? ???? // div.style.height = height - 10; div.style.height = height + 10; } } } function reloadParentPage() { window.opener.location.reload(true); window.close(); } function showAllocateMessage(url, customerOrder, key, value) { url = context + "/task/wms/customerorder/allocateCustomerOrder.jsp?" + "CUSTOMER_ORDER=" + value + "&Key=" + key; window.open(url, null,"height=100, width=300, status=no,toolbar=no,menubar=no,location=no,directories=no,resizable =no,scrollbars=no,titlebar=no"); } function openWindow(url, categoryName, key, value) { window.open(url + "?Key=" + key, null, ""); } function removeTaskRecord(url, categoryName, key, value) { var returnVal = displayMessage("confirmdelete:" + categoryName + ":" + value, 2); if (returnVal == "No"){ return; } var href = url + "?Key=" + key + "&taskType=4&CategoryName=" + categoryName + "&Name=" + name; location.href = href; } function bcoReset (form) { var elements=form.elements; var maxLength=elements.length; var iIndex=0; var elementType; //var selCategory = form.CATEGORY_NAME.value; form.reset (); for(iIndex=0;iIndex tmpSelectObj.item(i+1).text ) { //alert ("I = "+i + "\n Text Compare = " + tmpSelectObj.item(i).text + ":" +tmpSelectObj.item(i+1).text) var tmpTxt, tmpVal tmpTxt = tmpSelectObj.item(i+1).text tmpVal = tmpSelectObj.item(i+1).value tmpSelectObj.item(i+1).text = tmpSelectObj.item(i).text tmpSelectObj.item(i+1).value = tmpSelectObj.item(i).value tmpSelectObj.item(i).text = tmpTxt tmpSelectObj.item(i).value = tmpVal } } } selectObj = tmpSelectObj } */ } function submitTask(taskForm) { taskForm.submit(); } function cancelTask() { window.close(); } function addIcon(id, imageName, script) { var elem = document.getElementById(id); //elem.insertBefore(); var img = document.createElement('img'); img.setAttribute("src", imageDirectory + "/" + imageName); img.setAttribute("onClick", script); elem.parentElement.appendChild(img); } function displayDateRanges(dropDownId, fromId, toId) { var elem = document.getElementById(dropDownId); var fromElem = document.getElementById(fromId); var toElem = document.getElementById(toId); var index = elem.selectedIndex; if (index == 0) { fromElem.value = ""; toElem.value = ""; } else { fromElem.value = arrStartDateRange[index - 1]; toElem.value = arrEndDateRange[index - 1]; } } function addDateRanges(startDate, endDate) { arrStartDateRange[arrStartDateRange.length] = startDate; arrEndDateRange[arrEndDateRange.length] = endDate; } //praky function changeDeepestIconToBullet(datatableid , columnNo) { var tableId = datatableid.substring(4); hideAllImages(tableId); //alert('changeDeepestIconToBullet'); var dataTable = document.getElementById(datatableid); var tableRows = dataTable.rows; var nonLeaf; var leaf; for(var i=0;i=tableRows.length) { //If only one row exists make the icon a bullet. if(i==1) { if(targetCell.hasChildNodes()) { var existingSrc =targetCell.childNodes(0).childNodes(0).src; if(existingSrc.indexOf('plus_loadondemand') == -1) { targetCell.childNodes(0).childNodes(0).src = i2uiImageDirectory+"/bullet.gif"; //praky // alert('targetCell.childNodes(0).childNodes(0).style.pixelLeft ' +targetCell.childNodes(0).childNodes(0).style.pixelLeft); // targetCell.childNodes(0).childNodes(0).style.marginLeft=targetCell.childNodes(0).childNodes(0).style.marginLeft+1; // alert('!!!!targetCell.childNodes(0).childNodes(0).style.pixelLeft ' +targetCell.childNodes(0).childNodes(0).style.pixelLeft); }//if(existingSrc.indexOf('plus_loadondemand') == -1) { }// if(targetCell.hasChildNodes()) { }// if(i==1) { else { var cell1 = tableRows(i-1).cells; var cell2=tableRows(i-2).cells; if(cell1[columnNo].getAttribute('depth') == cell2[columnNo].getAttribute('depth')) { targetCell.childNodes(0).childNodes(0).src = i2uiImageDirectory+"/bullet.gif"; //praky // alert('targetCell.childNodes(0).childNodes(0).style.pixelLeft ' +targetCell.childNodes(0).childNodes(0).style.pixelLeft); // targetCell.childNodes(0).childNodes(0).style.marginLeft=targetCell.childNodes(0).childNodes(0).style.marginLeft+1; // alert('!!!!targetCell.childNodes(0).childNodes(0).style.pixelLeft ' +targetCell.childNodes(0).childNodes(0).style.pixelLeft); } //if(cell1[columnNo].getAttribute('depth') == cell2[columnNo].getAttribute('depth')) { if(i == tableRows.length) { targetCell.childNodes(0).childNodes(0).src = i2uiImageDirectory+"/bullet.gif"; // targetCell.childNodes(0).childNodes(0).style.marginLeft=targetCell.childNodes(0).childNodes(0).style.marginLeft+1; } }// else { break; }// if(i>=tableRows.length) { var row1 = tableRows(i); var cells1 = row1.cells; var targetCell1 = cells1[columnNo]; var depth1 = targetCell1.getAttribute("depth"); if(depth1 <= depth) { //prakynew1 if(depth1 != 0) { nonLeaf = true; } else { leaf=true; } if(leaf == true) { if(targetCell.hasChildNodes()) { var existingSrc =targetCell.childNodes(0).childNodes(0).src; if(existingSrc.indexOf('plus_loadondemand') == -1) { targetCell.childNodes(0).childNodes(0).src = i2uiImageDirectory+"/bullet.gif"; //praky // alert('targetCell.childNodes(0).childNodes(0).style.marginLeft ' +targetCell.childNodes(0).childNodes(0).style.marginLeft); // targetCell.childNodes(0).childNodes(0).style.marginLeft=targetCell.childNodes(0).childNodes(0).style.marginLeft+1; // alert('!!!!targetCell.childNodes(0).childNodes(0).style.marginLeft ' +targetCell.childNodes(0).childNodes(0).style.marginLeft); }// if(existingSrc.indexOf('plus_loadondemand') == -1) { }// if(targetCell.hasChildNodes()) { }// if(leaf == true) { }// if(depth1 <= depth) { else { leaf = true; if(i==(tableRows.length-1)) { if(targetCell.hasChildNodes()) { var existingSrc =targetCell1.childNodes(0).childNodes(0).src; if(existingSrc.indexOf('plus_loadondemand') == -1) { targetCell1.childNodes(0).childNodes(0).src = i2uiImageDirectory+"/bullet.gif"; // alert('targetCell1.childNodes(0).childNodes(0).style.pixelLeft ' +targetCell1.childNodes(0).childNodes(0).style.pixelLeft); // targetCell.childNodes(0).childNodes(0).style.marginLeft=targetCell.childNodes(0).childNodes(0).style.marginLeft+1; // alert('!!!!targetCell1.childNodes(0).childNodes(0).style.pixelLeft ' +targetCell1.childNodes(0).childNodes(0).style.pixelLeft); } } } } --i; } eval(jsAdjustFunctionFromTable); changeTableRowColoringForTree(tableRows,columnNo); } //praky function changeTableRowColoringForTree(tableRows,columnNo) { for(var i=0;i 0) { var control = td.children(0); if(control.type =="radio" ) { var table=owningrow.parentNode; var rows=table.rows; var rowLen =rows.length; for(var j=0;j 0) { innercontrol = innerchildren(0); if(innercontrol.tagName=="A") { imgsrc = innercontrol.children(0).src; if(imgsrc != null && imgsrc.indexOf("bullet") !=-1) { style="tableRow0" break; } } }//if (innerchildren.length > 0) { }//for(var m =0;m 0) { //praky:added owningrow.className = "rowHighlight"; }//if(owningrow.className != "rowHighlight" ) { else { owningrow.className = "tableRow0"; if (td.children.length > 0) { var control = td.children(0); if(control.type =="radio" || control.type =="checkbox") { control.checked=false; } } } if(td.children.length >0) { var control = td.children(0); if(control.type == "checkbox") { control.fireEvent("onclick"); } } } function reloadPages() { var contentPageUrl = null; /* if(window != null && window.top != null) { try { contentPageUrl = window.top.getCookieByName("CONTENT_PAGE_URL"); } catch(e) {} } */ contentPageUrl = window.top.getCookieByName("CONTENT_PAGE_URL"); return contentPageUrl; return null; } function refreshPage(url) { alert("refreshPage(url):"+url); window.top.setCookies("CONTENT_PAGE_URL", url); window.top.location.href = context + "/system/menu.do"; } /** this function stores the dateranges in an array */ function addDateRange(dateRangeValue){ arrDateRangeValue[arrDateRangeValue.length] = dateRangeValue; } function multipleSelect(listId, hiddenId) { var arrSelected = document.getElementById(listId).options; var selectedValues = ""; for (var i = 0; i < arrSelected.length; i++) { if (arrSelected[i].selected) { selectedValues = selectedValues + '%' + arrSelected[i].value; } } document.getElementById(hiddenId).value = selectedValues; } function selectDate(selectedDate, fieldId, functioncall){ var dateField = document.getElementById(fieldId); var dateFieldElements = dateField.options; for (i = 0; i < dateFieldElements.length; i++) { if(dateFieldElements[i] == dateField) { dateField.options[i].selected = true; functioncall; break; } } } function toggleNavPad() { var solutionsPadImg = null; var solutionsPad = document.getElementById('PAD_main app'); if (solutionsPad != null) { solutionsPadImg = solutionsPad.getElementsByTagName("IMG"); } if (solutionsPadImg != null) { i2uiToggleContent(solutionsPadImg[0],1,'i2uiTilePads()') solutionsPad.width = "163px"; } } function checkFrames(url) { if (window.opener == null) { if (window == top) { if (url == null || url == "null") { location.href = context + "/system/home.jsp?URL=" + window.location; } else { location.href = context + "/system/home.jsp?URL=" + url; } } else { var contentPageUrl = reloadPages(); if (contentPageUrl != null) { window.top.content.location.href = context + contentPageUrl; expireCookie("CONTENT_PAGE_URL"); } } } i2uiSetBreadcrumbsWidth(); } function expireCookie(name) { date = new Date(); newDate = new Date(date.getYear() - 1, date.getMonth(), date.getDate()); document.cookie = name + "=" + window.top.getCookieByName(name) + ";expires=" + new Date(date.getYear() - 1, date.getMonth(), date.getDate()).toGMTString(); } function checkParent() { if (window.opener != null) { if (window.opener != top) { window.opener.top.location.href = context + "/system/logout.jsp" } window.close(); } } function checkLogout(form, value, reason, username) { var value = "" + value; if (value != 'null') { /* form.submit(); */ if(parent != null) { top.parent.location.href =encodeURL(context + "/system/login.jsp"); } else { form.submit(); } } else { if (window != top) { if(parent != null) { top.location.href =encodeURL(context + "/system/logout?LOGOUT_REASON=" + reason + "&j_username=" + username); } else { top.parent.location.href =encodeURL(context + "/system/logout?LOGOUT_REASON=" + reason + "&j_username=" + username); } } else { location.href = encodeURL(context + "/system/logout?LOGOUT_REASON=" + reason + "&j_username=" + username); } } } function truncateTable(dynTable,width,height,widthForJSAdjust,basicWidthIndex,isContainerParent) { var oChild=document.getElementById(dynTable + 'div'); adjustAsPerResolution(dynTable,width,height,widthForJSAdjust,basicWidthIndex,isContainerParent); oChild.style.overflow="hidden"; /* var oChild=document.getElementById(dynTable); var noframeWidth; var frameWidth; var snoframeWidth; var sframeWidth; var containerAdjustment; var isTableAdjusted=false; if(isContainer) { containerAdjustment=20; } else { containerAdjustment=0; } if(screen.width==1024) { noframeWidth=978 - containerAdjustment; snoframeWidth=978-16 - containerAdjustment; frameWidth=811- containerAdjustment; sframeWidth=811-16- containerAdjustment; if(oChild.scrollWidth>1000) { oChild.style.overflow="hidden"; isTableAdjusted = true; } } else //1152 { noframeWidth=1106- containerAdjustment; frameWidth=938- containerAdjustment; snoframeWidth=1106-16- containerAdjustment; sframeWidth=938-16- containerAdjustment; if(oChild.scrollWidth>1130) { oChild.style.overflow="hidden"; isTableAdjusted=true; } } if(top.window.menu != null) { if (top.window.menu != null) { if(top.window.menu.style.display=="none" && isTableAdjusted) { if (document.body.clientHeight < document.body.scrollHeight) //scroll bar present { oChild.style.width=snoframeWidth; } else { oChild.style.width=noframeWidth } } else if( isTableAdjusted) { if (document.body.clientHeight < document.body.scrollHeight) //scroll bar present { oChild.style.width=sframeWidth; } else { oChild.style.width=frameWidth; } } oChild.style.width=oChild.parentNode.parentNode.parentNode.parentNode.rows(0).clientWidth; setTimeout("truncateTable('"+ dynTable +"'," + isContainer + ")",1000); } } */ } function resizeTable(dynTable,isContainer) { var oChild=document.getElementById(dynTable); var noframeWidth; var frameWidth; var snoframeWidth; var sframeWidth; var containerAdjustment; var isTableAdjusted=false; if(isContainer) { containerAdjustment=20; } else { containerAdjustment=0; } if(screen.width==1024) { noframeWidth=978 - containerAdjustment; snoframeWidth=978-16 - containerAdjustment; frameWidth=811- containerAdjustment; sframeWidth=811-16- containerAdjustment; if(oChild.scrollWidth>1000) { oChild.style.overflow="scroll"; isTableAdjusted = true; } else { oChild.style.overflow="auto"; } } else //1152 { noframeWidth=1106- containerAdjustment; frameWidth=938- containerAdjustment; snoframeWidth=1106-16- containerAdjustment; sframeWidth=938-16- containerAdjustment; if(oChild.scrollWidth>1130) { oChild.style.overflow="scroll"; isTableAdjusted = true; } else { oChild.style.overflow="auto"; } } if(parent.menu.MenuTable.style.display=="none" && isTableAdjusted) { if (document.body.clientHeight < document.body.scrollHeight) //scroll bar present { oChild.style.width=snoframeWidth; } else { oChild.style.width=noframeWidth } } else if( isTableAdjusted ) { if (document.body.clientHeight < document.body.scrollHeight) //scroll bar present { oChild.style.width=sframeWidth; } else { oChild.style.width=frameWidth; } } oChild.style.width=oChild.parentNode.parentNode.parentNode.parentNode.rows(0).clientWidth; setTimeout("resizeTable('"+ dynTable +"'," + isContainer + ")",1000); } function f_kpiCancel(){ window.location.reload(true); } function f_kpiSubmit(){ var selOptions=frmPopup.destination.options; var max=selOptions.length;var strOption=""; for(i=0;i0) { strOption=strOption+frmPopup.destination.options(max-1).value; } frmPopup.activeKpiId.value=strOption; frmPopup.submit(); } function invoke_help() { //popupWindow=open('', 'Help', 'resizable=1,width=400,height=400, scrollbars=1'); //if (popupWindow.opener == null) { // popupWindow.opener = self; //} //popupWindow.location.href='help.jsp'; //showModalDialog("help.jsp"); showModalDialog("help.jsp","","dialogWidth:800px;dialogheight:600px;status:no;unadorned:yes;center:yes;resizable:yes;help:no"); } function invoke_about() { //showModalDialog("about.jsp","","dialogWidth:398px;dialogheight:565px;status:no;unadorned:yes;center:yes;resizable:no;scroll:no;help:no"); window.open("about.jsp", null,"height=565, width=393,status=no,toolbar=no,menubar=no,location=no,directories=no,resizable =no,scrollbars=no,titlebar=no"); } function setRadioButtonSelected (form, value) { var size = form.elements.length; for (var i=0; i < size; i++) { if(form.elements[i].type == "radio" && form.elements[i].value == value ) { form.elements[i].checked = true; break; } } } function submitMonitorForkLift(hiddenKeyValue,url) { myfrm.Keys.value = hiddenKeyValue; myfrm.action = url; } function submitGraphForm() { myfrm.submit(); } function submitViewDetailsForklift (form) { var val = getRadioValue (form); if (val == null) { displayMessage ('pleaseselectazone', 1); return; } if (form.Type.checked == true) form.BALANCEFORKLIFTWORK_TYPE_CHECKED.value = "Yes"; if (form.Priority.checked == true) form.BALANCEFORKLIFTWORK_PRIORITY_CHECKED.value = "Yes"; form.zoneKey.value = val; form.BUTTON_CLICKED.value = "ViewDetails"; form.submit (); } function submitFilterBalanceForklift (form) { if (form.Type.checked == true) form.BALANCEFORKLIFTWORK_TYPE_CHECKED.value = "Yes"; if (form.Priority.checked == true) form.BALANCEFORKLIFTWORK_PRIORITY_CHECKED.value = "Yes"; var val = getRadioValue (form); form.BUTTON_CLICKED.value = "Filter"; form.submit (); } function setContext(urlContext) { context = urlContext; } function reset (form) { var elements=form.elements; var maxLength=elements.length; var iIndex=0; var elementType; var selCategory = form.CATEGORY_NAME.value; form.reset (); for(iIndex=0;iIndex=0; j-- ) { if (passedVal.charAt(j)!=" ") break; } if (i > j) passedVal = ""; else passedVal = passedVal.substring(i, j+1); return(passedVal); } /* function trim (val) { while (val.charAt (0) == " " || val.charAt (val.length - 1) == " ") { if (val.charAt (0) == " ") val = val.substring (1); if (val.charAt (val.length - 1 == " ")) val = val.substring (0, val.length); } return val; } */ function toggleButtonText (changeName, formName) { if (changeName == null) return; var changeNameElem = document.getElementById (changeName); var buttonTxt = getInnerText(changeNameElem); //when the user clicks the button for the first time // capture the button name (translated) and store it in an array if (optionsCount == 0) { setTranslatedText(buttonTxt); } setInnerText (changeNameElem, arrTranslatedText[optionsCount%2]); optionsCount++; } function validate(frm) { var elements=frm.elements; var maxLength=elements.length; var iIndex=0; var elementName; for(iIndex=0;iIndex= 2) { elm = document.getElementById(id); mainMenuX = parseInt(event.clientX); mainMenuY = parseInt(event.clientY) - 32; elm.style.left = mainMenuX; elm.style.top = mainMenuY; elm.style.display = "block"; menuWidth = elm.offsetWidth - 5; mainMenuVisibleId = id; } } } function leftClickMenu(id,x,y,event) { elm = document.getElementById(id); mainMenuX = x; mainMenuY = y; elm.style.left = mainMenuX; elm.style.top = mainMenuY; elm.style.display = "block"; menuWidth = elm.offsetWidth - 5; mainMenuVisibleId = id; } function makeSubMenuVisible(name,i,d) { var x = 0; var y = 0; elem = document.getElementById(name); i = parseInt(i); x = mainMenuX + parseInt(menuWidth) ; y = ((i-1)* 17) + mainMenuY + (d*9) + 4; elem.style.left = x; elem.style.top = y; elem.style.display = "block"; } function makeSubMenuInVisible(name) { if(name != null) { document.getElementById(name).style.display = "none"; } else { } } function hideSubMenuOtherThan(id) { if(subMenuVisibleId != id && subMenuVisibleId != null) { makeSubMenuInVisible(subMenuVisibleId); subMenuVisibleId = null; } } function getMouseClickTarget() { var n = ""; var srcname=""; srcname = srcname + event.srcElement.name; if(srcname == "null") { n=""; } else { if(srcname.length > 3) { n = srcname.substring(0,3); } } if(n != "sub") { makeSubMenuInVisible(mainMenuVisibleId); makeSubMenuInVisible(subMenuVisibleId); mainMenuVisibleId = null; subMenuVisibleId = null; } } function showtip(current,e,text) { current.title=text; } function hidetip() { if (document.layers) document.tooltip.visibility="hidden" } function getKeyDownTarget() { key = event.keyCode; if(key == 27) { makeSubMenuInVisible(mainMenuVisibleId); makeSubMenuInVisible(subMenuVisibleId); mainMenuVisibleId = null; subMenuVisibleId = null; } } function toggleNavigator() { var breadcrumbdiv = document.getElementById('breadcrumbdiv'); var iframe = top.window.document.getElementById('content'); var menu = top.window.document.getElementById('menu'); var toggleImg = document.getElementById ('breadcrumbgif'); if (menu.style.display == "none") { menu.style.display = "inline"; toggleImg.src = imageDirectory + "/button.gif"; //iframe.style.width = "813px"; // breadcrumbdiv.style.width = "812"; } else { menu.style.display = "none"; toggleImg.src = imageDirectory + "/button180.gif"; //iframe.style.width = "980px"; // breadcrumbdiv.style.width = "980"; } } function exeuiShowPopUpDialog(url, height, width){ if (height == null) height = 300; else { //?????? ???? // height = Math.max(300, height); } if (width == null) width = 400; else { //?????? ???? // width = Math.max(400, width); } i2uiMessageBoxRC = null; if (!document.layers){ if (document.all) { // url = url + "?width=" + width; objWin=window.open(url,"help_popup","'height='+height,width=+width,status=no,toolbar=no,menubar=no,location=no,directories=no,resizable =no,scrollbars=no,titlebar=no,top=250,left=325 "); // alert(height+":"+width); objWin.resizeTo(width,height); } else{var screenX = (screen.availWidth - width) / 2;var screenY = (screen.availHeight - height) / 2;var dialogWindow = window.open(url,null,"screenX="+screenX+"px,screenY="+screenY+"px,width="+width+"px,height="+height+"px,modal=yes");} } } function exeuiShowPopUpDialog(url, height, width,name,scroll){ if (height == null) height = 300; else { //?????? ???? // height = Math.max(300, height); } if (width == null) width = 400; else { //?????? ???? // width = Math.max(400, width); } i2uiMessageBoxRC = null; if (!document.layers){ if (document.all) { // url = url + "?width=" + width; objWin=window.open(url,"help_popup","'height='+height,width=+width,status=no,toolbar=no,menubar=no,location=no,directories=no,resizable =no,scrollbars=yes,titlebar=no,top=250,left=325 "); // alert(height+":"+width); objWin.resizeTo(width,height); } else{var screenX = (screen.availWidth - width) / 2;var screenY = (screen.availHeight - height) / 2;var dialogWindow = window.open(url,null,"screenX="+screenX+"px,screenY="+screenY+"px,width="+width+"px,height="+height+"px,modal=yes");} } } /* 2005-07-22 ???? ???? POPUP???? ???? POPUP ???????? ?????? ???????? NAME?? ????. */ function exeuiShowPopUpDialog(url, height, width, name){ if(name == "") { name = null; } if (height == null) height = 300; else { //?????? ???? // height = Math.max(300, height); } if (width == null) width = 400; else { //?????? ???? // width = Math.max(400, width); } i2uiMessageBoxRC = null; if (!document.layers){ if (document.all) { // url = url + "?width=" + width; objWin=window.open(url, name,"'height='+height,width=+width,status=no,toolbar=no,menubar=no,location=no,directories=no,resizable =no,scrollbars=no,titlebar=no,top=250,left=325 "); // alert(height+":"+width); objWin.resizeTo(width,height); } else{var screenX = (screen.availWidth - width) / 2;var screenY = (screen.availHeight - height) / 2;var dialogWindow = window.open(url,null,"screenX="+screenX+"px,screenY="+screenY+"px,width="+width+"px,height="+height+"px,modal=yes");} } } function changeHeight(width) { if (width == null) width = 400; else width = Math.max(400, width); var elem = document.getElementById("popup"); var iHeight = screen.height-100; var hgt = Math.min(iHeight,(elem.scrollHeight + 50)); window.resizeTo(width,hgt); } function expandMsgBox(width, height, boxId) { var elem = document.getElementById(boxId); if (width == null) width = 350; if (height == null) height = 150; else { var scrollHgt = elem.scrollHeight + 50; if (scrollHgt < 150) { height = 150; } else { height = scrollHgt; } } window.dialogHeight = height + 'px'; } function PopupDialogOnCancel() { window.close(); } function exeuiClosePopUpDialog(returnValue){ if (document.all) window.returnValue = returnValue; else opener.i2uiMessageBoxRC = returnValue; window.close(); } function selectRow (e, row, bgColor) { // i2uiHighlightPadItem (row); var r = null; //if input type is radio button, then change the previous row to original color if (e.parentNode && e.parentNode.parentNode) r = e.parentNode.parentNode; else if (e.parentElement && e.parentElement.parentElement) r = e.parentElement.parentElement; if (r) { if (r.className != "rowHighlight") changeBgColor (r, "rowHighlight"); else changeBgColor (r, matchRowClass (row)); } if (e.type == "radio") { if (arrRadioChecked.length != 0) changeBgColor (document.getElementById (arrRadioChecked [0]).parentNode, matchRowClass (arrRadioChecked [0])); arrRadioChecked [0] = row; } } function matchRowClass (row) { for (i=0; i 0) { innercontrol = innerchildren(0); if(innercontrol.tagName=="A") { imgsrc = innercontrol.children(0).src; if(imgsrc != null && imgsrc.indexOf("bullet") !=-1) { style="tableRow0" break; } } } } if(rows(j).className == "rowHighlight") { rows(j).className=style; break; } } selRow.className="rowHighlight"; }// if(control.type=="radio") else { if(control.checked) { var highlightingDone = false; checkTopCheckBox(selRow); selRow.className="rowHighlight"; //Check if table tree exists. //If it exists,make sure all child rows are //also highlighted. var temp = null; try { temp= eval(trId+"var"); } catch (e) { // alert('catch (e)'); temp = null; } if(temp != null) { // alert('if(temp != null) {'); if(smartHighlightValue != null && smartHighlightValue == false) { // alert('retunring'); return; } var cells1 = selRow.cells; var targetNode = cells1[temp]; var parentDepth = targetNode.getAttribute('depth'); var nextRow = selRow.nextSibling.nextSibling; if(nextRow == null) { highLightParentIfNeeded(selRow,temp); /* while(recursehighLightParentIfNeeded == true) { highLightParentIfNeeded(selRowForhighLightParentIfNeeded,temp); } */ return; } var cells2 = nextRow.cells; var targetNode1 = cells2[temp]; var depth2 = targetNode1.getAttribute('depth'); while(depth2 > parentDepth) { nextRow.className="rowHighlight"; var firstCell = cells2[0]; firstCell.firstChild.checked=true; if(nextRow.nextSibling.nextSibling != null) { nextRow = nextRow.nextSibling.nextSibling; cells2 = nextRow.cells; targetNode1 = cells2[temp]; depth2 = targetNode1.getAttribute('depth'); } else {//Even if it the last element we need to check for parent highlighting. highLightParentIfNeeded(selRow,temp); highlightingDone = true; /* while(recursehighLightParentIfNeeded == true) { highLightParentIfNeeded(selRowForhighLightParentIfNeeded,temp); }*/ break; } } //while // alert('out of while'); //praky:added need to check parents if needed. if(highlightingDone == false) { highLightParentIfNeeded(selRow,temp); } /* while(recursehighLightParentIfNeeded == true) { highLightParentIfNeeded(selRowForhighLightParentIfNeeded,temp); }*/ }//if(temp != null) else { } }// if(control.checked) else { var temp = null; try { temp= eval(trId+"var"); } catch (e) { temp = null; } checkTopCheckBox(selRow); var table=selRow.parentNode; var rows=table.rows; var rowLen =rows.length; var dataTableId = selRow.parentNode.id; var dataIndex = dataTableId.indexOf("data"); var tableId = dataTableId.substring(dataIndex + 4); var parentCheckBox = document.getElementsByName(tableId +"checkbox")[1]; //for table if(parentCheckBox != null && parentCheckBox.checked) { parentCheckBox.checked=false; } //for dynamic table if(parentCheckBox == null) { dataIndex = dataTableId.indexOf("dataTable"); tableId = dataTableId.substring(0,dataIndex); parentCheckBox = document.getElementsByName(tableId +"checkbox")[1]; if(parentCheckBox != null && parentCheckBox.checked) { parentCheckBox.checked=false; } } for(var j=0;j parentDepth) { nextRow.className="tableRow0"; var firstCell = cells2[0]; firstCell.firstChild.checked=false; if(nextRow.nextSibling.nextSibling != null) { nextRow = nextRow.nextSibling.nextSibling; cells2 = nextRow.cells; targetNode1 = cells2[temp]; depth2 = targetNode1.getAttribute('depth'); } else { // alert('else {'); break; } } //while //praky:added we need to unhighlight the parent nodes in case they have been checked. /*********************************/ unHighlightParentsIfNeeded(selRow,parentDepth,trId); /*********************************/ //praky :ends changeTableRowColoringForTree(rows,eval(trId+"var")); }//if(temp != null) { checkTopCheckBox(selRow); }// else } checkTopCheckBox(selRow); } function unHighlightParentsIfNeeded(selectedRow,parDepth,trId) { var temp = null; try { temp= eval(trId+"var"); } catch (e) { temp = null; } var selRow = selectedRow; var dataTableId = selRow.parentNode.id; var dataIndex = dataTableId.indexOf("data"); var tableId = dataTableId.substring(dataIndex + 4); var smartHighlightValue = eval("smartHighlightTreecell_"+tableId); if(smartHighlightValue != null && smartHighlightValue == false) { // alert('retunring'); return; } var parentDepth = parDepth; var previousRow; if(selRow !=null && selRow.previousSibling !=null && selRow.previousSibling.previousSibling != null) { previousRow = selRow.previousSibling.previousSibling; } if(previousRow == null) return; var cellsPrev = previousRow.cells; var targetNodePrev = cellsPrev[temp]; var depthPrev = targetNodePrev.getAttribute('depth'); while(previousRow !=null) { if(depthPrev < parentDepth) { // previousRow.className="tableRow0"; var firstCell = cellsPrev[0]; var childs = targetNodePrev.children; var innercontrol = childs(0); if(innercontrol.tagName=="A") { var imgsrc = innercontrol.children(0).src; if(imgsrc != null && imgsrc.indexOf("bullet") !=-1) { } else if(imgsrc.indexOf("bullet") ==-1) { previousRow.className="tableRow0"; firstCell.firstChild.checked=false; } } // firstCell.firstChild.checked=false; // alert('previousRow.previousSibling.previousSibling' + previousRow.previousSibling.previousSibling); //praky:added if (depthPrev == 0) { // alert('breaking'); break; } } if(previousRow.previousSibling !=null && previousRow.previousSibling.previousSibling != null) { previousRow = previousRow.previousSibling.previousSibling; cellsPrev = previousRow.cells; targetNodePrev = cellsPrev[temp]; depthPrev = targetNodePrev.getAttribute('depth'); } else { break; } }//while } function highLightParentIfNeeded(selectedRow,columnID,recurse) { // alert('highLightParentIfNeeded' + 'selectedRow.id:' +selectedRow.id); var parentTableId = selectedRow.parentNode.id; /* alert('parentTableId ' +parentTableId); var smartHighlightValue = eval("smartHighlightTreecell_"+parentTableId); if(smartHighlightValue != null && smartHighlightValue == false) { return; }*/ var recurseRowIdentified = null; if(selectedRow.previousSibling == null || selectedRow.previousSibling.previousSibling == null) { recursehighLightParentIfNeeded = false; return; } //If this is recursive call and the current row that has been //passed is not checked ,jsut go back. // alert('before recurse == true'); if(recurse == true) { // alert('insode recures == true' + selectedRow.id); var parcells = selectedRow.cells; var targetNode = parcells[columnID]; var depth = targetNode.getAttribute('depth'); // alert('depth' + depth + 'selectedRow.id' + selectedRow.id); // alert('parcells[0].firstChild.checked ' + parcells[0].firstChild.checked); if(!(parcells[0].firstChild.checked)) { if(depth > 0 ) { return; } } } var lowerSiblingsChecked = false; var lowerSiblingsExist = true; var selRow = selectedRow; var temp = columnID; var cells1 = selRow.cells; var targetNode = cells1[temp]; var parentDepth = targetNode.getAttribute('depth'); //If this is 0 node,no parents to highlight.So just highlight the row in question and go back. if(parentDepth ==0 ) { var parcells = selRow.cells; var targetNode = parcells[temp]; parcells[0].firstChild.checked = true; selRow.className="rowHighlight"; recursehighLightParentIfNeeded = false; return; } var nextRow= null; if(selRow.nextSibling != null && selRow.nextSibling.nextSibling !=null) { // alert('setting next row'); nextRow = selRow.nextSibling.nextSibling; // alert('nextRow.id : '+nextRow.id) } else {//case where this is the last row in the table lowerSiblingsExist= false; var parentToBeSelected = selRow.previousSibling.previousSibling; var parcells = parentToBeSelected.cells; var targetNode = parcells[temp]; if(targetNode.getAttribute('depth') < parentDepth) { parcells[0].firstChild.checked = true; parentToBeSelected.className="rowHighlight"; // recursehighLightParentIfNeeded = true; // selRowForhighLightParentIfNeeded = parentToBeSelected; // alert('recursing'); recurseRowIdentified = parentToBeSelected; // highLightParentIfNeeded(parentToBeSelected,columnID); // alert('after recursing'); // return; } else { recursehighLightParentIfNeeded = false; return; } } if(nextRow != null) { // alert('nextRow*' + nextRow); var cells2 = nextRow.cells; // alert('after nextRow*' + nextRow); var targetNode1 = cells2[temp]; var siblingDepth = targetNode1.getAttribute('depth'); // alert('siblingDepth = targetNode1.getAttribute(\'depth\')'); while(!(siblingDepth > parentDepth)) { // alert('!(siblingDepth > parentDepth)'); if(siblingDepth < parentDepth) { // lowerSiblingsChecked= true; break; if(nextRow.nextSibling != null && nextRow.nextSibling.nextSibling !=null) { nextRow = nextRow.nextSibling.nextSibling; cells2 = nextRow.cells; targetNode1 = cells2[temp]; siblingDepth = targetNode1.getAttribute('depth'); } else { // alert('returning'); recursehighLightParentIfNeeded = false; return; } }//end of if(siblingDepth < parentDepth) { else { var firstCell = cells2[0]; if(firstCell.firstChild.checked != true) { recursehighLightParentIfNeeded = false; return; } else { lowerSiblingsChecked= true; } if(nextRow.nextSibling != null && nextRow.nextSibling.nextSibling != null) { nextRow = nextRow.nextSibling.nextSibling; // alert('nextRow.nextSibling.nextSibling ' +nextRow.id); cells2 = nextRow.cells; targetNode1 = cells2[temp]; siblingDepth = targetNode1.getAttribute('depth'); } else { break; } }//end of else { }// while(siblingDepth !> parentDepth) { //if all the siblings are checked(otherwise we won't be here).Check the parent and //make a recursive call. if(lowerSiblingsChecked == true) { var parentToBeSelected = selRow.previousSibling.previousSibling; var parcells = parentToBeSelected.cells; if(parcells[temp].getAttribute('depth') < parentDepth) { parcells[0].firstChild.checked = true; parentToBeSelected.className="rowHighlight"; recurseRowIdentified = parentToBeSelected; } else { recurseRowIdentified = null; } // alert('recursice call') ; // recursehighLightParentIfNeeded = true; // selRowForhighLightParentIfNeeded = parentToBeSelected; // alert('recursing2'); // highLightParentIfNeeded(parentToBeSelected,columnID); lowerSiblingsChecked = false; //return; } else { recursehighLightParentIfNeeded = false; // return; } } if(recurseRowIdentified != null) { highLightParentIfNeeded(recurseRowIdentified,columnID,true); } else if(parentDepth >0 ) { highLightParentIfNeeded(selectedRow.previousSibling.previousSibling,columnID,true); } checkTopCheckBox(selectedRow); } function adjustStyle(tableNode) { var highlightedRows; var highlightedRowNumbers=""; var tBody = tableNode.tBodies[0]; var trs = tBody.rows; var trl= trs.length; var tds; var rowStyle; var rowClassName; for (var i = 0; i < trl; i++) { if(i%2 ==0) { rowStyle="tableRow0"; } else { rowStyle="tableRow1"; } rowClassName = trs(i).className; if( rowClassName != rowStyle && rowClassName !="rowHighlight") { trs(i).className = rowStyle; } if(rowClassName =="rowHighlight") { tds=trs(i).cells; if((tds(0).childNodes(0).type=="checkbox" || tds(0).childNodes(0).type=="radio")) { tds(0).childNodes(0).checked=true; } } } } function sortTable(tableNode, nCol, bDesc, sType) { var tBody = tableNode.tBodies[0]; var trs = tBody.rows; var trl= trs.length; var a = new Array(); var sortedRows; var emptyRows; var rigidRows; var totalSortedRows=0; var totalEmptyRows=0; var totalRigidRows=0; for (var i = 0; i < trl; i++) { a[i] = trs[i]; } var start = new Date; a.sort(compareByColumn(nCol,bDesc,sType)); sortedRows=new Array(a.length); emptyRows=new Array(a.length); rigidRows=new Array(a.length); //split the sorted and empty rows for (var i = 0; i < trl; i++) { if(trim(a[i].cells(nCol).innerText).length!=0) { sortedRows[totalSortedRows]=a[i]; totalSortedRows++; } else { if(a[i].cells(nCol).innerHTML.indexOf("srch_actv.gif") != -1 || a[i].innerHTML.indexOf("srch_inactv.gif") != -1) { rigidRows[totalRigidRows]=a[i]; totalRigidRows++; } else { emptyRows[totalEmptyRows]=a[i]; totalEmptyRows++; } } } //add the rigid rows for (var i = 0; i < totalRigidRows; i++) { tBody.appendChild(rigidRows[i]); } //add the sorted rows for (var i = 0; i < totalSortedRows; i++) { tBody.appendChild(sortedRows[i]); } //add the empty rows for (var i = 0; i < totalEmptyRows; i++) { tBody.appendChild(emptyRows[i]); } // check for onsort if (typeof tableNode.onsort == "string") tableNode.onsort = new Function("", tableNode.onsort); if (typeof tableNode.onsort == "function") tableNode.onsort(); } function compareByColumn(nCol, bDescending, sType) { var c = nCol; var d = bDescending; var fTypeCast = String; if (sType == "Number") fTypeCast = toNumber; else if (sType == "Date") fTypeCast = parseDate; else if (sType == "CaseInsensitiveString") fTypeCast = CaseInsensitiveString; return function (n1, n2) { if (fTypeCast(getInnerText(n1.cells[c])) < fTypeCast(getInnerText(n2.cells[c]))) return d ? -1 : +1; if (fTypeCast(getInnerText(n1.cells[c])) > fTypeCast(getInnerText(n2.cells[c]))) return d ? +1 : -1; return 0; }; } function getInnerText(el) { if (ie5) return el.innerText; //Not needed but it is faster var str = ""; var cs = el.childNodes; var l = cs.length; for (var i = 0; i < l; i++) { switch (cs[i].nodeType) { case 1: //ELEMENT_NODE str += getInnerText(cs[i]); break; case 3: //TEXT_NODE str += cs[i].nodeValue; break; } } return str; } function setInnerText (el, newText) { var str = ""; el = el.getElementsByTagName ('a'); var cs = el[0].childNodes; var l = cs.length; for (var i = 0; i < l; i++) { switch (cs[i].nodeType) { case 1: //ELEMENT_NODE str += getInnerText(cs[i]); break; case 3: //TEXT_NODE cs[i].nodeValue = newText; break; } } } function CaseInsensitiveString(s) { return String(s).toUpperCase(); } function parseDate(s) { var dateValue = Date.parse(s.replace(/\-/g, '/')); if(!isNaN(dateValue)) { return dateValue; } return 0; } /* alternative to number function * This one is slower but can handle non numerical characters in * the string allow strings like the follow (as well as a lot more) * to be used: * "1,000,000" * "1 000 000" * "100cm" */ function toNumber(s) { return Number(s.replace(/[^0-9\.]/g, "")); } function getParent (el, pTagName) { if (el == null) return null; else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) // Gecko bug, supposed to be uppercase return el; else return getParent(el.parentNode, pTagName); } /* submitForm * This script takes the form name as the parameter and * submits to the appropriate page */ function submitForm(frmName) { document.forms[frmName].submit(); } /* toggleDisplay * This script toogles for the Region tag */ function toggleDisplay(imgObj, imgSrc, idName) { var divObj = document.getElementById(idName+"div"); if(divObj.style.display == "none"){ divObj.style.display="block"; } else { divObj.style.display="none"; } imgObj.src = imgSrc; } /* toggleDisplay * This script hides and shows div for the Region tag */ function hideAndShow(hideID,showID) { var hideObj = document.getElementById(hideID+"div"); var showObj = document.getElementById(showID+"div"); showObj.style.display="block"; hideObj.style.display="none"; } /*Dynamic related functions:- Balaji*/ function moveAllLeft(button) { if(!isEmptyItemRemoved) { removeEmptyItem(); isEmptyItemRemoved=true; } var selOptions=frmPopup.destination.options; var max=selOptions.length; var i,index; for(i=0;i 0) { cells(0).children(0).src=imageDirectory + "/t_double_arrow_right.gif"; } else { cells(0).children(0).src=imageDirectory + "/t_double_arrow_right_disabled.gif"; } if(sourceTBox.selectedIndex != -1) { cells(1).children(0).src=imageDirectory + "/t_single_arrow_right.gif"; } else { cells(1).children(0).src=imageDirectory + "/t_single_arrow_right_disabled.gif"; } } //destination TBox if(destinationTBox != null) { if(destinationTBox.options.length > 0) { cells(4).children(0).src=imageDirectory + "/t_double_arrow_left.gif"; } else { cells(4).children(0).src=imageDirectory + "/t_double_arrow_left_disabled.gif"; } if(destinationTBox.selectedIndex != -1) { cells(3).children(0).src=imageDirectory + "/t_single_arrow_left.gif"; } else { cells(3).children(0).src=imageDirectory + "/t_single_arrow_left_disabled.gif"; } } } /* to move items from right side to left side in configurator */ function moveLeft() { if(!isEmptyItemRemoved) { removeEmptyItem(); isEmptyItemRemoved=true; } var selOptions=frmPopup.destination.options; var j,i; var max=selOptions.length; var index; for(i=0;i0) { strOption=strOption+trim(frmPopup.destination.options(max-1).value); } frmPopup.useroptions.value=strOption; //praky opener.window.status="Page Loading..."; //praky frmPopup.submit(); } /* to close the window*/ function cancelWindow() { window.close(); } var opt; /* to show the description for a selected item*/ function showDescription(opt1) { opt=opt1; setTimeout(showDescriptionImpl,100); } function showDescriptionImpl() { removeEmptyItem(); var updowntable=document.getElementById('updowntable'); var updowncells=updowntable.cells; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; var selectedIndex=-1; var cells,table; table=document.getElementById('buttontable'); cells=table.cells; if(opt=="source") { selectedIndex=frmPopup.source.selectedIndex; if(selectedIndex!=-1) { setTimeout("description.innerHTML=getValue(frmPopup.source.value);",100); } if (selectedIndex!=-1 && trim(frmPopup.source.options(selectedIndex).text).length != 0 && trim(frmPopup.source.options(selectedIndex).value).length != 0) { cells(1).children(0).src=imageDirectory + "/t_single_arrow_right.gif"; } } else { selectedIndex=frmPopup.destination.selectedIndex; if(selectedIndex!=-1) { setTimeout("description.innerHTML=getValue(frmPopup.destination.value);",100); } if (selectedIndex !=-1 && trim(frmPopup.destination.options(selectedIndex).text).length != 0 && trim(frmPopup.destination.options(selectedIndex).value).length != 0) { cells(3).children(0).src=imageDirectory + "/t_single_arrow_left.gif" ; } } adjustUpDownButtons(); } function adjustUpDownButtons() { var updowntable=document.getElementById('updowntable'); var updowncells=updowntable.cells; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; var selectedIndex=frmPopup.destination.selectedIndex; if(selectedIndex!=-1) { if(frmPopup.destination.options.length==1) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; return; } if(selectedIndex==(frmPopup.destination.options.length-1) && selectedIndex>0) { updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; } else if(selectedIndex==0 && frmPopup.destination.options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if(selectedIndex==0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if (frmPopup.destination.options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; } } } function removeEmptyItem() { var elementText; var elementValue; if(frmPopup.destination.options.length>0) { elementText=frmPopup.destination.options(0).text; elementValue =frmPopup.destination.options(0).value; if(trim(elementText).length==0 && trim(elementValue).length==0) { frmPopup.destination.remove(0); isEmptyItemRemoved=true; } } if(frmPopup.source.options.length>0) { elementText=frmPopup.source.options(0).text; elementValue =frmPopup.source.options(0).value; if(trim(elementText).length==0 && trim(elementValue).length==0) { frmPopup.source.remove(0); isEmptyItemRemoved=true; } } } function getValue(strValue) { var arrValues; arrValues=strValue.split("@"); strValue=arrValues[0]; if(strValue=="") strValue=" "; return strValue; } /* to initialize the button state*/ function initButtons() { var updowntable=document.getElementById('updowntable'); var updowncells=updowntable.cells; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; var table=document.getElementById('buttontable'); var cells=table.cells; cells(0).children(0).src=imageDirectory + "/t_double_arrow_right_disabled.gif"; cells(1).children(0).src=imageDirectory + "/t_single_arrow_right_disabled.gif" cells(3).children(0).src=imageDirectory + "/t_single_arrow_left_disabled.gif" cells(4).children(0).src=imageDirectory + "/t_double_arrow_left_disabled.gif" removeDuplicates(); var options=frmPopup.destination.options; var max=options.length; var sourceCount=0; //var maxLen=findMaxLenListElements(); var sourceTD = frmPopup.source.parentNode.parentNode; var sourceTDWidth = sourceTD.offsetWidth; var destinationTD = frmPopup.destination.parentNode.parentNode; var destinationTDWidth = destinationTD.offsetWidth; var maxLen= sourceTDWidth ; if (maxLen < destinationTDWidth ) { maxLen = destinationTDWidth ; } var sourceDiv = frmPopup.source.parentNode; var sourceDivWidth = sourceDiv.scrollWidth; var destinationDiv = frmPopup.destination.parentNode; var destinationDivWidth = destinationDiv.scrollWidth; if (maxLen < sourceDivWidth ) { maxLen = sourceDivWidth ; } if (maxLen < destinationDivWidth ) { maxLen = destinationDivWidth ; } //if(maxLen<21) //arrived by trail and error process //{ // maxLen=21; //} if(max>0) { cells(4).children(0).src=imageDirectory + "/t_double_arrow_left.gif" } options=frmPopup.source.options; max=options.length; if(max>0) { cells(0).children(0).src=imageDirectory + "/t_double_arrow_right.gif" } adjustOtherItemsTConfig(frmPopup.destination,maxLen); adjustOtherItemsTConfig(frmPopup.source,maxLen); adjustScrollBar(frmPopup.source,frmPopup.destination); } function adjustScrollBar(source, destination) { var sourceDiv = source.parentNode; var destinationDiv = destination.parentNode; var sourceDivWidth = sourceDiv.scrollWidth; var destinationDivWidth = destinationDiv.scrollWidth; var sourceTD = source.parentNode.parentNode; var sourceTDWidth = sourceTD.offsetWidth; var destinationTD = destination.parentNode.parentNode; var destinationTDWidth = destinationTD.offsetWidth; source.size = 10; if(source.options.length > 10) { sourceDiv.style.height=source.offsetHeight; source.size = frmPopup.source.options.length; } else { sourceDiv.style.height=source.offsetHeight; } destination.size = 10; if(destination.options.length > 10) { destinationDiv.style.height=destination.offsetHeight; destination.size = destination.options.length; } else { destinationDiv.style.height=destination.offsetHeight; } if (sourceDivWidth > sourceTDWidth) { sourceDiv.style.height = sourceDiv.offsetHeight + 16; } if (destinationDivWidth > destinationTDWidth) { destinationDiv.style.height = destinationDiv.offsetHeight + 16; } } function adjustOtherItemsTConfig(listControl,parentTdWidth) { // alert('adjustOtherItemsTConfig ' +parentTdWidth); listControl.style.width = parentTdWidth - 2; var noOfElements=listControl.options.length; if(noOfElements==0) { var oOption = document.createElement("OPTION"); oOption.text=""; oOption.value=""; listControl.add(oOption); isEmptyItemRemoved=false; isEmptyTransferItemRemoved = false; } // alert('adjustOtherItemsTConfig returning'); } function findMaxLenListElements() { var maxLen=0; var noOfElements=frmPopup.source.options.length; var counter=0; var lenOfElement=0; for(;counter maxLen) { maxLen = lenOfElement ; } } counter=0; noOfElements=frmPopup.destination.options.length; for(;counter maxLen) { maxLen = lenOfElement ; } } return maxLen; } function adjustOtherItems(listControl,maxLen) { var noOfElements=listControl.options.length; /* instead of appending spaces at the end, substring would be faster */ var emptyString=new String(" "); var counter=0; var lenOfElement=0; var elementText; if(noOfElements==0) { var oOption = document.createElement("OPTION"); oOption.text=emptyString.substring(0,maxLen*2); //2 space=1 char oOption.value=emptyString.substring(0,maxLen*2); listControl.add(oOption); isEmptyItemRemoved=false; isEmptyTransferItemRemoved = false; } for(;counter0) { var row=oChild.insertRow(); if(i%2==0) { row.className="tableRow0"; } else { row.className="tableRow1"; } i++; for(j=0;j= 0) { dateRangeValue = arrDateRangeValue[dateIndex]; if (dateRangeValue.indexOf("@") != -1) { var arrDates = dateRangeValue.split("@"); txtFromDate.value=arrDates[0]; txtToDate.value=arrDates[1]; } } else { txtFromDate.value = ""; txtToDate.value = ""; } } } // to bring back the focus on the modal function focusModal() { try { if((objWin!=null) && (!objWin.closed)) { objWin.focus(); } else { objWin = null; return false; } } catch(e) { objWin = null; return false; } } function focusModalSecondary() { try { if(objWinNew1!=null) { objWinNew1.focus(); return false; } else { objWinNew1 = null; return false; } } catch(e) { objWinNew1 = null; return false; } } // Check that a string contains only numbers function isNumeric (string, ignoreWhiteSpace) { if (string.search) { if ((ignoreWhiteSpace && string.search(/[^\d\s]/) != -1) || (!ignoreWhiteSpace && string.search(/\D/) != -1)) return false; } return true; } function toggleTable(objparent,elem, img) { var objElement=document.getElementById (objparent); objElement.style.height="20px"; objElement.width=objElement.offsetWidth; if (document.getElementById (elem).style.display == 'none') { objElement.className="nobottomborder"; } else { objElement.className="bottomborder"; } toggle(elem, img); } function manageSearch (thisForm) { var category = thisForm.CATEGORY_NAME.value; // objWin=window.open("manageSearch.do?category=" + category, null,"height=280, width=450,status=no,toolbar=no,menubar=no,location=no,directories=no,resizable =no,scrollbars=auto,titlebar=no,top=300,left=170"); objWin=window.open("manageSearch.do?category=" + category, null,"height=280, width=450,status=no,toolbar=no,menubar=no,location=no,directories=no,resizable =no,scrollbars=yes,titlebar=no,top=300,left=170"); } function submitManageSearchForm(buttonName,form) { if(buttonName == "CANCEL"){ window.close(); return; } form.MANAGE_SEARCH_BUTTON_CLICKED.value = buttonName; boolListBoxItemSelected = true; boolRenameFieldPopulated = true; boolSubmitForm = true; duplicate = false; var size = 0; var listItemArray = new Array(); var val = getRadioValue (form); if (val == null) { boolListBoxItemSelected = false; } form.SEARCH_SELECTED.value = val; if(trim(form.RENAME_FIELD.value) == '' || trim(form.RENAME_FIELD.value) == ''){ boolRenameFieldPopulated = false; } if(form.MANAGE_SEARCH_BUTTON_CLICKED.value == "DELETE" && (! boolListBoxItemSelected)){ boolSubmitForm = false; displayMessage ('selectsavedsearch', '1'); return } if(form.MANAGE_SEARCH_BUTTON_CLICKED.value == "RENAME" && (! boolListBoxItemSelected)){ boolSubmitForm = false; displayMessage ('selectsavedsearch', '1'); return; } if(form.MANAGE_SEARCH_BUTTON_CLICKED.value == "RENAME" && (! boolRenameFieldPopulated)){ boolSubmitForm = false; displayMessage ('entername', '1'); return; } if(form.MANAGE_SEARCH_BUTTON_CLICKED.value == "RENAME" && boolRenameFieldPopulated && boolListBoxItemSelected) { //loop thru the list box items and any of the items match the new name then donot allow renameFieldValue = form.RENAME_FIELD.value; size = form.elements.length; var j =0; for (var i=0; i < size; i++) { if(form.elements[i].type == "radio") { listItemArray[j++] = form.elements[i].value; } } for(i=0; i= 0) { // if(!stopAtZeroCount && (parentTable.offsetWidth > document.body.clientWidth) && (cells(cellCount).offsetLeft>100)) if(!stopAtZeroCount && (parentTable.offsetWidth > document.body.scrollWidth+16) && (cells(cellCount).offsetLeft>100)) { cellContent=cells(cellCount).innerHTML; rowSpan=1; rowSpan=cells(cellCount).rowSpan; rows(i).deleteCell(cellCount); row=parentTable.insertRow(); cell=row.insertCell(); cell.innerHTML=cellContent; exitWhile=false; if( rowSpan== maxRowSpan && maxRowSpan>1) { break; } } } } } } function findStopAtZeroCount(tempRows) { var rowCount=tempRows.length; var cells; for(i=0;i1 ) return false; } return true; } function changeDummyHeaderId(tableId,width, height) { var parentDiv = document.getElementById(tableId + "div"); var headerDiv = document.getElementById(tableId + "dummyHeader"); var table; var tableCells; var tableCell; var counter; if(headerDiv !=null) { table=headerDiv.childNodes(0); tableCells = table.cells; for(counter=0;counter < tableCells.length;counter++) { tableCell=tableCells(counter); tableCell.id="t" + tableCell.id ; } } if( width !=0 ) { if( parentDiv.scrollWidth > width && height==0) //scroll bar is present { /* To avoid unnecessary vertical scroll bar ususally when horizontal scroll bar is rendred vertical is also rendered because the horozontal scroll bar will occupy some display area.add 16 px to avoid that. */ parentDiv.style.height = parentDiv.scrollHeight + 16; } } //to avoid unwanted gap between the last row and horizontal scroll bar if(parentDiv.scrollHeight < height) { // this will assign the true client width parentDiv.style.height = parentDiv.scrollHeight ; if(parentDiv.scrollHeight > parentDiv.clientHeight ) { parentDiv.style.height = parentDiv.scrollHeight +16; } else { parentDiv.style.height = parentDiv.scrollHeight ; } } parentDiv.scrollTop = 2; //allow browser to render // setTimeout("changeDummyHeaderWidth('" + tableId + "dummyHeader','" + tableId + "')",100); } var rectTop0 = ''; var rcts_; var headerId_; var tableId_; function changeDummyHeaderWidth(headerId,tableId) { headerId_ = headerId; tableId_ = tableId; var parentDiv = document.getElementById(tableId + "div"); var headerDiv = document.getElementById(headerId); var table; var tableRows; var row; var tableCells; var tableCell; var dummyCells; var counter; var rowCount; var m; var dummyTableRows; if(parentDiv!=null && parentDiv.childNodes.length > 0) { table=parentDiv.childNodes(0); if(table !=null && table.childNodes.length > 0) { tableRows = table.childNodes(0).rows; rowCount = tableRows.length; for(m=0;m0) { dummyCells=dummyTableRows(m).cells; // 12 is right and left padding for(counter=0;counter < tableCells.length;counter++) { tableCell=tableCells(counter); dummyCells(counter).style.pixelWidth=tableCell.offsetWidth-12; } } } // alert(tableId ); } } var max = headerDiv.offsetTop + headerDiv.offsetHeight; var parentDivHeight = parentDiv.offsetTop + parentDiv.offsetHeight; if(isPageExist) { max = max + 32; //32 for breadcrumb } var elements = parentDiv.getElementsByTagName("Select"); var count = elements.length; var i; var rcts; var rectTop; var element; var oldTop = 0; for (i = 0 ;i0) { topTable.style.width= actualWidth; parentDiv.style.width=actualWidth; dummyHeader.style.width=actualWidth-16; } if( height > 0) { parentDiv.style.height=actualHeight; } */ //setTimeout("adjustAsPerBodySize('" + id +"'," + width + "," + height + ")",250); setTimeout("adjustAsPerBodySize('" + id +"'," + width + "," + height +","+widthForJSAdjust+","+basicWidthIndex+", "+ isContainerParent + ")",250); //setTimeout("adjustTableAsPerBodySize('" + id +"'," + width + "," + height + ")",250); } //praky var timerTable=0; function adjustAsPerBodySize1(id,width,height) { //alert('called'+ id +' ' +width+' '+ height); var timer1= (new Date()).getTime(); if(timerTable == 0) { timerTable = (new Date()).getTime(); } else { if ((timer1 - timerTable) <1000) { timerTable=timer1; return; } else { timerTable=timer1; } } var parentDiv = document.getElementById(id + "div"); var dummyHeader= document.getElementById(id+ "dummyHeader"); var topTable = document.getElementById(id); var titleHeader = document.getElementById(id + "titleHeader"); var footer = document.getElementById("footer" +id); var currentBodyWidth = document.body.clientWidth; var currentBodyHeight = document.body.clientHeight; //16 pixel is mere approx var actualWidth = currentBodyWidth - 16; actualWidth = actualWidth - parentDiv.offsetLeft; //praky // actualWidth = actualWidth-16; //praky topTable.style.width= actualWidth; parentDiv.style.width=actualWidth; //16 px for scroll bar dummyHeader.style.width=actualWidth-16; if(titleHeader !=null) { titleHeader.style.width=actualWidth; } if(footer !=null) { footer.width=actualWidth; } if(parentDiv.offsetLeft >0) { //readjust the width of table setTimeout("putDummyHeader('" + id + "')",100); setTimeout("bestGuessWidth('" + id + "')",100); } var newHeight = screen.height-(YScale - height); //alert('screen.height'+screen.height+'newHeight' + newHeight); if(parentDiv.originalHeight > 0) { // alert('if'+'document.body.clientHeight '+document.body.clientHeight+'parentDiv.originalHeight '+parentDiv.originalHeight); if(document.body.scrollHeight < parentDiv.originalHeight) { newHeight = document.body.scrollHeight - parentDiv.originalHeight + newHeight; } else { newHeight = document.body.scrollHeight - parentDiv.originalHeight + parentDiv.oldTableHeight+20; // newHeight = document.body.scrollHeight - parentDiv.originalHeight + parentDiv.oldContainerHeight; } } else { // alert('else'); parentDiv.style.height= newHeight; } newHeight = newHeight -20; if(newHeight > 0 && newHeight >MIN_HEIGHT ) { // alert('newHeight ' + newHeight); parentDiv.style.height = newHeight-30; } else { parentDiv.style.height = height; } parentDiv.originalHeight = document.body.scrollHeight; // alert('setting parentDiv.originalHeight ' + parentDiv.originalHeight); parentDiv.oldTableHeight = newHeight; // alert('setting parentDiv.oldTableHeight ' + parentDiv.oldTableHeight); //adjust the footer here.We are getting a grey area when the table grows more than //the data. //get first row. //var fRow = document.getElementById("R1"); //get tbody //var rows = fRow.parentNode.parentNode.rows; var rows; if(isNaN(document.getElementById("data"+id))) { rows = (document.getElementById("data"+id)).rows; } else if(isNaN(document.getElementById(id+"dataTable"))) { rows = (document.getElementById(id+"dataTable")).rows; } else { putDummyHeader(id); return; } var size = rows.length; if (size > 0 ) { var lastRow = rows(size-1); var k=0; var firstRow = rows(k); if(isNaN(footer)) { // alert('footer.offsetTop ' + footer.offsetTop + 'lastRow.offsetTop ' +lastRow.offsetTop); if((footer.offsetTop - lastRow.offsetTop) > 25) { // alert('footer adjust'+lastRow.offsetTop - firstRow.offsetTop); parentDiv.style.height = lastRow.offsetTop - firstRow.offsetTop; } } else { // alert('parentDiv.style.height' + parentDiv.style.height); //alert('no footer adjust'+'lastRow.offsetTop '+lastRow.offsetTop+'firstRow.offsetTop'+firstRow.offsetTop); // parentDiv.style.height = lastRow.offsetTop - firstRow.offsetTop+43; } } putDummyHeader(id); } //praky function adjustWidth(id,width,basicWidthIndex) { var topTable = document.getElementById(id); var currentBodyWidth = 0; //alert('currentBodyWidth ' +currentBodyWidth); if (isPageExist) { //If columns not used to stack containers if(adjustWidth == 0 || adjustWidth == 6 ) { currentBodyWidth = document.getElementById("breadcrumbdiv").clientWidth; } else { currentBodyWidth = document.body.clientWidth -10; } // currentBodyWidth = document.body.clientWidth -10; // alert('currentBodyWidth ' +currentBodyWidth); // alert('document.body.clientWidth ' +document.body.clientWidth); } else { currentBodyWidth = document.body.clientWidth; } if(width > 0) { currentBodyWidth = currentBodyWidth - 1; currentBodyWidth = currentBodyWidth * (width/basicWidthIndex); } //var actualWidth = currentBodyWidth - 16; //var actualWidth = currentBodyWidth - 21; var actualWidth = currentBodyWidth ; //prakynew while(basicWidthIndex > 6) { actualWidth = actualWidth -16; basicWidthIndex = basicWidthIndex /6; } //prakynew if (topTable != null) { //alert('id ' +id + 'actualWidth ' +actualWidth +'topTable.style.width ' +topTable.style.width); // ?????? ???? // topTable.style.width= actualWidth; // alert(actualWidth - 6); topTable.style.width= actualWidth - 9; } } function bestGuessWidth(id,widthForJSAdjust,basicWidthIndex) { var parentDiv = document.getElementById(id + "div"); var dummyHeader= document.getElementById(id+ "dummyHeader"); var topTable = document.getElementById(id); var titleHeader = document.getElementById(id + "titleHeader"); var footer = document.getElementById("footer" +id); if (isPageExist) { currentBodyWidth = document.getElementById("breadcrumbdiv").clientWidth; } else { currentBodyWidth = document.body.clientWidth; } if(widthForJSAdjust > 0) { currentBodyWidth = currentBodyWidth - 1; currentBodyWidth = currentBodyWidth * (widthForJSAdjust/basicWidthIndex); } actualWidth = currentBodyWidth ; /* if (isPageExist) { if (currentBodyWidth > document.getElementById("breadcrumbdiv").clientWidth) { actualWidth = actualWidth - 16; } } else { if (currentBodyWidth > document.body.clientWidth) { actualWidth = actualWidth - 16; } }*/ if(widthForJSAdjust > 0) { //do nothing. } else { actualWidth = actualWidth - parentDiv.offsetLeft; } topTable.style.width= actualWidth; parentDiv.style.width=actualWidth; //16 px for scroll bar dummyHeader.style.width=actualWidth-16; if(titleHeader !=null) { titleHeader.style.width=actualWidth; } if(footer !=null) { footer.width=actualWidth; } if(parentDiv.offsetLeft >0) { //readjust the width of table setTimeout("putDummyHeader('" + id + "')",100); } } var timer=0; var contPrevID; //This function adjusts the heights of containers with rows and cells. //Timers are used to circumvent multiple event firing issues in IE. function adjustContainer(id,height,width) { //alert('id' + id + 'timer' +timer); var timer1= (new Date()).getTime(); //alert('timer1 ' +timer); if(timer == 0) { timer = (new Date()).getTime(); contPrevID=id; } else { if ((timer1 - timer) <10 && id==contPrevID ) { timer=timer1; contPrevID = id; // alert('returning '+id); return; } else { contPrevID = id; timer=timer1; } } var rowTR = document.getElementById("contDivRow"+id); var superRowTR = document.getElementById("contRow"+id); if(rowTR != null) { var newHeight; // alert('document.body.clientHeight ' +document.body.clientHeight); if(isPageExist) { newHeight = height*document.body.clientHeight/490; } else { newHeight = height*document.body.clientHeight/547; } // var newHeight = document.body.scrollHeight-(YScale-height); //If call happening on a resize. //alert('rowTR.originalHeight ' +rowTR.originalHeight + 'document.body.clientHeight ' + document.body.clientHeight); if(rowTR.originalHeight > 0 && rowTR.originalHeight != document.body.clientHeight) { // alert('condition satidfied'); //If resized to a smaller screen if(document.body.clientHeight < rowTR.originalHeight) { // newHeight = document.body.clientHeight - rowTR.originalHeight + newHeight; //Prorate the height newHeight = (rowTR.oldContainerHeight*document.body.clientHeight)/rowTR.originalHeight; // alert('inside IF ' + newHeight + 'rowTR.oldContainerHeight ' +rowTR.oldContainerHeight +'document.body.clientHeight ' +document.body.clientHeight +'rowTR.originalHeight ' +rowTR.originalHeight); //If new height is unacceptably small,fix at 50,but store the calculated height in "oldContainerHeight" //for recalulation later. // alert('newHeight ' +newHeight); /* if(newHeight < 50) { alert('rowTR.oldContainerHeight' + rowTR.oldContainerHeight); var temp =rowTR.oldContainerHeight; rowTR.oldContainerHeight = newHeight; newHeight = temp; }*/ } else { newHeight = (rowTR.oldContainerHeight*document.body.clientHeight)/rowTR.originalHeight; // alert('inside else ' + newHeight + 'rowTR.oldContainerHeight ' +rowTR.oldContainerHeight +'document.body.clientHeight ' +document.body.clientHeight +'rowTR.originalHeight ' +rowTR.originalHeight); //If statement introduced for container reizing within columns. /* if(width == "100%") { // newHeight = document.body.clientHeight - rowTR.originalHeight + rowTR.oldContainerHeight+25; newHeight = ((rowTR.oldContainerHeight*document.body.clientHeight)/rowTR.originalHeight)+25; } else { // newHeight = document.body.clientHeight - rowTR.originalHeight + rowTR.oldContainerHeight; newHeight = (rowTR.oldContainerHeight*document.body.clientHeight)/rowTR.originalHeight; }*/ } } else if(rowTR.originalHeight > 0 && rowTR.originalHeight == document.body.clientHeight) { return; } //create some space. //Applies in case we are using columns with width less than 100%. // if(width == "100%") { newHeight = newHeight -20; // } if(newHeight > 0 ) { rowTR.style.height = newHeight; superRowTR.style.height = newHeight; } else { rowTR.style.height = height; superRowTR.style.height = height; } rowTR.originalHeight = document.body.clientHeight; // if(rowTR.oldContainerHeight > 50 || typeof(rowTR.oldContainerHeight) == "undefined" ) { rowTR.oldContainerHeight = newHeight+20; // } //alert('rowTR.originalHeight ' + rowTR.originalHeight + 'rowTR.oldContainerHeight ' +rowTR.oldContainerHeight); } // alert('rowTR.style.height' + rowTR.style.height); } var timer2=0; function adjustContainerPlain(id,height,width) { // alert("id:height:width="+id+":"+height+":"+width); var timer1= (new Date()).getTime(); if(timer2 == 0) { timer2 = (new Date()).getTime(); } else { if ((timer1 - timer2) <1000) { timer2=timer1; // return; } else { timer2=timer1; } } var rowTR = document.getElementById("contDivRow"+id); var superRowTR = document.getElementById("contRow"+id); if(rowTR != null) { var newHeight; if(isPageExist) { newHeight = height*document.body.clientHeight/490; } else { newHeight = height*document.body.clientHeight/547; } if(rowTR.originalHeight > 0 && rowTR.originalHeight != document.body.clientHeight) { if(document.body.clientHeight < rowTR.originalHeight) { newHeight = (rowTR.oldContainerHeight*document.body.clientHeight)/rowTR.originalHeight; } else { newHeight = (rowTR.oldContainerHeight*document.body.clientHeight)/rowTR.originalHeight; } } //create some space. //Applies in case we are using columns with width less than 100%. newHeight = newHeight -20; if(newHeight > 0 ) { rowTR.style.height = newHeight; superRowTR.style.height = newHeight; } else { rowTR.style.height = height; superRowTR.style.height = height; } rowTR.originalHeight = document.body.clientHeight; rowTR.oldContainerHeight = newHeight+20; } } function x() { //this is just a dummy function to simulate a timeout. var x=0; } function adjustAsPerBodySize(id,width,height,widthForJSAdjust,basicWidthIndex,isContainerParent) { // alert('id ' + id+ '/width '+width + '/height '+height +'/widthForJSAdjust '+widthForJSAdjust +'/basicWidthIndex '+basicWidthIndex); window.status=""; var parentDiv = document.getElementById(id + "div"); var dummyHeader= document.getElementById(id+ "dummyHeader"); var topTable = document.getElementById(id); var titleHeader = document.getElementById(id + "titleHeader"); var footer = document.getElementById("footer" +id); var currentBodyWidth; var currentBodyHeight; if (document.getElementById(id) == null || document.getElementById(id).style.display == "none" || document.getElementById(id+"tablebody") == null || document.getElementById(id+"tablebody").style.display == "none") { return; } if (isPageExist) { currentBodyWidth = document.getElementById("breadcrumbdiv").clientWidth; currentBodyHeight = document.getElementById("breadcrumbdiv").clientHeight; } else { currentBodyWidth = document.body.clientWidth; currentBodyHeight = document.body.clientHeight; } if(widthForJSAdjust > 0) { currentBodyWidth = currentBodyWidth - 1; currentBodyWidth = currentBodyWidth * (widthForJSAdjust/basicWidthIndex); } var actualWidth = 0; if (currentBodyWidth < 1) { return; } actualWidth = currentBodyWidth; if (isContainerParent) { actualWidth = actualWidth - 8; } if(widthForJSAdjust > 0) { // do nothing. } else { if(width > 0) { actualWidth = width; } else { actualWidth = actualWidth - parentDiv.offsetLeft; } } if (actualWidth < 15) { return; } var isTable = document.getElementById(id + "isTable"); if( isTable != null) { if(isTable.value =="tab") { actualWidth = actualWidth -1; } } topTable.style.width= actualWidth ; parentDiv.style.width=actualWidth; //16 px for scroll bar if(actualWidth-16 > 0) { dummyHeader.style.width=actualWidth-16; } if(titleHeader !=null) { var isTable = document.getElementById(id + "isTable"); if( isTable != null) { if(isTable.value =="tab") { titleHeader.style.width=actualWidth; } else if(isTable.value =="table") { titleHeader.style.width=actualWidth -1 ; } else { titleHeader.style.width=actualWidth ; } } else { titleHeader.style.width=actualWidth ; } } if(footer !=null) { footer.style.width=actualWidth; } if(parentDiv.offsetLeft >0) { //readjust the width of table setTimeout("putDummyHeader('" + id + "')",100); setTimeout("bestGuessWidth('" + id + "')",100,widthForJSAdjust,basicWidthIndex); } //32 px is from breadcrumb to table column header var actualHeight = 0; var maxPossibleHeight = 0; if (isPageExist) { if (height == 0) { actualHeight = document.body.clientHeight - ( parentDiv.offsetTop + 37 ); } else { actualHeight = ((height / YScale) * screen.height) + 32; } } else { if (height == 0) { actualHeight = document.body.clientHeight - parentDiv.offsetTop - 5; } else { actualHeight = (height / YScale) * screen.height; } } maxPossibleHeight = actualHeight ; // 8 pixel to create some space at the end // 7 pixels is the thin footer when table or Dtable rendered in tabset //if not accounted, it will put unnecessary scroll bar if(actualHeight > parentDiv.offsetHeight) { actualHeight = parentDiv.offsetHeight; } if (actualHeight > 0 ) { parentDiv.style.height = actualHeight; } //check for unnecessary scroll bar. if yes correct the scroll bar if(parentDiv.clientWidth < parentDiv.offsetWidth && actualHeight + 16 < maxPossibleHeight) { parentDiv.style.height = actualHeight + 16; } if (parentDiv.scrollHeight > parentDiv.offsetHeight) { dummyHeader.style.width=actualWidth-16; } else { dummyHeader.style.width=actualWidth; } //alert('parentDiv.style.height '+parentDiv.style.height); //praky //adjust the footer here.We are getting a grey area when the table grows more than //the data. //get first row. //var fRow = document.getElementById("R1"); //get tbody //var rows = fRow.parentNode.parentNode.rows; var rows; if(isNaN(document.getElementById("data"+id))) { rows = (document.getElementById("data"+id)).rows; } else if(isNaN(document.getElementById(id+"dataTable"))) { rows = (document.getElementById(id+"dataTable")).rows; } else { putDummyHeader(id); return; } var size = rows.length; if ( size > 0) { // Add Park Hyun geun avoid unknown script error var lastRow = rows(size-1); var k=0; var firstRow = rows(k); //balaji if ((lastRow.offsetTop + lastRow.offsetHeight + 1) < actualHeight) { actualHeight = (lastRow.offsetTop + lastRow.offsetHeight + 1); if(parentDiv.scrollWidth > actualWidth) { parentDiv.style.height = actualHeight + 16; } else { parentDiv.style.height = actualHeight; } } } //balaji /* if(isNaN(footer)) { if((footer.offsetTop - lastRow.offsetTop) > 25) { // alert('lastRow.offsetTop'+lastRow.offsetTop); // alert('firstRow.offsetTop'+firstRow.offsetTop); // alert('footer adjust'+lastRow.offsetTop - firstRow.offsetTop); if(lastRow.offsetTop != firstRow.offsetTop) { // parentDiv.style.height = lastRow.offsetTop - firstRow.offsetTop+21; parentDiv.style.height = lastRow.offsetTop - firstRow.offsetTop+42; } else { parentDiv.style.height = 42; } } } else { //alert('parentDiv.style.height' + parentDiv.style.height); //alert('no footer adjust'+'lastRow.offsetTop '+lastRow.offsetTop+'firstRow.offsetTop'+firstRow.offsetTop); //parentDiv.style.height = lastRow.offsetTop - firstRow.offsetTop+43; } */ //praky // readjust the column header and the data columns putDummyHeader(id); //if back button is pressed , the browser doesn't seem to be highlighting the rows. var thead = document.getElementById(id+"thead"); var theadParent ; if(isTable != null && (isTable.value=="table" || isTable.value=="tab")) { theadParent = thead.parentNode; } else { theadParent = document.getElementById(id+"start"); } var newtable = document.getElementById("dummyTable" + id); var row = newtable.rows; var cell = row(0).cells; var trs = theadParent.rows; var trl= trs.length; var tds; var control; var style; var optimizationCouter = 0; for (var i=1; i 5) { break; } } /*control = cell(0).childNodes(0); var checkVal = false; if(control != null) { checkVal = control.checked; } if(checkVal) { checkAllOrNone(theadParent.id, id); }*/ } function moveDummyHeader() { var ids = tableIds.split("&"); var noOfTables = ids.length; var index ; var parentDiv; var dummyHeader; var funcName; for(index=0;index < noOfTables ;index++) { parentDiv = document.getElementById(ids[index] + "div"); if(parentDiv != null && parentDiv.style.display=="") { putDummyHeader(ids[index]); funcName = eval("jsAdjustFunctionFromTable_" + ids[index]); eval(funcName); } } } function showDummyHeader(id) { var parentDiv = document.getElementById(id + "div"); var dummyHeader= document.getElementById(id+ "dummyHeader"); dummyHeader.style.left=parentDiv.offsetLeft; dummyHeader.style.top=parentDiv.offsetTop; dummyHeader.style.zIndex=2; dummyHeader.style.display=""; } function putDummyHeader(id) { if (document.getElementById(id) == null || document.getElementById(id).style.display == "none" || document.getElementById(id+"tablebody") == null || document.getElementById(id+"tablebody").style.display == "none") { return; } var parentDiv = document.getElementById(id + "div"); var dummyHeader= document.getElementById(id+ "dummyHeader"); var dummyTable=document.getElementById('dummyTable' + id); dummyHeader.style.display="none"; dummyHeader.style.left=parentDiv.offsetLeft; dummyHeader.style.top=parentDiv.offsetTop; dummyHeader.style.zIndex=2; //this will be set if data rows exist if(dummyHeader.canActivate==null) { dummyHeader.activated=true; dummyHeader.style.display=""; //might be helpful on slow rendering setTimeout("showDummyHeader('" + id + "')",200); } dummyHeader.scrollTop = parentDiv.scrollTop; dummyHeader.scrollLeft = parentDiv.scrollLeft; // to make the dummy table width = orginal table if(parentDiv.scrollWidth >0 ) { dummyTable.width=parentDiv.scrollWidth; } if (parentDiv.scrollTop < 2) { parentDiv.scrollTop = 2; } changeDummyHeaderWidth(id+ "dummyHeader",id); } /*Invoke Popup function */ function invoke_popup(url,parameter) { var array = new Array(2); array[0]=window; array[1]=parameter; var sFeatures="dialogHeight:200 px;dialogWidth:200 px"; var ret = window.showModalDialog(url,array,sFeatures); return ret; } function SortSelectList( selectObj ) { var selectLen = 0; var tmpSelectObj var msg msg="" tmpSelectObj = document.getElementById(selectObj); var selectedValue = tmpSelectObj.value selectLen = tmpSelectObj.length var j = 0 while(j < selectLen) { j ++ for(var i=1; i < selectLen ; i++) { if( (i+1) != selectLen ){ if( tmpSelectObj.item(i).text > tmpSelectObj.item(i+1).text ) { var tmpTxt,tmpVal,tmpIndx tmpIndx=0 tmpTxt = tmpSelectObj.item(i+1).text tmpVal = tmpSelectObj.item(i+1).value tmpIndx = tmpSelectObj.item(i+1).index tmpSelectObj.item(i+1).text = tmpSelectObj.item(i).text tmpSelectObj.item(i+1).value = tmpSelectObj.item(i).value tmpSelectObj.item(i+1).index = tmpSelectObj.item(i).index tmpSelectObj.item(i).text = tmpTxt tmpSelectObj.item(i).value = tmpVal tmpSelectObj.item(i).index = tmpIndx if(selectedValue == tmpSelectObj.item(i).value ) { tmpSelectObj.selectedIndex = tmpSelectObj.item(i).index; } if(selectedValue == tmpSelectObj.item(i+1).value ) { tmpSelectObj.selectedIndex = tmpSelectObj.item(i+1).index; } } } } selectObj = tmpSelectObj } } function setDropDownSelected(selectedName, Id) { elem = document.getElementById(Id); var selected = false; for (i = 0; i < elem.length; i++) { if (elem[i].value == selectedName) { elem[i].selected = true; selected = true; break; } } if (!selected) { elem[0].selected = true; } } /*TAB state saving*/ function saveTabState(tabsetID,funcName) { // alert('saveTabState(tabsetID,funcName) ' + 'tabsetID '+tabsetID+'funcName '+funcName); document.cookie = tabsetID + "=" + escape(funcName) + ";"; } function getSavedTabState(tabsetID, numberOfTabs) { if(APPLICATION_NAME == "WSP" || APPLICATION_NAME == "FCC" || APPLICATION_NAME == "WCP") { return; } // alert('getSavedTabState ' + tabsetID); if(getCookie(tabsetID) != null) { //alert('getCookie(tabsetID) ' +getCookie(tabsetID)); var tabsetTable = document.getElementById(tabsetID); var rows = tabsetTable.rows; var firstRowCells = rows(0).cells; var activeTab; for(var i=0;i 0){ var item2 = tdRetrieved.getElementsByTagName('A')[0]; item2.id="tabSelected"; } } else if(tdRetrieved.className.indexOf("tabSelected") || tdRetrieved.className.indexof("tabUnSelected")){ tdRetrieved.className="tabUnSelected"; if (tdRetrieved.getElementsByTagName('A').length > 0){ var item2 = tdRetrieved.getElementsByTagName('A')[0]; item2.id="tabUnSelected"; } } }*/ /* if(adjustAsPerBodyScript != null) { alert('original adjustAsPerBodyScript ' + adjustAsPerBodyScript); var regexp = "\([a-zA-Z1-9]*(\)"; var x = adjustAsPerBodyScript.replace(regexp); // adjustAsPerBodyScript =~ s/','/'','; alert('evaluation adjustAsPerBodyScript ' + x); eval(adjustAsPerBodyScript); }*/ } } /*TAB state saving*/ //Asha: Method to check/uncheck the checkboxes in a table function checkAllOrNone(tableId, dummyTableId) { var table = document.getElementById(tableId); var trs = table.rows; var trl= trs.length; var tds; var newtable = document.getElementById("dummyTable" + dummyTableId); var row = newtable.rows; var cell = row(0).cells; var checkVal = cell(0).childNodes(0).checked; for (var i=1; i0) { elementText=document.getElementById(childId).options(0).text; elementValue=document.getElementById(childId).options(0).value; if(trim(elementText).length==0 && trim(elementValue).length==0) { document.getElementById(childId).remove(0); isEmptyTransferItemRemoved=true; } } if(document.getElementById(parentId).options.length>0) { elementText=document.getElementById(parentId).options(0).text; elementValue=document.getElementById(parentId).options(0).value; if(trim(elementText).length==0 && trim(elementValue).length==0) { document.getElementById(parentId).remove(0); isEmptyTransferItemRemoved=true; } } } function findTransferIndex(searchString, parentId, childId) { var desOptions=document.getElementById(parentId).options; var desMax=desOptions.length; var i =-1; for(i=0;i0) { cells(4).children(0).src=imageDirectory + "/t_double_arrow_left.gif" } options=document.getElementById(parentId).options; max=options.length; if(max>0) { cells(0).children(0).src=imageDirectory + "/t_double_arrow_right.gif" } if(maxLen == 0) //arrived by trail and error process { maxLen=10; adjustOtherItems(document.getElementById(childId),maxLen); } var maxLenParent = findMaxLenTransferList(parentId, parentId) if(maxLenParent == 0) { maxLenParent = 10; adjustOtherItems(document.getElementById(parentId), maxLenParent); } adjustButtonTableForPreSelection(parentId, childId); //new var source = document.getElementById(parentId); var destination = document.getElementById(childId); var sourceTD = source.parentNode.parentNode; var sourceTDWidth = sourceTD.offsetWidth; var destinationTD = destination.parentNode.parentNode; var destinationTDWidth = destinationTD.offsetWidth; var maxLen1= sourceTDWidth ; // alert('sourceTDWidth ' +sourceTDWidth); if (maxLen1 < destinationTDWidth ) { maxLen1 = destinationTDWidth ; } var sourceDiv = source.parentNode; var sourceDivWidth = sourceDiv.scrollWidth; var destinationDiv = destination.parentNode; var destinationDivWidth = destinationDiv.scrollWidth; if (maxLen1 < sourceDivWidth ) { maxLen1 = sourceDivWidth ; } if (maxLen1 < destinationDivWidth ) { maxLen1 = destinationDivWidth ; } // alert('calling1 ' +maxLen1); adjustOtherItemsTConfig(destination,maxLen1); // alert('calling2'); adjustOtherItemsTConfig(source,maxLen1); // alert('over'); //new setTimeout("showLastElementTransfer('"+parentId+"','"+childId+"')",300); adjustScrollBarTransferBox(document.getElementById(parentId),document.getElementById(childId)," ",false); adjustUpDownTransferButtons(parentId, childId); } function adjustButtonTableForPreSelection(parentId, childId) { var table=document.getElementById('buttontable'+parentId); var parentOptions=document.getElementById(parentId).options; var parentBox = document.getElementById(parentId); var childBox = document.getElementById(childId); var childOptions=document.getElementById(childId).options; var parentLen = parentOptions.length; var childLen = childOptions.length; var parentSelected = false; var childSelected = false; for(var i=0;i maxLen) { maxLen = lenOfElement ; } } counter=0; noOfElements=document.getElementById(childId).options.length; for(;counter maxLen) { maxLen = lenOfElement ; } } return maxLen; } function showDescriptionTransfer(parentId, childId, id) { var box = id; removeTransferEmptyItem(parentId, childId); var updowntable=document.getElementById("updowntable"+parentId); var updowncells=updowntable.cells; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; //var selectedIndex; var cells,table; table=document.getElementById('buttontable'+parentId); cells=table.cells; //var selectBox; //alert(document.getElementById(parentId).selectedIndex); adjustUpDownTransferButtons(parentId, childId); if(id == parentId) { if(document.getElementById(id).options.length==0){ return; } if(document.getElementById(id).selectedIndex == -1){ return; } // selectBox = document.getElementById(parentId); // selectedIndex=document.getElementById(parentId).selectedIndex; //if(selectedIndex!=-1 // && trim(selectBox.options(selectedIndex).text).length!=0 // && trim(selectBox.options(selectedIndex).value).length!=0) //{ // cells(1).children(0).src=imageDirectory + "/t_single_arrow_right.gif"; //setTimeout("description.innerHTML=getValue(frmPopup.source.value);",100); //} cells(1).children(0).src=imageDirectory + "/t_single_arrow_right.gif"; //cells(1).children(0).src=imageDirectory + "/t_single_arrow_right.gif"; } else { if(document.getElementById(id).options.length==0){ return; } if(document.getElementById(id).selectedIndex == -1){ return; } //selectBox = document.getElementById(childId); //selectedIndex=document.getElementById(childId).selectedIndex; // alert('document.getElementById(childId).selectedIndex ' +document.getElementById(childId).selectedIndex); // alert('inside child'); // alert('document.getElementById(childId).selectedIndex ' +document.getElementById(childId).selectedIndex); // selectedIndex=document.getElementById(childId).selectedIndex; var childListBox =document.getElementById(childId); var updowncells=updowntable.cells; var arbit = document.getElementById(childId).selectedIndex; if(document.getElementById(childId).selectedIndex > 0) { // alert('document.getElementById(childId).selectedIndex' + document.getElementById(childId).selectedIndex + 'childListBox.length' +childListBox.length); // alert('setting up'); updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; } if((document.getElementById(childId).selectedIndex != (childListBox.length-1)) && (childListBox.length > 1)) { // alert('document.getElementById(childId).selectedIndex' + document.getElementById(childId).selectedIndex + 'childListBox.length' +childListBox.length); // alert('setting down'); updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; } //praky // if(selectedIndex!=-1) // { //setTimeout("description.innerHTML=getValue(frmPopup.destination.value);",100); // } //if(selectedIndex!=-1 // && trim(selectBox.options(selectedIndex).text).length!=0 // && trim(selectBox.options(selectedIndex).value).length!=0) // { // cells(3).children(0).src=imageDirectory + "/t_single_arrow_left.gif" ; // } cells(3).children(0).src=imageDirectory + "/t_single_arrow_left.gif" ; //praky:commented out and moved up. // var updowncells=updowntable.cells; // updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; // updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; //praky } } function adjustUpDownTransferButtons(parentId, childId) { var updowntable=document.getElementById("updowntable"+parentId); var updowncells=updowntable.cells; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; var selectedIndex=document.getElementById(childId).selectedIndex; if(selectedIndex!=-1) { if(document.getElementById(childId).options.length==1) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; return; } if(selectedIndex==(document.getElementById(childId).options.length-1) && selectedIndex>0) { updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; } else if(selectedIndex==0 && document.getElementById(childId).options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if(selectedIndex==0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if (document.getElementById(childId).options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; } } } function adjustTransferItems(listControl,maxLen) { var noOfElements=listControl.options.length; /* instead of appending spaces at the end, substring would be faster */ var emptyString=new String(" "); var counter=0; var lenOfElement=0; var elementText; if(noOfElements==0) { var oOption = document.createElement("OPTION"); oOption.text=emptyString.substring(0,maxLen*2); //2 space=1 char oOption.value=emptyString.substring(0,maxLen*2); listControl.add(oOption); isEmptyItemRemoved=false; } for(;counter 0) { cells1(0).children(0).src=imageDirectory + "/t_double_arrow_right.gif"; cells2(0).children(0).src=imageDirectory + "/t_double_arrow_right.gif"; } else { cells1(0).children(0).src=imageDirectory + "/t_double_arrow_right_disabled.gif"; cells2(0).children(0).src=imageDirectory + "/t_double_arrow_right_disabled.gif"; } if(parentTBox.selectedIndex != -1) { cells1(1).children(0).src=imageDirectory + "/t_single_arrow_right.gif"; cells2(1).children(0).src=imageDirectory + "/t_single_arrow_right.gif"; } else { cells1(1).children(0).src=imageDirectory + "/t_single_arrow_right_disabled.gif"; cells2(1).children(0).src=imageDirectory + "/t_single_arrow_right_disabled.gif"; } } //child1 Tbox if(child1TBox != null) { var table1=document.getElementById('buttontable1'+parentId); var table2=document.getElementById('buttontable3'+parentId); var cells1=table1.cells; var cells2=table2.cells; if(child1TBox.options.length > 0) { cells1(4).children(0).src=imageDirectory + "/t_double_arrow_left.gif"; cells2(4).children(0).src=imageDirectory + "/t_double_arrow_down.gif"; } else { cells1(4).children(0).src=imageDirectory + "/t_double_arrow_left_disabled.gif"; cells2(4).children(0).src=imageDirectory + "/t_double_arrow_down_disabled.gif"; } if(child1TBox.selectedIndex != -1) { cells1(3).children(0).src=imageDirectory + "/t_single_arrow_left.gif"; cells2(3).children(0).src=imageDirectory + "/t_single_arrow_bottom.gif"; } else { cells1(3).children(0).src=imageDirectory + "/t_single_arrow_left_disabled.gif"; cells2(3).children(0).src=imageDirectory + "/t_single_arrow_bottom_disabled.gif"; } var passValue = "updowntable1"+parentId; adjustUpDownMButtons(childId1,passValue); } //child2 Tbox if(child2TBox != null) { var table1=document.getElementById('buttontable2'+parentId); var table2=document.getElementById('buttontable3'+parentId); var cells1=table1.cells; var cells2=table2.cells; if(child2TBox.options.length > 0) { cells1(4).children(0).src=imageDirectory + "/t_double_arrow_left.gif"; cells2(0).children(0).src=imageDirectory + "/t_double_arrow_top.gif"; } else { cells1(4).children(0).src=imageDirectory + "/t_double_arrow_left_disabled.gif"; cells2(0).children(0).src=imageDirectory + "/t_double_arrow_top_disabled.gif"; } if(child2TBox.selectedIndex != -1) { cells1(3).children(0).src=imageDirectory + "/t_single_arrow_left.gif"; cells2(1).children(0).src=imageDirectory + "/t_single_arrow_top.gif"; } else { cells1(3).children(0).src=imageDirectory + "/t_single_arrow_left_disabled.gif"; cells2(1).children(0).src=imageDirectory + "/t_single_arrow_top_disabled.gif"; } var passValue1 = "updowntable2"+parentId; adjustUpDownMButtons(childId2,passValue1); } } function adjustUpDownMButtons(childId, updowntableId) { var updowntable=document.getElementById(updowntableId); var updowncells=updowntable.cells; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; var selectedIndex=document.getElementById(childId).selectedIndex; if(selectedIndex!=-1) { if(document.getElementById(childId).options.length==1) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; return; } if(selectedIndex==(document.getElementById(childId).options.length-1) && selectedIndex>0) { updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; } else if(selectedIndex==0 && document.getElementById(childId).options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if(selectedIndex==0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if (document.getElementById(childId).options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; } } } /* Multiple Transfer Buttons*/ function initMTransferButtons(parentId, childId1, childId2) { transferBoxSplParent = parentId; document.getElementById(parentId).child1=childId1; document.getElementById(parentId).child2=childId2; document.getElementById(childId1).parentId =parentId; document.getElementById(childId2).parentId =parentId; var updowntable1=document.getElementById("updowntable1"+parentId); var updowntable2=document.getElementById("updowntable2"+parentId); var updowncells1=updowntable1.cells; var updowncells2=updowntable2.cells; updowncells1(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; updowncells2(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; updowncells1(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells2(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; var table1=document.getElementById('buttontable1'+parentId); var table2=document.getElementById('buttontable2'+parentId); var table3=document.getElementById('buttontable3'+parentId); var cells1=table1.cells; var cells2=table2.cells; var cells3=table3.cells; cells1(0).children(0).src=imageDirectory + "/t_double_arrow_right_disabled.gif"; cells1(1).children(0).src=imageDirectory + "/t_single_arrow_right_disabled.gif" cells1(3).children(0).src=imageDirectory + "/t_single_arrow_left_disabled.gif" cells1(4).children(0).src=imageDirectory + "/t_double_arrow_left_disabled.gif" cells2(0).children(0).src=imageDirectory + "/t_double_arrow_right_disabled.gif"; cells2(1).children(0).src=imageDirectory + "/t_single_arrow_right_disabled.gif" cells2(3).children(0).src=imageDirectory + "/t_single_arrow_left_disabled.gif" cells2(4).children(0).src=imageDirectory + "/t_double_arrow_left_disabled.gif" cells3(0).children(0).src=imageDirectory + "/t_double_arrow_top_disabled.gif"; cells3(1).children(0).src=imageDirectory + "/t_single_arrow_top_disabled.gif" cells3(3).children(0).src=imageDirectory + "/t_single_arrow_bottom_disabled.gif" cells3(4).children(0).src=imageDirectory + "/t_double_arrow_down_disabled.gif" // removeTransferDuplicates(parentId, childId1, childId2); var options1=document.getElementById(childId1).options; var options2=document.getElementById(childId2).options; var max1=options1.length; var max2=options2.length; var sourceCount=0; var maxLen=findMaxLenTransferList(childId1, childId1); if(maxLen ==0) { maxLen=10; adjustOtherItems(document.getElementById(childId1),maxLen); } var maxLen=findMaxLenTransferList(childId2, childId2); if(maxLen == 0) { maxLen=10; adjustOtherItems(document.getElementById(childId2),maxLen); } var maxParentLen = findMaxLenTransferList(parentId, parentId); if (maxParentLen == 0) { maxParentLen = 10; adjustOtherItems(document.getElementById(parentId), maxParentLen); } if(max1>0) { cells1(4).children(0).src=imageDirectory + "/t_double_arrow_left.gif" } options=document.getElementById(parentId).options; max1=options.length; if(max1>0) { cells1(0).children(0).src=imageDirectory + "/t_double_arrow_right.gif" } if(max2>0) { cells2(4).children(0).src=imageDirectory + "/t_double_arrow_left.gif" cells3(0).children(0).src=imageDirectory + "/t_double_arrow_top.gif" } max2=options.length; if(max2>0) { cells2(0).children(0).src=imageDirectory + "/t_double_arrow_right.gif" cells3(4).children(0).src=imageDirectory + "/t_double_arrow_down.gif" } //new //new var source = document.getElementById(parentId); var destination = document.getElementById(childId1); var destination1 = document.getElementById(childId2); var sourceTD = source.parentNode.parentNode; var sourceTDWidth = sourceTD.offsetWidth; var destinationTD = destination.parentNode.parentNode; var destinationTDWidth = destinationTD.offsetWidth; var destination1TD = destination1.parentNode.parentNode; var destination1TDWidth = destination1TD.offsetWidth; var maxLen1= sourceTDWidth ; if (maxLen1 < destinationTDWidth ) { maxLen1 = destinationTDWidth ; } if (maxLen1 < destination1TDWidth ) { maxLen1 = destination1TDWidth ; } var sourceDiv = source.parentNode; var sourceDivWidth = sourceDiv.scrollWidth; var destinationDiv = destination.parentNode; var destinationDivWidth = destinationDiv.scrollWidth; var destination1Div = destination1.parentNode; var destination1DivWidth = destination1Div.scrollWidth; if (maxLen1 < sourceDivWidth ) { maxLen1 = sourceDivWidth ; } if (maxLen1 < destinationDivWidth ) { maxLen1 = destinationDivWidth ; } if (maxLen1 < destination1DivWidth ) { maxLen1 = destination1DivWidth ; } adjustOtherItemsTConfig(destination,maxLen1); adjustOtherItemsTConfig(source,maxLen1); adjustOtherItemsTConfig(destination1,maxLen1); adjustScrollBarTransferBox(document.getElementById(parentId), document.getElementById(childId1),document.getElementById(childId2),true); transferBoxParent=document.getElementById(parentId); transferBoxChild1=document.getElementById(childId1); transferBoxChild2=document.getElementById(childId2); //new //new setTimeout("showLastElementTransfer('"+parentId+"','"+childId1+"','"+childId2+"')",300); enableDisableButtons(parentId, childId1, childId2); } function removeTransferMDuplicates(parentId, childId1, child2) { var desOptions1=document.getElementById(childId1).options; var desOptions2=document.getElementById(childId2).options; var sourceOptions=document.getElementById(parentId).options; var desMax1=desOptions1.length; var desMax2=desOptions2.length; var i,j; for(i=0;i 0 && (document.getElementById(childId1).selectedIndex + 1) < maxSize ) { updowncells1(0).children(0).src=imageDirectory +"/t_single_arrow_up.gif"; updowncells1(1).children(0).src=imageDirectory +"/t_single_arrow_down.gif"; } else if((document.getElementById(childId1).selectedIndex +1) == maxSize) { updowncells1(0).children(0).src=imageDirectory +"/t_single_arrow_up.gif"; updowncells1(1).children(0).src=imageDirectory +"/t_single_arrow_down_disabled.gif"; } } else if(id == "two"){ if(document.getElementById(childId1).options.length==0){ return; } if(document.getElementById(childId1).selectedIndex == -1){ return; } cells2(3).children(0).src=imageDirectory + "/t_single_arrow_left.gif" ; cells3(1).children(0).src=imageDirectory + "/t_single_arrow_top.gif" ; //cells3(3).children(0).src=imageDirectory + "/t_single_arrow_bottom_disabled.gif" ; var updowncells1=updowntable1.cells; var maxSize1 = document.getElementById(childId1).options.length; if(document.getElementById(childId1).selectedIndex == 0 ) { updowncells2(0).children(0).src=imageDirectory +"/t_single_arrow_up_disabled.gif"; updowncells2(1).children(0).src=imageDirectory +"/t_single_arrow_down.gif"; } else if ( document.getElementById(childId1).selectedIndex > 0 && (document.getElementById(childId1).selectedIndex + 1) < maxSize1 ) { updowncells2(0).children(0).src=imageDirectory +"/t_single_arrow_up.gif"; updowncells2(1).children(0).src=imageDirectory +"/t_single_arrow_down.gif"; } else if((document.getElementById(childId1).selectedIndex +1) == maxSize1) { updowncells2(0).children(0).src=imageDirectory +"/t_single_arrow_up.gif"; updowncells2(1).children(0).src=imageDirectory +"/t_single_arrow_down_disabled.gif"; } } } function removeMTransferEmptyItem(parentId, childId1, childId2) { var elementText; if(document.getElementById(parentId).options.length>0) { elementText=document.getElementById(parentId).options(0).text; if(trim(elementText).length==0) { document.getElementById(parentId).remove(0); isEmptyTransferItemRemoved=true; } } if(document.getElementById(childId1).options.length>0) { elementText=document.getElementById(childId1).options(0).text; if(trim(elementText).length==0) { document.getElementById(childId1).remove(0); isTransferItemRemoved=true; } } if(document.getElementById(childId2).options.length>0) { elementText=document.getElementById(childId2).options(0).text; if(trim(elementText).length==0) { document.getElementById(childId2).remove(0); isEmptyTransferItemRemoved=true; } } } function rightMTransfer1(parentId, childId) { var selOptions=document.getElementById(parentId).options; var j,i; var max=selOptions.length; for(i=0;i 0) { cells2(4).children(0).src=imageDirectory + "/t_double_arrow_left.gif"; } //praky adjustUpDownMTransferButtons1(parentId, childId); var adjFunc= "transferBoxFunctionFromJava_"+parentId; eval(eval(adjFunc)); enableDisableButtons(parentId,childId,"dummy"); } function transferMAllLeft2(parentId, childId) { if(!isEmptyTransferItemRemoved) { removeTransferEmptyItem(parentId, childId); isEmptyTransferItemRemoved=true; } var selOptions=document.getElementById(childId).options; var max=selOptions.length; var i,index; for(i=0;i0) { updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; } else if(selectedIndex==0 && document.getElementById(childId).options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if(selectedIndex==0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if (document.getElementById(childId).options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; } } } function adjustUpDownMTransferButtons2(parentId, childId ) { var masterParentId= eval("tbox_parentId_"+childId); var updowntable=document.getElementById("updowntable2"+masterParentId); var updowncells=updowntable.cells; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; var selectedIndex=document.getElementById(childId).selectedIndex; if(selectedIndex!=-1) { if(document.getElementById(childId).options.length==1) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; return; } if(selectedIndex==(document.getElementById(childId).options.length-1) && selectedIndex>0) { updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; } else if(selectedIndex==0 && document.getElementById(childId).options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if(selectedIndex==0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down_disabled.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up_disabled.gif"; } else if (document.getElementById(childId).options.length>0) { updowncells(1).children(0).src=imageDirectory + "/t_single_arrow_down.gif"; updowncells(0).children(0).src=imageDirectory + "/t_single_arrow_up.gif"; } } } function transferMDown1(parentId, childId) { var selectedIndex=document.getElementById(childId).selectedIndex; removeTransferEmptyItem(parentId, childId); if(selectedIndex!=-1 && selectedIndex!=(document.getElementById(childId).options.length-1)) { var source= document.createElement("OPTION"); source.text=document.getElementById(childId).options(selectedIndex).text; source.value=document.getElementById(childId).options(selectedIndex).value; var destination= document.createElement("OPTION"); destination.text=document.getElementById(childId).options(selectedIndex+1).text; destination.value=document.getElementById(childId).options(selectedIndex+1).value; document.getElementById(childId).remove(selectedIndex+1); document.getElementById(childId).add(source,selectedIndex+1); document.getElementById(childId).remove(selectedIndex); document.getElementById(childId).add(destination,selectedIndex); document.getElementById(childId).options(selectedIndex+1).selected=true; } adjustUpDownMTransferButtons1(parentId, childId,"updowntable1"+parentId); enableDisableButtons(parentId,childId,"dummy"); } function transferMDown2(parentId, childId) { var selectedIndex=document.getElementById(childId).selectedIndex; removeTransferEmptyItem(parentId, childId); if(selectedIndex!=-1 && selectedIndex!=(document.getElementById(childId).options.length-1)) { var source= document.createElement("OPTION"); source.text=document.getElementById(childId).options(selectedIndex).text; source.value=document.getElementById(childId).options(selectedIndex).value; var destination= document.createElement("OPTION"); destination.text=document.getElementById(childId).options(selectedIndex+1).text; destination.value=document.getElementById(childId).options(selectedIndex+1).value; document.getElementById(childId).remove(selectedIndex+1); document.getElementById(childId).add(source,selectedIndex+1); document.getElementById(childId).remove(selectedIndex); document.getElementById(childId).add(destination,selectedIndex); document.getElementById(childId).options(selectedIndex+1).selected=true; } adjustUpDownMTransferButtons2(parentId, childId,"updowntable2"+parentId); } function transferMUp1(parentId, childId) { var selectedIndex=document.getElementById(childId).selectedIndex; removeTransferEmptyItem(parentId, childId); if(selectedIndex!=-1 && selectedIndex!=0) { var oOption = document.createElement("OPTION"); oOption.text=document.getElementById(childId).options(selectedIndex-1).text; oOption.value=document.getElementById(childId).options(selectedIndex-1).value; document.getElementById(childId).remove(selectedIndex-1); document.getElementById(childId).add(oOption,selectedIndex); } adjustUpDownMTransferButtons1(parentId, childId, "updowntable1"+parentId); } function transferMUp2(parentId, childId) { var selectedIndex=document.getElementById(childId).selectedIndex; removeTransferEmptyItem(parentId, childId); if(selectedIndex!=-1 && selectedIndex!=0) { var oOption = document.createElement("OPTION"); oOption.text=document.getElementById(childId).options(selectedIndex-1).text; oOption.value=document.getElementById(childId).options(selectedIndex-1).value; document.getElementById(childId).remove(selectedIndex-1); document.getElementById(childId).add(oOption,selectedIndex); } adjustUpDownMTransferButtons2(parentId, childId, "updowntable2"+parentId); } function upMTransfer(childId,parentId) { var masterParentId= eval("tbox_parentId_"+childId); var selOptions=document.getElementById(childId).options; var j,i; var max=selOptions.length; var index; removeTransferEmptyItem(parentId, childId); for(i=0;i 8 ) { theList.listSize = 8; } else { theList.listSize = theList.options.length; } } } function ComboBox_ListKeyAccess(e) { //Make enter/space and escape do the right thing :) //alert("ComboBox_ListKeyAccess"); e = ComboBox_InitEvent( e ); if( e.keyCode == 13 || e.keyCode == 32 ) { this.Select(); return; } if( e.keyCode == 27 ) { this.Hide(); this.Container.Text.focus(); return; } } function ComboBox_TextKeyAccess(e) { //Make alt+arrow expand the list //alert("ComboBox_TextKeyAccess"); e = ComboBox_InitEvent( e ); if( e.altKey && (e.keyCode == 38 || e.keyCode == 40) ) { this.Container.List.Show(); } var id = this.Container.List.id; document.getElementById(id + "_Text_Value").value = document.getElementById(id + "_Text").value; var comboBoxStatus = document.getElementById(id + "_IsComboBoxExist"); if (document.getElementById(id + "_Text").value.length > 0) { comboBoxStatus.value = "true"; } else { comboBoxStatus.value = "false"; } } function ComboBox_TextTypeDown(e) { //Make the textbox do a type-down on the list //alert("ComboBox_TextTypeDown"); e = ComboBox_InitEvent( e ); var items = this.Container.List.options; if( this.value == "" ) return; var ctrlKeys = Array( 8, 46, 37, 38, 39, 40, 33, 34, 35, 36, 45, 16, 20 ); for( var i = 0; i < ctrlKeys.length; i++ ) { if( e.keyCode == ctrlKeys[i] ) return; } for( var i = 0; i < items.length; i++ ) { var item = items[i]; if( item.text.toLowerCase().indexOf( this.value.toLowerCase() ) == 0 ) { this.Container.List.selectedIndex = i; if ( typeof( this.Container.Text.createTextRange ) != "undefined" ) { this.Container.List.Select(); } break; } } } function ComboBox_ListEnableBlur(e) { //alert("ComboBox_ListEnableBlur"); this.onblur = this.Hide; } function ComboBox_ListDisableBlur(e) { //alert("ComboBox_ListDisableBlur"); this.onblur = null; } function ComboBox_ListItemSelect(e) { //alert("ComboBox_ListItemSelect"); if( this.options.length > 0 ) { var text = this.Container.Text; var oldValue = text.value; var newValue = this.options[ this.selectedIndex ].text; text.value = newValue; if ( typeof( text.createTextRange ) != "undefined" ) { if (newValue != oldValue) { var rNew = text.createTextRange(); rNew.moveStart('character', oldValue.length) ; rNew.select(); } } } this.Hide(); this.Container.Text.focus(); document.getElementById(this.id + "_Text_Value").value = this.value; } function ComboBox_ToggleList(e) { if( this.Container.List.IsShowing == true ) { this.Container.List.Hide(); } else { this.Container.List.Show(); } } function ComboBox_ShowList(e) { //alert("ComboBox_ShowLis"); var list; var doAgain = false; var bodyOrDivScrollTop = 0; if (isPageExist) { bodyOrDivScrollTop = document.getElementById("breadcrumbdiv").scrollTop; } else { bodyOrDivScrollTop = document.body.scrollTop; } if (this.style == null) { list = document.getElementById(e);; } else { list = this ; } if ( !list.IsShowing && !list.disabled ) { var heightCorrection = 0; var widthCorrection = 0; if (list.page) { heightCorrection = 32; widthCorrection = 6; } list.style.width = ( list.Container.offsetWidth) + "px"; var top = 0; var prevBodyScrollTop = 0; if (list.bodyScrollTop != null) { prevBodyScrollTop = list.bodyScrollTop; } if (list.ancestor != null && (list.ancestor == "table" || list.ancestor == "Dtable")) { var scrollTop = 0; if (document.getElementById(list.tableId+"div") != null) { scrollTop = document.getElementById(list.tableId+"div").scrollTop; } var div = document.getElementById(list.id+"_div"); if(div != null) { div.style.zIndex = 300; top = (list.Container.offsetHeight + ComboBox_RecursiveOffsetTop(list.Container,true) - scrollTop - heightCorrection); } } else { top = (list.Container.offsetHeight + ComboBox_RecursiveOffsetTop(list.Container,true) - heightCorrection); } if (list.firstTime != null) { if (bodyOrDivScrollTop - prevBodyScrollTop != 0) { doAgain = true; } top = top - (bodyOrDivScrollTop - prevBodyScrollTop); } list.firstTime ="yes"; list.bodyScrollTop = bodyOrDivScrollTop; list.style.top = top + "px"; list.style.left = ( ComboBox_RecursiveOffsetLeft(list.Container,true) - widthCorrection) + "px"; if (doAgain) { ComboBox_SetVisibility(list,true); setTimeout("ComboBox_ShowList('" + list.id + "')",50); } else { ComboBox_SetVisibility(list,true); list.focus(); list.IsShowing = true; } } } function ComboBox_HideList(e) { //alert("ComboBox_HideList"); if( this.IsShowing && !this.disabled ) { ComboBox_SetVisibility(this,false); this.IsShowing = false; } } function ComboBox_SetVisibility(theList,isVisible) { //alert("ComboBox_SetVisibility"); var isIE = ( typeof( theList.dataSrc ) != "undefined" ); // dataSrc is an IE-only property which is unlikely to be supported elsewhere if ( isIE ) { if ( isVisible ) { theList.style.display = ""; } else { theList.style.display= "none"; } } else { if ( isVisible ) { theList.style.display = "block"; } else { theList.style.display = "none"; } } } function ComboBox_RecursiveOffsetTop(thisObject,isFirst) { //alert("ComboBox_RecursiveOffsetTop"); if(thisObject.offsetParent) { if ( thisObject.style.position == "absolute" && !isFirst && typeof(document.designMode) != "undefined" ) { return 0; } return (thisObject.offsetTop + ComboBox_RecursiveOffsetTop(thisObject.offsetParent,false)); } else { return thisObject.offsetTop; } } function ComboBox_RecursiveOffsetLeft(thisObject,isFirst) { //alert("ComboBox_RecursiveOffsetLeft"); if(thisObject.offsetParent) { if ( thisObject.style.position == "absolute" && !isFirst && typeof(document.designMode) != "undefined" ) { return 0; } return (thisObject.offsetLeft + ComboBox_RecursiveOffsetLeft(thisObject.offsetParent,false)); } else { return thisObject.offsetLeft; } } function DefaultButton_BrowserCapable() { //alert("DefaultButton_BrowserCapable"); if ( typeof( __doPostBack ) == "undefined" ) return false; if ( typeof( document.getElementById ) == "undefined" ) { if( typeof( document.all ) != "undefined" ) { document.getElementById = function( elementId ) { return document.all[elementId]; }; } else { return false; } } return true; } function assignValue (comboId) { var comboBox = document.getElementById(comboId); if (comboBox == null) { //alert("Invalid Id " + comboId); return; } var comboBoxStatus = document.getElementById(comboId + "_IsComboBoxExist"); comboBoxStatus.value = "false"; var textBox = document.getElementById(comboId + "_Text"); textBox.value = comboBox.options(comboBox.selectedIndex).text; } function EnableDisableSearchImage(id) { var txtBox = document.getElementById(id + "_Text").value; var img = document.getElementById(id + "_Img"); if (txtBox.length > 0) { img.src= imageDirectory + "/srch_actv.gif"; img.style.cursor="hand"; } else { img.src= imageDirectory + "/srch_inactv.gif"; img.style.cursor="default"; } } function EnableDisableEdit(id) { var txtBox = document.getElementById(id + "_Text").value; var enterButton = document.getElementById(id + "enter"); if (txtBox.length > 0) { enterButton.className = "buttonText buttonRegular"; } else { enterButton.className = "buttonText buttonDisabled"; } } function editCell(cellId, tableId) { isParent = false; var cell = document.getElementById(cellId); var textBox = document.getElementById(tableId + "_Text"); if (textBox.currentCellId != null) { document.getElementById(textBox.currentCellId).className="editableCell"; } textBox.currentCellId = cellId; //Add Park H.G if (cell.className == "rowHighlight") cell.className = "style"; else cell.className = "rowHighlight"; //End var enterButton = document.getElementById(tableId + "enter"); textBox.disabled= false; textBox.value = cell.innerText; //Add Park H.G textBox.focus(); textBox.select(); //End enterButton.className = "buttonText buttonRegular"; var undo = document.getElementById(tableId + "undoValue"); var undoButton = document.getElementById(tableId + "undo"); undoButton.className = "buttonText buttonDisabled"; if(undo != null && isCellIdExist(undo.value,cellId)) { undoButton.className = "buttonText buttonRegular"; } setTimeout("putDummyHeader('" + tableId + "')",250); } function updateCell(tableId) { var textBox = document.getElementById(tableId + "_Text"); if (textBox.disabled || textBox.value.length == 0) { return; } document.getElementById(tableId).isDirty = true; var cellValue = document.getElementById(tableId + "cellValue"); var undoButton = document.getElementById(tableId + "undo"); var updateButton = document.getElementById(tableId + "update"); var undo = document.getElementById(tableId + "undoValue"); var cell = document.getElementById(textBox.currentCellId); if(cell.innerText == trim(textBox.value)) { return; } if (cellValue.value != null && cellValue.value.length > 1) { var cellIndex = getCellIndex(cellValue.value,textBox.currentCellId); if (cellIndex != -1) { cellValue.value = replaceValue(cellValue.value, textBox.currentCellId, textBox.value); } else { cellValue.value = textBox.currentCellId + EDITABLE_CELL_ID_VAL_DELIMITER + textBox.value + EDITABLE_CELL_CELL_DELIMITER + cellValue.value ; } } else { cellValue.value = textBox.currentCellId + EDITABLE_CELL_ID_VAL_DELIMITER + textBox.value + EDITABLE_CELL_CELL_DELIMITER; } if (undo.value != null && undo.value.length > 0) { undo.value = textBox.currentCellId + EDITABLE_CELL_ID_VAL_DELIMITER + cell.innerText + EDITABLE_CELL_CELL_DELIMITER + undo.value ; } else { undo.value = textBox.currentCellId + EDITABLE_CELL_ID_VAL_DELIMITER + cell.innerText + EDITABLE_CELL_CELL_DELIMITER; } undoButton.className = "buttonText buttonRegular"; updateButton.className = "buttonText buttonRegular"; cell.innerText = textBox.value ; //cell.style.zoom = "150%"; insertImg(textBox.currentCellId); highlightRecentlyEditedCells(tableId); setTimeout("putDummyHeader('" + tableId + "')",250); var func =eval("jsAdjustFunctionFromTable_"+tableId); setTimeout('eval('+func+');eval('+func+');eval('+func+')',10); setTimeout('eval('+func+');eval('+func+');eval('+func+')',10); } function getCellIndex(source, cellId) { if(source == null || source.length == 0 ) { return -1; } var cellIdIndex = 0; var cellIdIndexFound = false; var entries = source.split(EDITABLE_CELL_CELL_DELIMITER); entriesLength = entries.length; var cellIndex; var cellIds; for(cellIndex=0;cellIndex < entriesLength;cellIndex++) { cellIds = entries[cellIndex].split(EDITABLE_CELL_ID_VAL_DELIMITER); if(cellIds.length == 2 && cellIds[0]== cellId) { cellIdIndexFound = true; break; } else { cellIdIndex = cellIdIndex + entries[cellIndex].length + 1; } } if(cellIdIndexFound) { return cellIdIndex; } return -1; } function undoCell(tableId) { var textBox = document.getElementById(tableId + "_Text"); var undo = document.getElementById(tableId + "undoValue"); var updateButton = document.getElementById(tableId + "update"); var cellValue = document.getElementById(tableId + "cellValue"); if (undo.value == null || undo.value.length == 0) { return; } var undoButton = document.getElementById(tableId + "undo"); var cellId = textBox.currentCellId; var cell = document.getElementById(cellId); cell.innerText = adjustUndoValue(tableId + "undoValue",cellId,cell.innerText); if (undo.value != null && undo.value.length > 0) { undoButton.className = "buttonText buttonRegular"; updateButton.className = "buttonText buttonRegular"; } else { document.getElementById(tableId).isDirty = false; undoButton.className = "buttonText buttonDisabled"; updateButton.className = "buttonText buttonDisabled"; } if(!isCellIdExist(undo.value,cellId)) { undoButton.className = "buttonText buttonDisabled"; } insertImg(cellId); if (isCellIdExist(undo.value,cellId)) { cellValue.value = replaceValue(cellValue.value, cellId, cell.innerText); } else { cellValue.value = removeValue(cellValue.value, cellId); } textBox.value = document.getElementById(textBox.currentCellId).innerText; highlightRecentlyEditedCells(tableId); setTimeout("putDummyHeader('" + tableId + "')",250); var func =eval("jsAdjustFunctionFromTable_"+tableId); setTimeout('eval('+func+');eval('+func+');eval('+func+')',10); setTimeout('eval('+func+');eval('+func+');eval('+func+')',10); } function adjustUndoValue(sourceId,pattern,cellText) { var temp ="" ; var returnValue = cellText; var source = document.getElementById(sourceId).value; if(source == null || source.length == 0 ) { return cellText; } var entries = source.split(EDITABLE_CELL_CELL_DELIMITER); entriesLength = entries.length; var cellIndex; var cellIds; var firstTime = true; for(cellIndex=0;cellIndex < entriesLength;cellIndex++) { cellIds = entries[cellIndex].split(EDITABLE_CELL_ID_VAL_DELIMITER); if(cellIds.length == 2 && cellIds[0]== pattern && firstTime) { returnValue = cellIds[1]; firstTime = false; } else if(entries[cellIndex].length > 0) { temp = temp + entries[cellIndex] + EDITABLE_CELL_CELL_DELIMITER; } } document.getElementById(sourceId).value = temp; return returnValue; } function isCellIdExist(source , pattern) { if(source == null || source.length == 0 ) { return false; } var entries = source.split(EDITABLE_CELL_CELL_DELIMITER); entriesLength = entries.length; var cellIndex; var cellIds; for(cellIndex=0;cellIndex < entriesLength;cellIndex++) { cellIds = entries[cellIndex].split(EDITABLE_CELL_ID_VAL_DELIMITER); if(cellIds.length == 2 && cellIds[0]== pattern) { return true; } } return false; } function highlightRecentlyEditedCells(tableId) { var cellValue = document.getElementById(tableId + "cellValue"); var entries = cellValue.value.split(EDITABLE_CELL_CELL_DELIMITER); var count = entries.length; var counter = 0; var minEntries = Math.min(count, 5); for (var i=0;i< count-1 ;i++) { var cellEntry = entries[i].split(EDITABLE_CELL_ID_VAL_DELIMITER); var cellId = cellEntry[0]; var cell = document.getElementById(cellId); if (cell == null) { continue; } if (cell.childNodes(0).nodeName =="TABLE") { cell = cell.childNodes(0).cells(0); } if ( counter < minEntries) { cell.style.fontWeight="bold"; cell.style.fontStyle ="italic"; counter = counter + 1; } else { cell.style.fontWeight="normal"; cell.style.fontStyle ="normal"; } } } function replaceValue (source, cellId, value) { var cellIndex = getCellIndex(source,cellId); if(cellIndex != -1) { var firstString = source.substring(0,cellIndex); var secondString = source.substring(cellIndex); var tempIndex = secondString.indexOf(EDITABLE_CELL_CELL_DELIMITER); if (tempIndex != -1 ) { secondString = secondString.substring(tempIndex); } source = firstString + cellId + EDITABLE_CELL_ID_VAL_DELIMITER + value + secondString; } return source; } function removeValue (source, cellId) { var cellIndex = getCellIndex(source,cellId); if(cellIndex != -1 ) { var firstString = source.substring(0,cellIndex); var secondString = source.substring(cellIndex); var tempIndex = secondString.indexOf(EDITABLE_CELL_CELL_DELIMITER); if (tempIndex != -1 ) { secondString = secondString.substring(tempIndex); } source = firstString + secondString; } //bring the cell back to normal var cell = document.getElementById(cellId); cell.style.fontWeight="normal"; cell.style.fontStyle ="normal"; //remove the pencil image if required var cells = cell.parentNode.cells;; var cellLength = cells.length; var tempCellId; var removeImage = true; for(var m=0;m 0) { currentBodyWidth = currentBodyWidth * (widthForJSAdjust/basicWidthIndex); currentBodyWidth = currentBodyWidth - 8; stateHolder.maxWidth = currentBodyWidth; } else { stateHolder.maxWidth = currentBodyWidth; } } stateHolder.xAdjustment = 3; if(isPageExist) { stateHolder.yAdjustment = 10; } else { stateHolder.yAdjustment = 8; } toggleTab(id, activeTabNumber); setTimeout("doRest('" + id + "'," + numberOfTabs + ", " + activeTabNumber +")",100); } function doRest(id,numberOfTabs, activeTabNumber){ arrangeTabs(id,numberOfTabs, activeTabNumber); var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); if (stateHolder.startTab != null) { showHideTabs(id); var controlPanel = document.getElementById(id+"_controlPanel"); if (stateHolder.maxPanelLeft == null) { stateHolder.maxPanelLeft = controlPanel.offsetLeft; } toggleTab(id,activeTabNumber); correctTabs(id,activeTabNumber); correctImages(id); } moveDummyHeader(); } function arrangeTabs(id, numberOfTabs, activeTabNumber) { var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); var maxWidth = stateHolder.maxWidth ; var median = 0; var start; var end; var i; for (i=eval(id +"start");i<=numberOfTabs; i++) { showTab(id+i); right = document.getElementById(id+i+"_right"); if ((right.offsetLeft + 100) > maxWidth) { median = i-1-eval(id +"start"); break; } } if (median == 0) { document.getElementById(id+"_controlPanel").style.display="none"; return; } median = Math.floor(median/2); start = activeTabNumber - median; end = activeTabNumber + median; var correction = 0; if (start < eval(id +"start")) { correction = eval(id +"start")-start; end = end + correction; start = eval(id +"start"); } if (end > numberOfTabs) { correction = end - numberOfTabs; start = start - correction; end = numberOfTabs; } stateHolder.startTab = start; stateHolder.endTab = end; } function tabMoveLeft(id) { var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); var start = stateHolder.startTab; var end = stateHolder.endTab; var numberOfTabs = stateHolder.nooftabs; if (end < numberOfTabs) { start = start + 1 ; end = end + 1; stateHolder.startTab = start ; stateHolder.endTab = end showHideTabs(id); } correctTabs(id); correctImages(id); } function tabMoveRight(id) { var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); var start = stateHolder.startTab; var end = stateHolder.endTab; var numberOfTabs = stateHolder.nooftabs; if (start > eval(id +"start")) { start = start - 1 ; end = end - 1; stateHolder.startTab = start; stateHolder.endTab = end; showHideTabs(id); } correctTabs(id); correctImages(id); } function showHideTabs(id) { var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); var start = stateHolder.startTab; var end = stateHolder.endTab; var numberOfTabs = stateHolder.nooftabs; var maxWidth = document.body.clientWidth; var i; for (i=eval(id +"start");i<=numberOfTabs; i++) { right = document.getElementById(id+i+"_right"); if (i >= start && i <= end ) { showTab(id+i); } else { hideTab(id+i); } } } function showTab(id) { document.getElementById(id+"_right").style.display=""; document.getElementById(id+"_middle").style.display=""; document.getElementById(id+"_left").style.display=""; var image = document.getElementById(id+"_image"); if(image != null) { document.getElementById(id+"_image").style.display=""; } } function hideTab(id ){ document.getElementById(id+"_right").style.display="none"; document.getElementById(id+"_middle").style.display="none"; document.getElementById(id+"_left").style.display="none"; var image = document.getElementById(id+"_image"); if(image != null) { document.getElementById(id+"_image").style.display="none"; } } function toggleTab(id, tabNumber) { var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); var numberOfTabs = stateHolder.nooftabs; var i; if (tabNumber < eval(id +"start")) { return; } for (i=eval(id +"start");i<=numberOfTabs; i++) { if (i == tabNumber) { selectTab(id+tabNumber); stateHolder.activeTabNumber = tabNumber; } else { unselectTab(id+i); } } var div = document.getElementById(id+"menu"); div.style.display="none"; } function selectTab(id) { var middle = document.getElementById(id+"_middle"); if (middle == null){ return; } var right = document.getElementById(id+"_right") var left = document.getElementById(id+"_left"); var image = document.getElementById(id+"_image"); var style; style = right.className; style = style.split(" ")[0]; right.className = style +" tabSelected"; style = middle.className; style = style.split(" ")[0]; middle.className = style +" tabSelected"; middle.getElementsByTagName("A")[0].id ="tabSelected"; if (image != null) { image.className = style +" tabSelected"; } style = left.className; style = style.split(" ")[0]; left.className = style +" tabSelected"; } function unselectTab(id) { var middle = document.getElementById(id+"_middle"); if (middle == null){ return; } var right = document.getElementById(id+"_right") var left = document.getElementById(id+"_left"); var image = document.getElementById(id+"_image"); var style; style = right.className; style = style.split(" ")[0]; right.className = style +" tabUnSelected"; style = middle.className; style = style.split(" ")[0]; middle.className = style +" tabUnSelected"; middle.getElementsByTagName("A")[0].id ="tabUnSelected"; if (image != null) { image.className = style +" tabUnSelected"; } style = left.className; style = style.split(" ")[0]; left.className = style +" tabUnSelected"; } function createTabMenu(id) { var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); var numberOfTabs = stateHolder.nooftabs; var i; var style, style1; var cell ; var start = stateHolder.startTab; var end = stateHolder.endTab; var tabNumber = stateHolder.activeTabNumber ; var onClickEvent ; var menuHTML = ""; for (i=eval(id +"start");i<=numberOfTabs; i++) { if (i == tabNumber) { img = ""; } else { img = " "; } if (i >= start && i<= end) { style ="selectedMenuContent"; style1="selectedEmptyCell"; } else { style ="unSelectedMenuContent"; style1="unSelectedEmptyCell"; } onClickEvent ="fireOnClick('" +id +"'," +i + ")"; cell = ""; menuHTML = menuHTML + "" + cell + ""; } menuHTML = menuHTML + "
" + img + "
"; menuHTML = menuHTML + document.getElementById(id+i+"_middle").innerText; menuHTML = menuHTML + "
"; var frame = document.getElementById(id + "menu"); var controlPanel = document.getElementById(id+"_controlPanel"); frame.innerHTML = menuHTML; frame.style.display=""; frame.style.zIndex=200; frame.style.height= 250; if(APPLICATION_NAME != null && APPLICATION_NAME == "ExceedPortalServer") { frame.style.left = (controlPanel.offsetLeft + controlPanel.offsetWidth - frame.offsetWidth + 10); } else { frame.style.left = (controlPanel.offsetLeft + controlPanel.offsetWidth - frame.offsetWidth - stateHolder.xAdjustment); } frame.style.left = (controlPanel.offsetLeft + controlPanel.offsetWidth - frame.offsetWidth - stateHolder.xAdjustment); //frame.style.top = controlPanel.offsetTop + controlPanel.offsetHeight + stateHolder.yAdjustment; var pageCorrection = 0; if (isPageExist) { pageCorrection = document.getElementById("breadcrumbdiv").scrollTop; } else { pageCorrection = document.body.scrollTop; } //frame.style.top = event.y + pageCorrection + stateHolder.yAdjustment; if(APPLICATION_NAME != null && APPLICATION_NAME == "ExceedPortalServer") { frame.style.top = controlPanel.offsetTop + controlPanel.offsetHeight + 30; } else { frame.style.top = event.y + pageCorrection + stateHolder.yAdjustment; } } function hideMenu(id) { var div = document.getElementById(id+"menu"); if(div.canShow==1) { div.canShow=0; div.style.display="none"; } } function prepareMenuTohide(id) { var div = document.getElementById(id+"menu"); div.canShow=1; div.style.cursor="hand"; } function fireOnClick(id,tabNumber) { var tab = document.getElementById(id+tabNumber+"_middle"); var anchor =tab.getElementsByTagName('A')[0]; var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); stateHolder.activeTabNumber = tabNumber; var numberOfTabs = stateHolder.nooftabs; anchor.fireEvent("onclick"); var href = anchor.href; if (href!=null) { if (href.indexOf("java") != -1) { var colonIndex = href.indexOf(":"); var scriptName = href.substring(colonIndex+1); eval(scriptName); } } scrollableTab(id, numberOfTabs, tabNumber); } function correctTabs(id, mustTabNumber) { var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); var maxPanelLeft = stateHolder.maxPanelLeft; var controlPanel = document.getElementById(id+"_controlPanel"); showHideTabs(id); var done=false; while(!done) { var endtab = document.getElementById(id+stateHolder.endTab+"_right"); if((endtab.offsetLeft + 100) > controlPanel.offsetLeft) { if (mustTabNumber != null) { if(mustTabNumber <= stateHolder.endTab -1) { stateHolder.endTab = stateHolder.endTab -1; } else { stateHolder.startTab = stateHolder.startTab + 1; } } else { stateHolder.endTab = stateHolder.endTab -1; } } else { done = true; } showHideTabs(id); } } function correctImages(id) { var controlPanel = document.getElementById(id+"_controlPanel"); var rightArrowImage = document.getElementById(id+"rightArrow"); var leftArrowImage = document.getElementById(id+"leftArrow"); var stateHolder = document.getElementById(id+eval(id +"start")+"_left"); if (stateHolder.startTab > eval(id +"start")) { leftArrowImage.src = imageDirectory + "/t_single_arrow_left.gif"; } else { leftArrowImage.src = imageDirectory + "/t_single_arrow_left_disabled.gif"; } if (stateHolder.endTab < stateHolder.nooftabs) { rightArrowImage.src = imageDirectory + "/t_single_arrow_right.gif"; } else { rightArrowImage.src = imageDirectory + "/t_single_arrow_right_disabled.gif"; } } function adjustSizeAfterCollapse(scrollHeightFromTable,scrollWidthFromTable,tableID) { var x = document.getElementById(tableID+"div"); var tableData = document.getElementById("data"+tableID); var z = document.getElementById(tableID); var dataRows = tableData.rows; var rowHeights=0; for(var i=0;i elements. //if anchor href not points to same page, then message box will be shown. function unloadPage() { try { if (isParent && document.frames("content")!= null) { if(document.frames("content").window.isPageDirty()) { if((eventHandler != null && eventHandler.href != null && eventHandler.href.indexOf("#") == -1 && eventHandler.href.indexOf("/") != -1 && eventHandler.href.indexOf("java") == -1)) { if (displayMessage("datanotsaved",2)== "Yes"){ eventHandler = null; return false; } } } } else if (isPageDirty()) { if(eventHandler != null && eventHandler.href != null && eventHandler.href.indexOf("#") == -1 && eventHandler.href.indexOf("/") != -1 && eventHandler.href.indexOf("java") == -1) { if (displayMessage("datanotsaved",2)== "Yes"){ eventHandler = null; return false; } } } }catch(e) { } eventHandler = null; } //Stores the last event hanlder because it's not available in the onbeforeunload event function storeEventSource() { eventHandler = window.event.srcElement; return true; } // return true if the editable table cells are edited but not saved. function isPageDirty() { var ids = tableIds.split("&"); var noOfTables = ids.length; var index ; for(index=0;index < noOfTables ;index++) { table = document.getElementById(ids[index]); if (table!= null && table.isDirty != null && table.isDirty) { return true; } } return false; } function goBack() { var breadcrumbContent = document.getElementById('breadcrumbsContent'); if(breadcrumbContent !=null) { var anchors =breadcrumbContent.getElementsByTagName("A"); var elementCount= anchors.length; if (elementCount > 0) { window.location.href= anchors[elementCount - 1].href; } } } function encodeURL(url, canNavigate) { if (url == null) { return url; } var finalurl = url; /* ???? ????(?????????? ???? ???? ??????????) var finalurl ; var firstLevel = url.split("?"); finalurl = firstLevel[0] + "?"; if (firstLevel.length == 2) { var secondLevel = firstLevel[1].split("&"); var thirdLevel = secondLevel[0].split("="); finalurl = finalurl + thirdLevel[0]; var parameter =""; for (var k =1; k 0) { eval(searchAction); } } function adjustTransferBoxWidth (id,scrollWidth) { //alert('adjustTransferBoxWidth' + 'id '+ id + 'scrollWidth' + scrollWidth); var table = document.getElementById(id); //alert('table width' +table.style.width); //alert('isPageExist ' +isPageExist); var newWidth=0; if(isPageExist) { table.style.width = (document.body.clientWidth * scrollWidth)/860; } else { // alert('else'+'document.body.clientWidth '+ document.body.clientWidth ); // table.style.width = document.body.clientWidth * (scrollWidth/noPageWidth); newWidth = document.body.clientWidth * (scrollWidth/1004); table.style.width = newWidth; // alert('newWidth' +newWidth); } } function showLastElementTransfer(id1,id2,id3) { return; //alert('id1 ' + id1); //alert('id2' + id2); //alert('id3 ' + id3); var scrollExists = false; //var divElement = document.getElementById(id+"div"); //alert('divElement.id ' +divElement.id); var selectElement1 = document.getElementById(id1); var divElement1 = selectElement1.parentNode; var selectElement2 = document.getElementById(id2); var divElement2 = selectElement2.parentNode; var selectElement3=null; var divElement3; //alert('first' + typeof(id3)); if(typeof(id3) != "undefined" ) { selectElement3 = document.getElementById(id3); divElement3 = selectElement3.parentNode; } if(divElement1.scrollWidth > divElement1.clientWidth || divElement2.scrollWidth > divElement2.clientWidth) { scrollExists = true; } //alert('third' + selectElement3); if(selectElement3 != null) { //alert('3 exists'); if(divElement3.scrollWidth > divElement3.clientWidth) { scrollExists = true; } } //alert('selectElement.option(1).style.width ' + selectElement.options(5).innerText.style.width+' selectElement.option(1).innerText ' +selectElement.options(1).innerText); if(scrollExists) { // alert('inside'); if(selectElement3 != null) { divElement1.style.height=divElement1.offsetHeight+32; selectElement1.size = selectElement1.size +1; } else { divElement1.style.height=divElement1.offsetHeight+16; } divElement2.style.height=divElement2.offsetHeight+16; if(selectElement3 != null) { divElement3.style.height=divElement3.offsetHeight+16; } } } function handleEnterKey(funcName){ if(event.keyCode== 13){ eval(funcName); } } function adjustMenu() { var mainapp = document.getElementById("PAD_main app"); if(mainapp != null) { var secondDiv = mainapp.getElementsByTagName("DIV")[1]; if(secondDiv.offsetWidth > 160) { secondDiv.style.width="158px"; secondDiv.style.overflow="auto"; secondDiv.style.height=secondDiv.offsetHeight + 16; } } var applicationmenu = document.getElementById("PAD_applicationmenu"); if(applicationmenu != null) { var secondDiv = applicationmenu.getElementsByTagName("DIV")[1]; if(secondDiv.offsetWidth > 160) { secondDiv.style.width="158px"; secondDiv.style.overflow="auto"; secondDiv.style.height=secondDiv.offsetHeight + 16; } } var taskmenu = document.getElementById("PAD_taskmenu"); if(taskmenu != null) { var secondDiv = taskmenu.getElementsByTagName("DIV")[1]; if(secondDiv.offsetWidth > 160) { secondDiv.style.width="158px"; secondDiv.style.overflow="auto"; secondDiv.style.height=secondDiv.offsetHeight + 16; } } } function adjustScrollBarTransferBox(source, destination,destination1,threeBoxCase) { //alert('called'); //alert(source.id); if(threeBoxCase == false) { var sourceDiv = source.parentNode; var destinationDiv = destination.parentNode; var sourceDivWidth = sourceDiv.scrollWidth; var destinationDivWidth = destinationDiv.scrollWidth; var sourceTD = source.parentNode.parentNode; var sourceTDWidth = sourceTD.offsetWidth; var destinationTD = destination.parentNode.parentNode; var destinationTDWidth = destinationTD.offsetWidth; //alert('source.offsetHeight ' +source.offsetHeight); //alert('sourceDiv.style.height '+ sourceDiv.style.height); source.size = eval("transferBoxSizeFromJava_"+source.id); // alert('source.offsetHeight ' +source.offsetHeight); if(source.options.length > (eval("transferBoxSizeFromJava_"+source.id))) { sourceDiv.style.height=source.offsetHeight; source.size = source.options.length; } else { sourceDiv.style.height=source.offsetHeight; } destination.size = eval("transferBoxSizeFromJava_"+source.id); // alert('destination.offsetHeight ' +destination.offsetHeight); if(destination.options.length > eval("transferBoxSizeFromJava_"+source.id)) { destinationDiv.style.height=destination.offsetHeight; destination.size = destination.options.length; } else { destinationDiv.style.height=destination.offsetHeight; } if (sourceDivWidth > sourceTDWidth ) { // sourceDiv.style.height = sourceDiv.offsetHeight + 16; } /* else if(isPageExist) { if (destinationDivWidth > destinationTDWidth) { sourceDiv.style.height = sourceDiv.offsetHeight + 16; } }*/ if (destinationDivWidth > destinationTDWidth) { // alert('inside'); // destinationDiv.style.height = destinationDiv.offsetHeight +16; } /* else if(isPageExist) { if (sourceDivWidth > sourceTDWidth) { destinationDiv.style.height = destinationDiv.offsetHeight +16; } }*/ } else { // alert('inside'); var sourceDiv; var destinationDiv; var sourceDivWidth; var destinationDivWidth; var sourceTD; var sourceTDWidth; var destinationTD; var destinationTDWidth; var destination1Div; var destination1DivWidth; var destination1TD; var destination1TDWidth; if(source != " ") { sourceDiv = source.parentNode; sourceDivWidth = sourceDiv.scrollWidth; sourceTD = source.parentNode.parentNode; sourceTDWidth = sourceTD.offsetWidth; } if(destination != " ") { destinationDiv = destination.parentNode; destinationDivWidth = destinationDiv.scrollWidth; destinationTD = destination.parentNode.parentNode; destinationTDWidth = destinationTD.offsetWidth; } if(destination1 != " ") { destination1Div = destination1.parentNode; destination1DivWidth = destination1Div.scrollWidth; destination1TD = destination1.parentNode.parentNode; destination1TDWidth = destinationTD.offsetWidth; } var transferBoxSizeFromJava = eval("transferBoxSizeFromJava_"+source.id) source.size = (transferBoxSizeFromJava*2)+5; if(source.options.length > ((transferBoxSizeFromJava*2)+5) ) { /* if(sourceDiv.style.width - destinationDiv.style.width > 5 ) { sourceDiv.style.height=source.offsetHeight+32; } else {*/ sourceDiv.style.height=source.offsetHeight; // } source.size = source.options.length; } else { sourceDiv.style.height=source.offsetHeight; } destination.size = transferBoxSizeFromJava; if(destination.options.length > transferBoxSizeFromJava) { destinationDiv.style.height=destination.offsetHeight; destination.size = destination.options.length; } else { destinationDiv.style.height=destination.offsetHeight; } if (sourceDivWidth > sourceTDWidth) { // alert('settng'); // sourceDiv.style.height = sourceDiv.offsetHeight + 16; } if (destinationDivWidth > destinationTDWidth) { // destinationDiv.style.height = destinationDiv.offsetHeight + 16; } if(destination1 != " ") { destination1.size = transferBoxSizeFromJava; if(destination1.options.length > transferBoxSizeFromJava) { destination1Div.style.height=destination1.offsetHeight; destination1.size = destination1.options.length; } else { destination1Div.style.height=destination1.offsetHeight; } if (destination1DivWidth > destination1TDWidth) { // destination1Div.style.height = destination1Div.offsetHeight + 16; } } } } function toggleGanttChart(img, tableId, width) { var table = document.getElementById(tableId); if(table.style.display=="") { img.src = imageDirectory + "/container_expand.gif"; table.style.display="none"; document.getElementById("parent"+tableId).style.width=width +"px"; } else { img.src = imageDirectory +"/container_collapse.gif"; table.style.display=""; } } // ///////////////////////////// ???? ???? ////////////////////////////////////// function gns_cd_check(url, objValue) { if(trim(objValue) == "") { // cd?? ???? ?????? nm?? ???? ????????. var objName = event.srcElement.name; var len = objName.length; var obj = objName.substring(0, len - 3)+"_nm"; if(eval("document.gnsForm."+objName.substring(0, len - 3)+"_nm") == null) { obj = objName.substring(0, len - 3)+"_no"; } eval("document.gnsForm."+obj+".value = '';"); return; } ctl.location.href = url; } function trim(obj) { var checkValue = ""; var v = obj; var len = v.length; for(i = 0; i < len; i++) { v2 = v.substring(i, i+1); if(v2 != " ") { checkValue = v.substring(i, len); break; } } for(i = len; i >= 0; i--) { v2 = v.substring(i, i-1); if(v2 != " ") { checkValue = v.substring(i, 0); break; } } return checkValue; } /* ?????? ?????????? ???????? */ function setDt(obj) { if(obj == null) { return; } today = new Date(); year = today.getFullYear(); month = today.getMonth()+1; date = today.getDate(); if ( month < 10) month = "0"+month; if ( date < 10) date = "0"+date; obj.value = year+"-"+month+"-"+date; } /* ?????? ?????? obj?? ????????. */ function setTm(obj) { var toDay = new Date(); var hours = toDay.getHours(); var minutes = toDay.getMinutes(); if(hours < 10) hours = "0"+hours; if(minutes < 10) minutes = "0"+minutes; obj.value = hours+":"+minutes; } /* 2005-07-29 ?????? tr ???? ?????? ???????? ?????????? ???? tr?? rowIndex, tr object?? ???????? ?????? ?????? ????????. ex) td???? ???? tr_click(parentElement.parentElement.rowIndex, parentElement.parentElement) tr ?????? tr_click(rowIndex, this) */ function tr_click(idx, obj) { doc = document.gnsForm; var len = doc.check.length; if(!isNaN(len)) { doc.check[idx-1].checked = true; highlightRow ((obj.id+""), doc.check[idx-1] ,idx); } else { doc.check.checked = true; highlightRow ((obj.id+""), doc.check ,idx); } } //???????? ?????? token?? ?? ?????? ???? function strToken(v, token) { //alert("aaa"); var checkValue = ""; var len = v.length; for(i = 0; i < len; i++) { v2 = v.substring(i, i+1); if(v2 != token) { checkValue += v2; } } return checkValue; } // ???? ???????? ???? ???? ?????? ???? // ??: js_validate_date( 2001, 02, 30): return false function js_validate_date( pyy, pmm, pdd) { var daysOfMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31); var daysOfmm; if (pmm < 1 || pmm > 12) { return false; } if(pmm == 2 && ( ( (pyy%4)==0 && (pyy%100)!= 0 ) || (pyy%400) == 0)) { daysOfmm=29; } else { daysOfmm=daysOfMonth[pmm-1]; } if ( pdd < 1 || pdd > daysOfmm) { return false; } return true; } // ?????? ???? ???? // ??: " function js_date_format( obj ) { var objEd = obj; strDate = objEd.value; if ( strDate.length == 0) { return; } if ( strDate.indexOf("-", 0) != -1 || strDate.length != 8 ) { alert("Invalid date :" + strDate); objEd.focus(); return ; } yy = strDate.substr(0,4); mm = strDate.substr(4,2); dd = strDate.substr(6,2); if ( js_validate_date( yy, mm, dd ) == false ) { alert("Invalid date :" + strDate); objEd.focus(); return ; } objEd.value = yy+"-"+mm+"-"+dd; } // ?????? ???? ???? // ??: " function js_date_input( obj ) { val = ""; var objEd = obj; strDate = objEd.value; i = strDate.indexOf("-", 0) if ( i == -1 ) return ; val = strDate.substring(0,i); ii = strDate.lastIndexOf("-",strDate.length-1); if ( ii == -1 ) { val = val + strDate.substr(ii+1); } else { val = val + strDate.substring(i+1,ii) + strDate.substr(ii+1); } objEd.value = val; } // ???? ?????? ???? // ??: js_validate_time( 24, 00): return false function js_validate_time( phh, pmm) { if (phh < 0 || phh > 23) { return false; } if ( pmm < 0 || pmm > 59) { return false; } return true; } // ?????? ???? ???? // ??: " function js_time_format( obj ) { obj.value = obj.value.replace(/\s/g, ""); var objEd = obj; strTime = objEd.value; if ( strTime.length == 0) { return; } if ( strTime.indexOf(":", 0) != -1 || strTime.length != 4 ) { alert("Invalid time :" + strTime); objEd.focus(); return ; } hh = strTime.substr(0,2); mm = strTime.substr(2,2); if ( js_validate_time( hh, mm ) == false ) { alert("Invalid time :" + strTime); objEd.focus(); return ; } objEd.value = hh+":"+mm; } // ?????? ???????? ???? // ??: " function js_time_input( obj ) { val = ""; var objEd = obj; strTime = objEd.value; i = strTime.indexOf(":", 0) if ( i == -1 ) return ; val = strTime.substring(0,i)+strTime.substring(i+1); objEd.value = val; objEd.select(); } /* checkbox?? check ???? ?????? ????????. ex) doc = document.gnsForm; var T = checkedCheck(doc.check); if(T == "FALSE") { displayAdminMessage("ce.msg.auto_dispatch.check.f", 3); return; } */ function checkedCheck(obj) { if(obj == null) { return "FALSE"; } var len = obj.length; var T = "FALSE"; if(!isNaN(len)) { for(i = 0; i < len; i++) { if(obj[i].checked == true) { T = "TRUE"; break; } } } else { if(obj.checked == true) { T = "TRUE"; } } return T; } /* ?????? row?? checkBox/radio?? ???????? ?????? ?????? ????????. onClick = "highlightRow_(document.gnsForm.check, this, rowIndex)" */ function highlightRow_(check, obj, idx) { var len = check.length; if(!isNaN(len)) { check[idx-1].checked = true; highlightRow ((obj.id+""), check[idx-1] ,idx); } else { check.checked = true; highlightRow ((obj.id+""), check ,idx); } } function js_intFormat( obj ) { strInt = ""+obj.value; strInt = strInt.replace(/\s/g, ""); // ???????? var rst = ""; var j = 0; cnt = strInt.length; if ( cnt == 0) { return "0"; } for (i=cnt; i>0; i--) { aa = strInt.substring(i-1,i); if ((j != "0") && (j%3 == "0")) { rst = aa + "," + rst; } else { rst = aa + rst; } j = j+1; } obj.value = rst ; } /* ?? ?? : ?????? ????????. ???? : x_, y_; */ function calender_open(iName, div_nm, box_nm, idx, ca_nm, url, x_, y_) { x = event.x; y = event.y; if(y > 295) { y = 280; } iName.style.top = y+y_; iName.style.left = x+x_; iName.style.visibility = "visible"; url = url + "?target="+box_nm+"&div_nm="+div_nm; // url = "../common/calendar.jsp?target="+box_nm+"&div_nm="+div_nm; ca_nm.location.href = url; iName.focus(); } function intStr(obj) { var checkValue = ""; var v = obj.value; var len = v.length; for(i = 0; i < len; i++) { v2 = v.substring(i, i+1); if(v2 != ",") { checkValue += v2; } } if(checkValue == "0") { checkValue = ""; } obj.value = checkValue; obj.focus(); } function onlyInt() { if( event.keyCode < 48 || event.keyCode > 57) { event.keyCode=0; } } //year ???????? function load_year(obj) { today = new Date(); yr = today.getYear(); yr2 = yr -5; b = false; for(i = 0 ; i < 10; i++) { yr2 = yr2 +1; if(yr == yr2) { b = true; } var opt = new Option(yr2, yr2, b, b); document.getElementById(""+obj+"").options[i] = opt; b = false; } } //month ???????? function month_list(obj) { today = new Date(); m = today.getMonth(); b = false; for ( var i = 1; i <= 12; i++) { if(i == m) { b = true; } else { b = false; } var opt = new Option(i+"????",i, b, b); document.getElementById(""+obj+"").options[i] = opt; } } /* * Returns a new XMLHttpRequest object, or false if this browser * doesn't support it */ function newXMLHttpRequest() { var xmlreq = false; if (window.XMLHttpRequest) { // Create XMLHttpRequest object in non-Microsoft browsers xmlreq = new XMLHttpRequest(); } else if (window.ActiveXObject) { // Create XMLHttpRequest via MS ActiveX try { // Try to create XMLHttpRequest in later versions // of Internet Explorer xmlreq = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e1) { // Failed to create required ActiveXObject try { // Try version supported by older versions // of Internet Explorer xmlreq = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { // Unable to create an XMLHttpRequest with ActiveX } } } return xmlreq; }