123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
/* HPE - News Portal Engine Copyright (C) 2000-2001 Mike Krus READ LICENSE.TXT IN THE BASE DIRECTORY FOR INFORMATION ABOUT REDISTRIBUTING THIS SOURCE CODE ----- Orinigal code from http://www.geekboys.org/ */ var docObjName = (document.all) ? "document.all." : "document."; var lastCols = 2; var curCol = -1; function setCol(colNum) { curCol = colNum; // alert(curCol); } function moveLeft() { if(curCol == -1) { alert(strNoSelect); return; } if (curCol==0) { moveCol(curCol,lastCols); } else { moveCol(curCol,curCol-1); } } function moveRight() { if(curCol == -1) { alert(strNoSelect); return; } if (curCol==lastCols) { moveCol(curCol,0); } else { moveCol(curCol,curCol+1); } } function moveUp() { if(curCol == -1) { alert(strNoSelect); return; } moveRow(curCol, true); } function moveDown() { if(curCol == -1) { alert(strNoSelect); return; } moveRow(curCol, false); } function moveRow(colNum, up) { var colObj = eval(docObjName + "form.col" + colNum); var colOptObj = colObj.options; var colOptLen = colOptObj.length; var selectedIndex = colObj.selectedIndex; var fromIndex = selectedIndex; var toIndex = -1; if (up==true) { if (selectedIndex == 0) { toIndex = colOptLen-1; } else { toIndex = fromIndex - 1; } } else { if (selectedIndex == (colOptLen-1)) { toIndex = 0; } else { toIndex = fromIndex + 1; } } var fromSelectedValue = colOptObj[fromIndex].value; var fromSelectedText = colOptObj[fromIndex].text; var toSelectedValue = colOptObj[toIndex].value; var toSelectedText = colOptObj[toIndex].text; if (selectedIndex != -1) { colOptObj[toIndex].value = fromSelectedValue; colOptObj[toIndex].text = fromSelectedText; colOptObj[fromIndex].value = toSelectedValue; colOptObj[fromIndex].text = toSelectedText; } colObj.selectedIndex = toIndex; } function moveCol(fromColNum, toColNum) { var fromCol = "col" + fromColNum; var toCol = "col" + toColNum; var formName = "form"; var fromColObj = eval(docObjName + formName + "." + fromCol); var fromColOptObj = fromColObj.options; var toColObj = eval(docObjName + formName + "." + toCol); var toColOptObj = toColObj.options; var fromColLen = fromColOptObj.length; var toColLen = toColOptObj.length; /* if (fromColLen <= 1) { alert('Cannot remove all items.'); return; } */ var selectedIndex = fromColObj.selectedIndex; var selectedValue; var selectedText; if (selectedIndex != -1) { selectedValue=fromColOptObj[selectedIndex].value; if (selectedValue=='-') { return; } selectedText=fromColOptObj[selectedIndex].text; fromColOptObj[selectedIndex] = null; toColOptObj.length += 1; toColOptObj[toColLen].value=selectedValue; toColOptObj[toColLen].text=selectedText; toColObj.selectedIndex = toColOptObj.length-1; fromColObj.selectedIndex = -1; curCol = toColNum; } }