//- Console_AddRemove -// function Console_AddRemove(oFromSet, oToSet, bIsAll) { //+ unselect for (var hOption = 0; hOption < oToSet.length; hOption++) { oToSet.options[hOption].selected = false; } //+ move for (hOption = oFromSet.length; hOption != 0; hOption--) { if ((bIsAll == true) || (oFromSet.options[hOption - 1].selected == true)) { oToSet.options[oToSet.length] = new Option(oFromSet.options[hOption - 1].text, oFromSet.options[hOption - 1].value, false, true); oFromSet.options[hOption - 1] = null; } } } //- Console_Pack -// function Console_Pack(oSet, oField) { var cPack = ''; for (var hOption = 0; hOption < oSet.length; hOption++) { cPack += ',' + oSet.options[hOption].value; } oField.value = cPack.substring(1); } //- IfEnterAction -// function IfEnterAction(oEvent, oForm, cAction, cSelId){ if ((EventKeyCode(oEvent) == 13) || (EventKeyCode(oEvent) == 3)) { oForm.Action.value = cAction; oForm.SelId.value = cSelId; oForm.submit(); return false; } return true; } //- IfEnterScript -// function IfEnterScript(oEvent, cScript) { if ((EventKeyCode(oEvent) == 13) || (EventKeyCode(oEvent) == 3)) { eval(cScript); return false; } return true; } //- EventKeyCode -// function EventKeyCode(oEvent) { return ((oEvent != null) && (oEvent.which != null) ? oEvent.which : event.keyCode); } //- PrintThis -// function PrintThis() { var ua = navigator.userAgent.toLowerCase(); var is_mac = ua.indexOf('mac') > 0; if (is_mac) { alert('To print:\n\nUse Command + P. on your keyboard\n') } else { print(); } } //- ToggleCriteriaView -// function ToggleCriteriaView(cBlock, cFieldName, cCriteria) { var oElement = document.getElementById(cBlock); var oField = document.getElementById(cFieldName); if (oField) { switch (oField.type) { case 'checkbox': { var cValue = oField.checked.toString(); break; } case 'radio': { var cValue = oField.checked.toString(); break; } default: { var cValue = oField.value; break; } } //switch var bIsTrue = false; if (cCriteria.indexOf('|') >= 0) { var cArray = cCriteria.split('|'); for (i = 0; i < cArray.length; i++) { if ((cArray[i].length > 0) && (cArray[i][0] == '!')) { if (cValue != cArray[i].substr(1, cArray[i].length)) { bIsTrue = true; break; } } else if (cValue == cArray[i]) { bIsTrue = true; break; } } } else { //alert(cValue); //alert(cCriteria); if (cCriteria.indexOf('!') >= 0) { if (cValue != cCriteria.substr(1, cCriteria.length)) { bIsTrue = true; } } else if (cValue == cCriteria) { bIsTrue = true; } } oElement.style.display = (bIsTrue == true) ? 'block' : 'none'; } } //function //- AutoTab -// function AutoTab(cInput, nSize, cEvent) { var bIsNetscape = (navigator.appName.indexOf("Netscape") != -1); var cKey = (bIsNetscape) ? cEvent.which : cEvent.keyCode; var cKeyArray = (bIsNetscape) ? [0,8,9,16] : [0,8,9,16,17,18,37,38,39,40,46]; if(cInput.value.length >= nSize && !GetElement(cKeyArray, cKey)) { cInput.value = cInput.value.slice(0, nSize); if (cInput.form[(GetIndex(cInput)+1)].type != 'hidden') { cInput.form[(GetIndex(cInput)+1) % cInput.form.length].focus(); } } function GetElement(cKeyArray, cKey) { var bIsExist = false; var nToken = 0; while(!bIsExist && nToken < cKeyArray.length) { if(cKeyArray[nToken] == cKey) { bIsExist = true; } else { nToken++; } } return bIsExist; } function GetIndex(cInput) { var nIndex = -1; var nToken = 0; while (nToken < cInput.form.length && nIndex == -1) { if (cInput.form[nToken] == cInput) { nIndex = nToken; } else { nToken++; } } return nIndex; } return true; }//function