<!--
function confirmPrompt(RedirectURL, strMessage) {
  if (confirm(strMessage)) {
    document.location = RedirectURL;
  }
}

function openWin(windowURL, windowName, windowFeatures) 
{ 
	PopWindow=window.open( windowURL, windowName, windowFeatures );
	PopWindow.focus(); 
}

function trimStr(str) {
  while((str.length>0)&&(str.charAt(str.length-1)==" "))
    str=str.substring(0,str.length-1);
  while((str.length>0)&&(str.charAt(0)==" "))
    str=str.substring(1,str.length-1);
  return str;
}

function verifyIP (IPvalue) {
  
  errorString = "";
  theName = "IPaddress";

  var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
  var ipArray = IPvalue.match(ipPattern); 

  if (IPvalue == "0.0.0.0")
    errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
  else if (IPvalue == "255.255.255.255")
    errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
  if (ipArray == null)
    errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
  else {
    for (i = 0; i < 4; i++) {
	  thisSegment = ipArray[i];
	  if (thisSegment > 255) {
		errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
		i = 4;
	  }
	  if ((i == 0) && (thisSegment > 255)) {
		errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
		i = 4;
      }
    }
  }

  if (errorString == "") 
    return true;
  else {
    alert(errorString);
    return false;
  }
}

//-->
