109 lines
2.3 KiB
JavaScript
109 lines
2.3 KiB
JavaScript
//START NON-TRANSLATABLE
|
|
|
|
var defaultEmptyOK = false;
|
|
var reAlphanumeric = /^[a-zA-Z0-9]+$/;
|
|
var reHexadecimal = /^[a-fA-F0-9]+$/;
|
|
var reInteger = /^\d+$/ ;
|
|
|
|
var reValidName = /^[a-zA-Z$#@][a-zA-Z0-9._$#@]+$/;
|
|
var reValidAcc = /^[a-zA-Z$#@][a-zA-Z0-9_$#@]+$/;
|
|
|
|
|
|
function openNewWindow(theURL) {
|
|
aWindow = window.open(theURL, "custom", "");
|
|
if (aWindow != null) {
|
|
if (aWindow.opener == null) {
|
|
aWindow.opener = self;
|
|
}
|
|
}
|
|
aWindow.window.focus();
|
|
}
|
|
|
|
|
|
function isEmpty(s) {
|
|
return ((s == null) || (s.length == 0));
|
|
}
|
|
|
|
function isHexadecimal(s) {
|
|
var i;
|
|
if (isEmpty(s)) {
|
|
if (isHexadecimal.arguments.length == 1) {
|
|
return defaultEmptyOK;
|
|
} else {
|
|
return (isHexadecimal.arguments[1] == true);
|
|
}
|
|
} else {
|
|
return reHexadecimal.test(s) ;
|
|
}
|
|
}
|
|
|
|
function isAlphanumeric(s) {
|
|
var i;
|
|
if (isEmpty(s)) {
|
|
if (isAlphanumeric.arguments.length == 1) {
|
|
return defaultEmptyOK;
|
|
} else {
|
|
return (isAlphanumeric.arguments[1] == true);
|
|
}
|
|
} else {
|
|
return reAlphanumeric.test(s) ;
|
|
}
|
|
}
|
|
|
|
function isValidAcc(s) {
|
|
var i;
|
|
if (isEmpty(s)) {
|
|
if (isValidAcc.arguments.length == 1) {
|
|
return defaultEmptyOK;
|
|
} else {
|
|
return (isValidAcc.arguments[1] == true);
|
|
}
|
|
} else {
|
|
return reValidAcc.test(s) ;
|
|
}
|
|
}
|
|
|
|
function isValidName(s) {
|
|
var i;
|
|
if (isEmpty(s)) {
|
|
if (isValidName.arguments.length == 1) {
|
|
return defaultEmptyOK;
|
|
} else {
|
|
return (isValidName.arguments[1] == true);
|
|
}
|
|
} else {
|
|
return reValidName.test(s) ;
|
|
}
|
|
}
|
|
|
|
function isInteger(s) {
|
|
var i;
|
|
if (isEmpty(s)) {
|
|
if (isInteger.arguments.length == 1) {
|
|
return defaultEmptyOK;
|
|
} else {
|
|
return (isInteger.arguments[1] == true);
|
|
}
|
|
}
|
|
return reInteger.test(s);
|
|
}
|
|
|
|
function isValidIPAddress (address) {
|
|
var segment = address.split(".");
|
|
for (x=0; x < segment.length; x++) {
|
|
var checknum = eval(segment[x]);
|
|
if ((checknum < 0) || (checknum > 255)) {
|
|
segment[x]="xxx";
|
|
}
|
|
}
|
|
address = segment.join(".");
|
|
var valAddr = /^((([0-9-]){1,3})[\.]){3}(([0-9-]){1,3})$/;
|
|
return valAddr.test(address);
|
|
}
|
|
|
|
function selectRadio(num) {
|
|
document.form1.rad[num].checked = true;
|
|
}
|
|
|
|
//END NON-TRANSLATABLE
|