<!--
function SubmitBTN_onmouseup(objSrc, strType) {
    srcBackGround = 'url(/images/btn'+strType+'_1.gif)'
	objSrc.style.backgroundImage = srcBackGround;
}

function SubmitBTN_onmousedown(objSrc, strType) {
    srcBackGround = 'url(/images/btn'+strType+'_2.gif)'
    objSrc.style.backgroundImage = srcBackGround;
}

//-------------------------------------------------------------------------------------------------------------------

function confirmDelete(delUrl) {
  if (confirm("Are you sure you want to delete?")) {
    document.location = delUrl;
  }
}

//-------------------------------------------------------------------------------------------------------------------

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 emailCheck (emailStr) {

  var checkTLD=1;
  var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
  var emailPat=/^(.+)@(.+)$/;
  var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
  var validChars="\[^\\s" + specialChars + "\]";
  var quotedUser="(\"[^\"]*\")";
  var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
  var atom=validChars + '+';
  var word="(" + atom + "|" + quotedUser + ")";
  var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
  var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
  var matchArray=emailStr.match(emailPat);

  if (matchArray==null) {
    //alert("Email address seems incorrect (check @ and .'s)");
    return false;
  }

  var user=matchArray[1];
  var domain=matchArray[2];

  for (i=0; i<user.length; i++) {
    if (user.charCodeAt(i)>127) {
      //alert("Email address contains invalid characters.");
      return false;
    }
  }

  for (i=0; i<domain.length; i++) {
    if (domain.charCodeAt(i)>127) {
      //alert("Email address contains invalid characters.");
      return false;
    }
  }

  if (user.match(userPat)==null) {
    //alert("Email address doesn't seem to be valid.");
    return false;
  }

  var IPArray=domain.match(ipDomainPat);
  if (IPArray!=null) {
    for (var i=1;i<=4;i++) {
      if (IPArray[i]>255) {
        //alert("Email address is invalid!");
		return false;
      }
	}
	return true;
  }

  var atomPat=new RegExp("^" + atom + "$");
  var domArr=domain.split(".");
  var len=domArr.length;
  for (i=0;i<len;i++) {
    if (domArr[i].search(atomPat)==-1) {
      //alert("Email address does not seem to be valid.");
      return false;
    }
  }

  if (checkTLD && domArr[domArr.length-1].length!=2 && 
    domArr[domArr.length-1].search(knownDomsPat)==-1) {
    //alert("Email address must end in a well-known domain or two letter " + "country.");
    return false;
  }

  if (len<2) {
    //alert("Email address missing a hostname!");
    return false;
  }
  
  return true;
}

//-------------------------------------------------------------------------------------------------------------------

function ChngParentCombo(objParent, objChild, ItemArray) {
    if (objParent.value == '') {
        objChild.disabled = true;

        // Empty the second drop down box of any choices
        for (var q=objChild.options.length;q>=0;q--) objChild.options[q]=null;
    } else {
        objChild.disabled = false;

        // Empty the second drop down box of any choices
        for (var q=objChild.options.length;q>=0;q--) objChild.options[q]=null;

        var q=0;
        for (x=0 ; x < ItemArray.length ; x++) {
            if ( ItemArray[x][1] == objParent.value ) {
		        objChild.options[q] = new Option(ItemArray[x][2],ItemArray[x][0]);
		        q++
		    }
	    }
    }
}
//-->

