var urlError=0; var urlStr = ""; function newConfirm(title,mess,icon,defbut,mods) { icon = (icon==0) ? 0 : 2; defbut = (defbut==0) ? 0 : 1; retVal = makeMsgBox(title,mess,icon,4,defbut,mods); return (retVal==6); } function goCancel() { popUpWindow(350, 350, 350, 100); } function popUpWindow(left, top, width, height){ popUpWin = open('cancel_confirm.htm', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); popUpWin.focus(); } function popUpWindowAdv(left, top, width, height, URLstr){ popUpWin = open('cancel_confirmAdv.htm?'+URLstr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); popUpWin.focus(); } function popUpWindowSecu(left, top, width, height){ popUpWin = open('cancel_confirmSecu.htm', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); popUpWin.focus(); } var popUpWin=0; function popUpWindowWire(left, top, width, height){ if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); } popUpWin = open('cancel_confirmWire.htm', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); popUpWin.focus(); } function popUpWindowDel(left, top, width, height, Wan){ popUpWin = open('cancel_confirmDel.htm?'+Wan, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); popUpWin.focus(); } function popUpWindowRDel(left, top, width, height, Route){ popUpWin = open('cancel_confirmRDel.htm?'+Route, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); popUpWin.focus(); } function popUpWindowDis(left, top, width, height){ popUpWin = open('cancel_confirmDis.htm', 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); popUpWin.focus(); } function goSecuCancel() { popUpWindowSecu(350, 350, 350, 100); } function goBack() { history.go(-1); } function goAdvHelp(url) { helpwin = window.open(url, 'help', 'scrollbars=yes,width=450,height=200,resizable=no'); helpwin.focus(); } function IpAddr4Check(Ipn) { if(isNaN(Ipn.value)==true || Ipn.value == '') { alert('"' + Ipn.value + '" is an invalid digit.'); return false; } var ip = parseInt(Ipn.value); if(ip <= 0 || ip >= 255) { alert('"' + ip + '" is out of range [1-254]'); return false; } return true; } function IpAddrCheck(Ipn) { if(isNaN(Ipn.value)==true || Ipn.value == '') { alert('"' + Ipn.value + '" is an invalid digit.'); return false; } var ip = parseInt(Ipn.value); if(ip < 0 || ip > 255) { alert('"' + ip + '" is out of range [0-255]'); return false; } return true; } function isHexaDigit(digit) { var hexVals = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "a", "b", "c", "d", "e", "f"); var len = hexVals.length; var i = 0; var str; for ( i = 0; i < len; i++ ) { if ( digit == hexVals[i] ) { str = digit + " is equal to " + hexVals[i]; alert(str); return true; } } str = digit + " is invalid HexDigit"; alert(str); return false; } function isValidKey(val, size) { var len = val.length; if(len!=size) return false; for ( i = 0; i < len; i++ ) { if ( isHexaDigit(val.charAt(i)) == false ) return false; } return true; } function isValidIpAddress(address) { var i = 0; if ( address == '0.0.0.0' || address == '255.255.255.255' ) return false; addrParts = address.split('.'); if ( addrParts.length != 4 ) return false; for (i = 0; i < 4; i++) { num = parseInt(addrParts[i]) if ( isNaN(num) ) return false; if ( num < 0 || num > 255 ) return false; } return true; } function isValidSubnetMask(address) { var i = 0; if ( address == '0.0.0.0' ) return false; addrParts = address.split('.'); if ( addrParts.length != 4 ) return false; for (i = 0; i < 4; i++) { num = parseInt(addrParts[i]) if ( isNaN(num) ) return false; if ( num < 0 || num > 255 ) return false; } return true; } function isValidMacAddress(address) { var c = ''; var i = 0, j = 0; if ( address == 'ff:ff:ff:ff:ff:ff' ) return false; addrParts = address.split(':'); if ( addrParts.length != 6 ) return false; for (i = 0; i < 6; i++) { for ( j = 0; j < addrParts[i].length; j++ ) { c = addrParts[i].toLowerCase().charAt(j); if ( (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ) continue; else return false; } } return true; } var hexVals = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"); var unsafeString = "\"<>%\\^[]`\+\$\,"; // deleted these chars from the include list ";", "/", "?", ":", "@", "=", "&" and # // so that we could analyze actual URLs function isUnsafe(compareChar) // this function checks to see if a char is URL unsafe. // Returns bool result. True = unsafe, False = safe { if ( unsafeString.indexOf(compareChar) == -1 && compareChar.charCodeAt(0) > 32 && compareChar.charCodeAt(0) < 123 ) return false; // found no unsafe chars, return false else return true; } function decToHex(num, radix) // part of the hex-ifying functionality { var hexString = ""; while ( num >= radix ) { temp = num % radix; num = Math.floor(num / radix); hexString += hexVals[temp]; } hexString += hexVals[num]; return reversal(hexString); } function reversal(s) // part of the hex-ifying functionality { var len = s.length; var trans = ""; for (i = 0; i < len; i++) trans = trans + s.substring(len-i-1, len-i); s = trans; return s; } function convert(val) // this converts a given char to url hex form { return "%" + decToHex(val.charCodeAt(0), 16); } function encodeUrl(val) { var len = val.length; var i = 0; var newStr = ""; var original = val; urlError = 0; for ( i = 0; i < len; i++ ) { if ( val.substring(i,i+1).charCodeAt(0) < 255 ) { // hack to eliminate the rest of unicode from this if (isUnsafe(val.substring(i,i+1)) == false) newStr = newStr + val.substring(i,i+1); else newStr = newStr + convert(val.substring(i,i+1)); } else { // woopsie! restore. alert ("Found a non-ISO-8859-1 character at position:" + (i+1) + ",\nPlease eliminate before continuing."); newStr = original; // short-circuit the loop and exit i = len; urlError = 1; } } return newStr; }