// Pop up a new window function PopNewWindow(targetURL, targetWin, targetHeight) { newWin=window.open(targetURL, targetWin, 'height=' + targetHeight + ',width=650,location=0,left=100,top=100,scrollbars=yes,menubars=no,toolbars=no,resizable=yes'); newWin.focus(); } // Validation function function ValidateNum(item,type) { var returnVal = false; var maxVal = 0xFFFFFFFF; var intVal; var strVal = item.value; var ch; var i; if( type == 'HEX' ) { for ( i = 0 ; i < strVal.length ; i++ ) { ch = strVal.charAt(i); if( (ch < '0' || ch > '9') && ( ch < 'a' || ch > 'f') && ( ch < 'A' || ch > 'F') ) { alert("Enter a Valid Hexadecimal Number"); return false; } } intVal= parseInt(item.value,16); } else { for ( i = 0 ; i < strVal.length ; i++ ) { ch = strVal.charAt(i); if(ch < '0' || ch > '9') { alert("Enter a Valid Number"); return false; } } intVal= parseInt(item.value,10) } if (isNaN(intVal) || intVal < 0 ) { return true; } else { switch(type) { case "U8" : maxVal = 0xFF; break ; case "U16" : maxVal = 0xFFFF; break; case "MAX_59": maxVal = 59; break; case "MAX_23": maxVal = 23; break; case "MAX_100": maxVal = 100; break; case "U32" : case "HEX" : default : maxVal = 0xFFFFFFFF; break; } if( item.value > maxVal ) { alert("Invalid Value Entered"); } else returnVal = true; } return returnVal; }