function GetParam(name)
{
   var start=location.search.indexOf("?"+name+"=");
   if (start<0) start=location.search.indexOf("&"+name+"=");
   if (start<0) return '';
   start += name.length+2;
   var end=location.search.indexOf("&",start)-1;
   if (end<0) end=location.search.length;
   var result=location.search.substring(start,end);
   var result='';
   for(var i=start;i<=end;i++) {
      var c=location.search.charAt(i);
      result=result+(c=='+'?' ':c);
   }
   return unescape(result);
}

function fnOpenModal(URL){
  window.showModalDialog(URL, "center:yes; edge:sunken")
}

function GetSelValue( element ) {
  var cValue = "";
  var n;

  for (n = 0; n < element.options.length; n++) {
    if (element.options[n].selected) {
      cValue = element.options[n].value;
    }
  }
  return cValue;
}

function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

function OpenNewPage(cboname)
{
  var oSelect = document.getElementById(cboname);
  for (var i = 0; i < oSelect.options.length; i++) {
     if ( oSelect.options[i].selected ) {
        window.open(oSelect.options[i].value);
     }
  }
}

function OpenSamePage(cboname)
{
  var oSelect = document.getElementById(cboname);
  for (var i = 0; i < oSelect.options.length; i++) {
     if ( oSelect.options[i].selected ) {
        location=oSelect.options[i].value;
     }
  }
}

function SetArticle()
{
  var oSelect = top.selector.document.getElementById("ArticleName");
  if ( oSelect.options[0].selected ) {
     alert("Please select an article!!");
  }
  else {
    for (var i = 1; i < oSelect.options.length; i++) {
       if ( oSelect.options[i].selected ) {
          top.content.location.href = oSelect.options[i].value;
       }
    }
  }
}

function CheckArticle()
{
  var cArticle;
  var cName = GetParam("article");
  if ( cName == "" ) {
  }
  else {
     var oSelect = top.selector.document.getElementById("ArticleName");
     for (i = 0; i < oSelect.options.length; i++) {
        cArticle = oSelect.options[i].value.toLowerCase();
        if (cArticle.indexOf(cName) >= 0) {
           oSelect[i].setAttribute("selected", true);
           top.content.location.href = oSelect.options[i].value;
        }
     }
  }
  return
}

function SetPage()
{
  var nopt = GetParam('pages');
  document.forms[0].CurrPage.value = nopt.substring(0,2);
  document.forms[0].MinPage.value = nopt.substring(2,4);
  document.forms[0].MaxPage.value = nopt.substring(4,6);
  return
}

function NextPage2()
{
  document.CurrPage.value = Right("00" + nextpage, 2);
  var nextpage = parseInt(document.forms[0].CurrPage.value) + 1;
  var maxpage = parseInt(document.forms[0].MaxPage.value);
  if (nextpage <= maxpage) {
     document.forms[0].CurrPage.value = Right("00" + nextpage, 2);
     if ((nextpage + 1) <= maxpage) {
        document.forms[0].NextPage.value = Right("00" + nextpage, 2);
     }
     else {
        document.forms[0].NextPage.enabled = false;
     }
     location="page" + document.forms[0].CurrPage.value + ".pdf";
  }
  return
}

function PrevPage()
{
  var currpage = parseInt(document.forms[0].CurrPage.value) - 1;
  var minpage = parseInt(document.forms[0].MinPage.value);
  var maxpage = parseInt(document.forms[0].MaxPage.value);
  if (currpage < minpage) {
    currpage = maxpage;
  }
  document.forms[0].CurrPage.value = Right("00" + currpage, 2);
  location="page" + document.forms[0].CurrPage.value + ".pdf";
  return
}

function Left(str, n){
  if (n <= 0)
      return "";
  else if (n > String(str).length)
      return str;
  else
      return String(str).substring(0,n);
}

function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function SetImage(imgName)
{
   var loop = 0;
   var npage = 0;
   var npos = 0;
   var cname = "";

   if (document.images) {
     for (loop = 0; loop < document.images.length; loop++) {
        npage = document.images[loop].src.indexOf("page");
        npos = document.images[loop].src.indexOf("on.gif");
        if (npage >= 0) {
           if (npos >= 0) {
              document.images[loop].src = document.images[loop].src.substring(0,npos) + ".gif";
           }
        }
     }
     cname = document.getElementById(imgName).getAttribute("src");
     npos = cname.indexOf(".gif");
     cname = cname.substring(0,npos) + "on.gif";
     document.getElementById(imgName).setAttribute("src", cname);
   }
   return
}

//*****************************************************************************
// Function called when user clicks on a title to sort
//*****************************************************************************
function sortTable(index,obj)
{
  // Re-inializing the table object
  initTable(obj);

  // Local variables
  var nChildNodes;
  var innerMostNode;
  var rowContent;
  var rowCount;
  var cell, cellText;
  var newTitle;

  // Can't sort past the max allowed column size
  if (index <= 0 || index >= maxNCol) return;

  // Assignment of sort index
  sortIndex = index;
  // Doing the sort using JavaScript generic function for an Array
  rowArray.sort(compare);

  // Re-drawing the title row
  for (var j=0; j<maxNCol; j++)
  {
    cellText = titleRowArray[j];
    cellText = '<' + titleFace +'>' +
      cellText + '</' + titleFace + '></a>';
    newTitle = '<a ' +
      linkEventString +
      j + ',' + '"' + table.id + '"' + ');\'>' +
      cellText +
      '</a>';
//    if (j == sortIndex)
//    {
//      newTitle += '&nbsp;<font color=' + updownColor + '>';
//      if (descending)
//        newTitle += desChr;
//      else
//        newTitle += ascChr;
//      newTitle += '</font>';
//    }
//    titleRowCellArray[j].innerHTML = newTitle;
  }

  // Re-drawing the table
  rowCount = 0;
  for (var i=0; i<nRow; i++)
  {
    if (! colSpanArray[i])
    {
      for (var j=0; j<maxNCol; j++)
      {
        rowContent = rowArray[rowCount].
          split(recDelimiter);
        nChildNodes =
          table.rows[i].cells[j].firstChild.
          childNodes.length;
        innerMostNode =
          table.rows[i].cells[j].firstChild;

        while ( nChildNodes != 0)
        {
          innerMostNode =
            innerMostNode.firstChild;
          nChildNodes =
            innerMostNode.
            childNodes.
            length;
        }
        innerMostNode.data = rowContent[j];
      }
      rowCount++;
    }
  }

  // Switching btw descending/ascending sort
  if (descending)
    descending = false;
  else
    descending = true;
}

//*****************************************************************************
// Function to be used for Array sorting
//*****************************************************************************
function compare(a, b)
{
  // Getting the element array for inputs (a,b)
  var aRowContent = a.split(recDelimiter);
  var bRowContent = b.split(recDelimiter);

  // Needed in case the data conversion is necessary
  var aToBeCompared, bToBeCompared;

  if (isDate(aRowContent[sortIndex]) && isDate(bRowContent[sortIndex]))
  {
    // Compare as dates
    aToBeCompared = new Date(aRowContent[sortIndex]);
    bToBeCompared = new Date(bRowContent[sortIndex]);
  }
  else if (! isNaN(aRowContent[sortIndex]) &&
    ! isNaN(bRowContent[sortIndex]))
  {
    aToBeCompared = parseFloat(aRowContent[sortIndex]);
    bToBeCompared = parseFloat(bRowContent[sortIndex]);
  }
  else
  {
    aToBeCompared = aRowContent[sortIndex];
    bToBeCompared = bRowContent[sortIndex];
  }
  if (sortIndex > 0) // patch to use column 0 as subsort
  {
    aToBeCompared = aToBeCompared + aRowContent[0];
    bToBeCompared = bToBeCompared + bRowContent[0];
  }

  if (aToBeCompared < bToBeCompared)
    if (!descending)
    {
      return -1;
    }
    else
    {
      return 1;
    }
  if (aToBeCompared > bToBeCompared)
    if (!descending)
    {
      return 1;
    }
    else
    {
      return -1;
    }
  return 0;
}

//*****************************************************************************
// Function to check whether it's a IETF recognized date string
//*****************************************************************************
function isDate(x)
{
  var xDate;
  xDate = new Date(x);
  if (xDate.toString() != 'NaN')
    return true;
  else
    return false;
}

//*****************************************************************************
// Function to set the cursor
//*****************************************************************************
function setCursor(obj)
{
  // Show hint text at the browser status bar
  window.status = "Sort by " + obj.firstChild.innerHTML;
  // Change the mouse cursor to hand or pointer
  if (isIE)
    obj.firstChild.style.cursor = "hand";
  else
    obj.firstChild.style.cursor = "pointer";
}

//*****************************************************************************
// Function to set the title color
//*****************************************************************************
function setColor(obj,mode)
{
  if (mode == "selected")
  {
    // Remember the original color
    if (obj.style.color != selectedColor)
      defaultColor = obj.style.color;
    obj.style.color = selectedColor;
  }
  else
  {
    // Restoring original color and re-setting the status bar
    obj.style.color = defaultColor;
    window.status = '';
  }
}

//*****************************************************************************
// Function to check browser type/version
//*****************************************************************************
function checkBrowser()
{
  if (navigator.appName == "Microsoft Internet Explorer"
    && navigator.appVersion.indexOf("5.") >= 0)
  {
    isIE = true;
    return true;
  }
  // For some reason, appVersion returns 5 for Netscape 6.2 ...
  else if (navigator.appName == "Netscape"
    && navigator.appVersion.indexOf("5.") >= 0)
  {
    isIE = false;
    return true;
  }
  else
    return false;
}

function SetPage()
{
  var nopt = GetParam('pages');
  document.forms[0].CurrPage.value = nopt.substring(0,2);
  document.forms[0].MinPage.value = nopt.substring(2,4);
  document.forms[0].MaxPage.value = nopt.substring(4,6);
  return
}

function NextPage2()
{
  document.CurrPage.value = Right("00" + nextpage, 2);
  var nextpage = parseInt(document.forms[0].CurrPage.value) + 1;
  var maxpage = parseInt(document.forms[0].MaxPage.value);
  if (nextpage <= maxpage) {
     document.forms[0].CurrPage.value = Right("00" + nextpage, 2);
     if ((nextpage + 1) <= maxpage) {
        document.forms[0].NextPage.value = Right("00" + nextpage, 2);
     }
     else {
        document.forms[0].NextPage.enabled = false;
     }
     location="page" + document.forms[0].CurrPage.value + ".pdf";
  }
  return
}

function PrevPage()
{
  var currpage = parseInt(document.forms[0].CurrPage.value) - 1;
  var minpage = parseInt(document.forms[0].MinPage.value);
  var maxpage = parseInt(document.forms[0].MaxPage.value);
  if (currpage < minpage) {
    currpage = maxpage;
  }
  document.forms[0].CurrPage.value = Right("00" + currpage, 2);
  location="page" + document.forms[0].CurrPage.value + ".pdf";
  return
}

function Left(str, n){
  if (n <= 0)
      return "";
  else if (n > String(str).length)
      return str;
  else
      return String(str).substring(0,n);
}

function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function SetMember(name)
{
  var cName = GetParam(name);
  var cMember;
  var i;
  for (i = 0; i < document.forms[0].To_Member.options.length; i++) {
     cMember = document.forms[0].To_Member.options[i].text.toLowerCase();
     if (cMember.indexOf(cName) >= 0) {
        document.forms[0].To_Member.options[i].selected = true;
     }
  }
  document.forms[0].subject.focus()
  return
}

function SetMemberN(name)
{
  var nopt = GetParam(name);
  if (nopt < document.forms[0].To_Member.length){
     document.forms[0].To_Member.options[nopt].selected = true
  }
  document.forms[0].subject.focus()
  return
}

function SetRecipient()
{
  var cRecipient = "";
  var i;
  for (i = 0; i < document.forms[0].To_Member.options.length; i++) {
     if ( document.forms[0].To_Member.options[i].selected ) {
         if( cRecipient == ''){
            cRecipient = document.forms[0].To_Member.options[i].value;
         }
         else {
            cRecipient = cRecipient + "; " + document.forms[0].To_Member.options[i].value;
         }
     }
  }
  document.forms[0].recipient.value = cRecipient;
  SetSubject();
}

function SetSubject()
{
  if (document.forms[0].subject.value == '') {
     document.forms[0].subject.value = "General Query";
  }
}

function SetAlertGet()
{
  var arg = document.forms[0].good_url.value + "?email=" + document.forms[0].email.value;
  document.forms[0].good_url.value = arg;
  document.forms[0].action = "http://www.parkglen.org/scripts/fmdirect.php";
  //SetRecipient();
  return true;
}

function SetAlertDrop()
{
  var email = document.forms[0].email.value;
  var arg = document.forms[1].redirect.value + "?email=" + email;
  alert(arg);
  document.forms[1].redirect.value = arg;
  document.forms[1].email.value = email;
  alert(document.forms[1].email.value);
  arg = document.forms[1].recipient.value + ";" + email;
  document.forms[1].recipient.value = arg;
  SetRecipient();
}

function SetRegEmail()
{
  document.forms[0].message.value = "Register address: " + document.forms[0].email.value;
}

function fnOpenModal(URL){
  window.showModalDialog(URL, "center:yes; edge:sunken")
}

function GetSelValue( element ) {
  var cValue = "";
  var n;

  for (n = 0; n < element.options.length; n++) {
    if (element.options[n].selected) {
      cValue = element.options[n].value;
    }
  }
  return cValue;
}

function ShowMap(street)
{
  var arg;
  var i;
  var done = 0;
  var end;
  var maplink = "http://maps.google.com/maps?f=q&hl=en&q=";
  var endlink = ",+Fort+Worth,+TX+76137&ie=UTF8&z=17&om=1";

  arg = street + " ";

  for (i=1; done<1; i++) {
    end=arg.indexOf(" ");
    if (end >= 0) {
      maplink = maplink + arg.substring(0, end) + "+";
      arg = arg.substring(end + 1);
    }
    else {
      done = 1;
    }
  }
  end = maplink.substr(maplink.length - 1, 1);
  if (end = "+") {
    maplink = maplink.substr(0, maplink.length - 1);
  }
  window.open(maplink + endlink);
    //alert(maplink);
}

function FindPhase(nStreetNo, cStreet)
  {
  var aStreet = new Array(183);
  var aLoNum = new Array(183);
  var aHiNum = new Array(183);
  var aPhase = new Array(183);
  var aPhId = new Array(18);
  var aPhName = new Array(18);
  var aLoc = new Array(18);
  var cStreet = "";
  var nCell;
  var n;
  var nStreetNo;
  var cPhase = "?";

aPhId[0]=1; aPhName[0]="Phase I"; aLoc[0]="phase1.php";
aPhId[1]=2.1; aPhName[1]="Phase II Sect. 1, 2 & 3"; aLoc[1]="phase2sect123.php";
aPhId[2]=2.4; aPhName[2]="Phase II Sect. 4"; aLoc[2]="phase2sect4.php";
aPhId[3]=3; aPhName[3]="Phase III"; aLoc[3]="phase3.php";
aPhId[4]=3; aPhName[4]="Phase IV"; aLoc[4]="phase4.php";
aPhId[5]=5.1; aPhName[5]="Phase V Sect. 1"; aLoc[5]="phase5.php";
aPhId[6]=5.2; aPhName[6]="Phase V Sect. 2"; aLoc[6]="phase5.php";
aPhId[7]=6.1; aPhName[7]="Phase VI"; aLoc[7]="phase6.php";
aPhId[8]=6.3; aPhName[8]="Phase VI Sect. 3B"; aLoc[8]="phase6sect3b.php";
aPhId[9]=7.1; aPhName[9]="Phase VII Sect. 1"; aLoc[9]="phase7_1.php";
aPhId[10]=7.2; aPhName[10]="Phase VII Sect. 2"; aLoc[10]="phase7_2.php";
aPhId[11]=8; aPhName[11]="Phase VIII"; aLoc[11]="phase8.php";
aPhId[12]=9; aPhName[12]="Phase IX"; aLoc[12]="phase9.php";
aPhId[13]=10; aPhName[13]="Phase X"; aLoc[13]="phase10.php";
aPhId[14]=11; aPhName[14]="Phase XI"; aLoc[14]="phase11.php";
aPhId[15]=12.1; aPhName[15]="Phase XII"; aLoc[15]="phase12.php";
aPhId[16]=12.4; aPhName[16]="Phase XII Sect. 4"; aLoc[16]="phase12.php";
aPhId[17]=13; aPhName[17]="Phase XIII"; aLoc[17]="phase13.php";

// start table
aStreet[1]="Amberdale Drive"; aLoNum[1]=0; aHiNum[1]=99999; aPhase[1]=13                     ;
aStreet[2]="Angelina Way"; aLoNum[2]=0; aHiNum[2]=99999; aPhase[2]=12.1                      ;
aStreet[3]="Arcadia Court"; aLoNum[3]=0; aHiNum[3]=99999; aPhase[3]=2.1                      ;
aStreet[4]="Arcadia Trail"; aLoNum[4]=0; aHiNum[4]=99999; aPhase[4]=1                        ;
aStreet[5]="Arcadia Trail"; aLoNum[5]=0; aHiNum[5]=99999; aPhase[5]=2.1                      ;
aStreet[6]="Ash River Road"; aLoNum[6]=0; aHiNum[6]=99999; aPhase[6]=9                       ;
aStreet[7]="Basswood Boulevard"; aLoNum[7]=0; aHiNum[7]=99999; aPhase[7]=1                   ;
aStreet[8]="Bear Lake Drive"; aLoNum[8]=0; aHiNum[8]=99999; aPhase[8]=3                      ;
aStreet[9]="Beaver Head Road"; aLoNum[9]=0; aHiNum[9]=99999; aPhase[9]=7.2                   ;
aStreet[10]="Big Bend Court"; aLoNum[10]=0; aHiNum[10]=99999; aPhase[10]=4                   ;
aStreet[11]="Big Bend Drive"; aLoNum[11]=0; aHiNum[11]=99999; aPhase[11]=4                   ;
aStreet[12]="Big Cypress Court"; aLoNum[12]=0; aHiNum[12]=99999; aPhase[12]=11               ;
aStreet[13]="Big Horn Way"; aLoNum[13]=0; aHiNum[13]=99999; aPhase[13]=9                     ;
aStreet[14]="Big Horn Way"; aLoNum[14]=0; aHiNum[14]=99999; aPhase[14]=10                    ;
aStreet[15]="Birch Grove Lane"; aLoNum[15]=0; aHiNum[15]=99999; aPhase[15]=10                ;
aStreet[16]="Birchbend Lane"; aLoNum[16]=0; aHiNum[16]=99999; aPhase[16]=7.1                 ;
aStreet[17]="Black Bear Court"; aLoNum[17]=0; aHiNum[17]=99999; aPhase[17]=7.2               ;
aStreet[18]="Black Hills Lane"; aLoNum[18]=0; aHiNum[18]=99999; aPhase[18]=2.1               ;
aStreet[19]="Blake Lane"; aLoNum[19]=0; aHiNum[19]=99999; aPhase[19]=12.1                    ;
aStreet[20]="Blue Water Lake Drive"; aLoNum[20]=0; aHiNum[20]=99999; aPhase[20]=3            ;
aStreet[21]="Broken Bow Drive"; aLoNum[21]=0; aHiNum[21]=99999; aPhase[21]=2.1               ;
aStreet[22]="Bryce Canyon Court"; aLoNum[22]=0; aHiNum[22]=99999; aPhase[22]=3               ;
aStreet[23]="Bryce Canyon Drive"; aLoNum[23]=0; aHiNum[23]=99999; aPhase[23]=3               ;
aStreet[24]="Buckskin Court"; aLoNum[24]=0; aHiNum[24]=99999; aPhase[24]=7.1                 ;
aStreet[25]="Buckskin Drive"; aLoNum[25]=0; aHiNum[25]=99999; aPhase[25]=7.1                 ;
aStreet[26]="Buena Vista Drive"; aLoNum[26]=0; aHiNum[26]=99999; aPhase[26]=5.1              ;
aStreet[27]="Buffalo Bend Court"; aLoNum[27]=0; aHiNum[27]=99999; aPhase[27]=12.4            ;
aStreet[28]="Canyon Court"; aLoNum[28]=0; aHiNum[28]=99999; aPhase[28]=4                     ;
aStreet[29]="Capital Reef Court"; aLoNum[29]=0; aHiNum[29]=99999; aPhase[29]=6.1             ;
aStreet[30]="Capital Reef Road"; aLoNum[30]=0; aHiNum[30]=99999; aPhase[30]=6.1              ;
aStreet[31]="Caribou Court"; aLoNum[31]=0; aHiNum[31]=99999; aPhase[31]=7.2                  ;
aStreet[32]="Catlow Valley Road"; aLoNum[32]=0; aHiNum[32]=99999; aPhase[32]=3               ;
aStreet[33]="Cave Creek Court"; aLoNum[33]=0; aHiNum[33]=99999; aPhase[33]=12.1              ;
aStreet[34]="Cedar Breaks Drive"; aLoNum[34]=0; aHiNum[34]=99999; aPhase[34]=4               ;
aStreet[35]="Cedar River Trail"; aLoNum[35]=0; aHiNum[35]=99999; aPhase[35]=8                ;
aStreet[36]="Chaco Trail"; aLoNum[36]=0; aHiNum[36]=99999; aPhase[36]=13                     ;
aStreet[37]="Coconino Court"; aLoNum[37]=0; aHiNum[37]=99999; aPhase[37]=12.1                ;
aStreet[38]="Crater Lake Drive"; aLoNum[38]=0; aHiNum[38]=99999; aPhase[38]=4                ;
aStreet[39]="Crazy Horse Lane"; aLoNum[39]=0; aHiNum[39]=99999; aPhase[39]=2.4               ;
aStreet[40]="Crescent Lake Drive"; aLoNum[40]=0; aHiNum[40]=99999; aPhase[40]=1              ;
aStreet[41]="Crystal Creek Circle"; aLoNum[41]=0; aHiNum[41]=99999; aPhase[41]=12.1          ;
aStreet[42]="Davy Crockett"; aLoNum[42]=0; aHiNum[42]=99999; aPhase[42]=7.1                  ;
aStreet[43]="Deer Ridge Drive"; aLoNum[43]=0; aHiNum[43]=99999; aPhase[43]=5.2               ;
aStreet[44]="Deerlodge Trail"; aLoNum[44]=0; aHiNum[44]=99999; aPhase[44]=1                  ;
aStreet[45]="Denali Drive"; aLoNum[45]=0; aHiNum[45]=99999; aPhase[45]=6.1                   ;
aStreet[46]="Desert Falls Drive"; aLoNum[46]=0; aHiNum[46]=99999; aPhase[46]=6.3             ;
aStreet[47]="Everglades Circle"; aLoNum[47]=0; aHiNum[47]=99999; aPhase[47]=6.1              ;
aStreet[48]="Fern Lake Court"; aLoNum[48]=0; aHiNum[48]=99999; aPhase[48]=11                 ;
aStreet[49]="Fort Concho Drive"; aLoNum[49]=0; aHiNum[49]=99999; aPhase[49]=1                ;
aStreet[50]="Fort Concho Drive"; aLoNum[50]=0; aHiNum[50]=99999; aPhase[50]=2.1              ;
aStreet[51]="Fort Union Court"; aLoNum[51]=0; aHiNum[51]=99999; aPhase[51]=10                ;
aStreet[52]="Gila Bend Lane"; aLoNum[52]=0; aHiNum[52]=99999; aPhase[52]=12.1                ;
aStreet[53]="Gila Bend Lane"; aLoNum[53]=0; aHiNum[53]=99999; aPhase[53]=12.4                ;
aStreet[54]="Glacier Bay"; aLoNum[54]=0; aHiNum[54]=99999; aPhase[54]=7.2                    ;
aStreet[55]="Glacier Court"; aLoNum[55]=0; aHiNum[55]=99999; aPhase[55]=3                    ;
aStreet[56]="Glen Canyon Road"; aLoNum[56]=0; aHiNum[56]=99999; aPhase[56]=2.1               ;
aStreet[57]="Glen Canyon Road"; aLoNum[57]=0; aHiNum[57]=99999; aPhase[57]=3                 ;
aStreet[58]="Glen Springs Trail"; aLoNum[58]=0; aHiNum[58]=99999; aPhase[58]=2.4             ;
aStreet[59]="Glen Springs Trail"; aLoNum[59]=0; aHiNum[59]=99999; aPhase[59]=8               ;
aStreet[60]="Glenscape Court"; aLoNum[60]=0; aHiNum[60]=99999; aPhase[60]=13                 ;
aStreet[61]="Glenscape Trail"; aLoNum[61]=0; aHiNum[61]=99999; aPhase[61]=13                 ;
aStreet[62]="Grainger Trail"; aLoNum[62]=0; aHiNum[62]=99999; aPhase[62]=12.1                ;
aStreet[63]="Grand Mesa Drive"; aLoNum[63]=0; aHiNum[63]=99999; aPhase[63]=1                 ;
aStreet[64]="Grand Teton Trail"; aLoNum[64]=0; aHiNum[64]=99999; aPhase[64]=3                ;
aStreet[65]="Grand Teton Trail"; aLoNum[65]=0; aHiNum[65]=99999; aPhase[65]=6.1              ;
aStreet[66]="Great Divide Drive"; aLoNum[66]=0; aHiNum[66]=99999; aPhase[66]=7.2             ;
aStreet[67]="Greylock Court"; aLoNum[67]=0; aHiNum[67]=99999; aPhase[67]=11                  ;
aStreet[68]="Greylock Drive"; aLoNum[68]=0; aHiNum[68]=99999; aPhase[68]=11                  ;
aStreet[69]="Hibbs Drive"; aLoNum[69]=0; aHiNum[69]=99999; aPhase[69]=6.3                    ;
aStreet[70]="Hot Springs Trail"; aLoNum[70]=0; aHiNum[70]=99999; aPhase[70]=2.4              ;
aStreet[71]="Hot Springs Trail"; aLoNum[71]=0; aHiNum[71]=99999; aPhase[71]=8                ;
aStreet[72]="Island Circle"; aLoNum[72]=0; aHiNum[72]=99999; aPhase[72]=11                   ;
aStreet[73]="Island Court"; aLoNum[73]=0; aHiNum[73]=99999; aPhase[73]=11                    ;
aStreet[74]="Island Park Court"; aLoNum[74]=0; aHiNum[74]=99999; aPhase[74]=9                ;
aStreet[75]="Island Park Drive"; aLoNum[75]=0; aHiNum[75]=99999; aPhase[75]=9                ;
aStreet[76]="Isle Royale Drive"; aLoNum[76]=0; aHiNum[76]=99999; aPhase[76]=4                ;
aStreet[77]="Keechi Creek Court"; aLoNum[77]=0; aHiNum[77]=99999; aPhase[77]=12.4            ;
aStreet[78]="Kern Court"; aLoNum[78]=0; aHiNum[78]=99999; aPhase[78]=12.1                    ;
aStreet[79]="Kern Lane"; aLoNum[79]=0; aHiNum[79]=99999; aPhase[79]=12.1                     ;
aStreet[80]="Klamath Mountain Road"; aLoNum[80]=0; aHiNum[80]=99999; aPhase[80]=3            ;
aStreet[81]="Lake Arrowhead Drive"; aLoNum[81]=0; aHiNum[81]=99999; aPhase[81]=3             ;
aStreet[82]="Lake Chelen Drive"; aLoNum[82]=0; aHiNum[82]=99999; aPhase[82]=6.3              ;
aStreet[83]="Lake Mead Trail"; aLoNum[83]=0; aHiNum[83]=99999; aPhase[83]=6.1                ;
aStreet[84]="Lake Meredith Way"; aLoNum[84]=0; aHiNum[84]=99999; aPhase[84]=3                ;
aStreet[85]="Lake Powell Drive"; aLoNum[85]=0; aHiNum[85]=99999; aPhase[85]=3                ;
aStreet[86]="Lake Tahoe Trail"; aLoNum[86]=0; aHiNum[86]=99999; aPhase[86]=7.1               ;
aStreet[87]="Larkhill Drive"; aLoNum[87]=0; aHiNum[87]=99999; aPhase[87]=5.1                 ;
aStreet[88]="Lobos Court"; aLoNum[88]=0; aHiNum[88]=99999; aPhase[88]=4                      ;
aStreet[89]="Lodgepole Lane"; aLoNum[89]=0; aHiNum[89]=99999; aPhase[89]=13                  ;
aStreet[90]="Los Padres Trail"; aLoNum[90]=0; aHiNum[90]=99999; aPhase[90]=1                 ;
aStreet[91]="Los Padres Trail"; aLoNum[91]=0; aHiNum[91]=99999; aPhase[91]=5.1               ;
aStreet[92]="Marble Canyon Court"; aLoNum[92]=0; aHiNum[92]=99999; aPhase[92]=2.1            ;
aStreet[93]="Marble Canyon Drive"; aLoNum[93]=0; aHiNum[93]=99999; aPhase[93]=2.1            ;
aStreet[94]="Margarita Drive"; aLoNum[94]=0; aHiNum[94]=99999; aPhase[94]=12.1               ;
aStreet[95]="Merced Way"; aLoNum[95]=0; aHiNum[95]=99999; aPhase[95]=9                       ;
aStreet[96]="Mesa Verde Court"; aLoNum[96]=0; aHiNum[96]=99999; aPhase[96]=4                 ;
aStreet[97]="Mesa Verde Trail"; aLoNum[97]=0; aHiNum[97]=99999; aPhase[97]=3                 ;
aStreet[98]="Misty Ridge Drive"; aLoNum[98]=0; aHiNum[98]=99999; aPhase[98]=7.1              ;
aStreet[99]="Montane Court"; aLoNum[99]=0; aHiNum[99]=99999; aPhase[99]=11                   ;
aStreet[100]="Mormon Trail"; aLoNum[100]=0; aHiNum[100]=99999; aPhase[100]=3                 ;
aStreet[101]="Mount Hood Road"; aLoNum[101]=0; aHiNum[101]=99999; aPhase[101]=7.2            ;
aStreet[102]="Mt. McKinley Road"; aLoNum[102]=0; aHiNum[102]=99999; aPhase[102]=6.1          ;
aStreet[103]="Mt. Shasta Circle"; aLoNum[103]=0; aHiNum[103]=99999; aPhase[103]=6.1          ;
aStreet[104]="Mustang Court"; aLoNum[104]=0; aHiNum[104]=99999; aPhase[104]=12.1             ;
aStreet[105]="Mustang Drive"; aLoNum[105]=0; aHiNum[105]=99999; aPhase[105]=12.1             ;
aStreet[106]="Natchez Trail"; aLoNum[106]=0; aHiNum[106]=99999; aPhase[106]=6.3              ;
aStreet[107]="Navajo Bridge Trail"; aLoNum[107]=0; aHiNum[107]=99999; aPhase[107]=3          ;
aStreet[108]="Navajo Way"; aLoNum[108]=0; aHiNum[108]=99999; aPhase[108]=7.2                 ;
aStreet[109]="North Beach Street"; aLoNum[109]=0; aHiNum[109]=99999; aPhase[109]=12.4        ;
aStreet[110]="North Beach Street"; aLoNum[110]=0; aHiNum[110]=99999; aPhase[110]=12.1        ;
aStreet[111]="North Cascades"; aLoNum[111]=0; aHiNum[111]=99999; aPhase[111]=7.1             ;
aStreet[112]="Old Mill Road"; aLoNum[112]=0; aHiNum[112]=99999; aPhase[112]=5.2              ;
aStreet[113]="Olympia Trail"; aLoNum[113]=0; aHiNum[113]=99999; aPhase[113]=1                ;
aStreet[114]="Paloverde Drive"; aLoNum[114]=0; aHiNum[114]=99999; aPhase[114]=7.2            ;
aStreet[115]="Park Vista Boulevard"; aLoNum[115]=0; aHiNum[115]=99999; aPhase[115]=2.1       ;
aStreet[116]="Park Vista Boulevard"; aLoNum[116]=0; aHiNum[116]=99999; aPhase[116]=3         ;
aStreet[117]="Park Vista Boulevard"; aLoNum[117]=0; aHiNum[117]=99999; aPhase[117]=4         ;
aStreet[118]="Park Vista Boulevard"; aLoNum[118]=0; aHiNum[118]=99999; aPhase[118]=9         ;
aStreet[119]="Parkside Trail"; aLoNum[119]=0; aHiNum[119]=99999; aPhase[119]=7.2             ;
aStreet[120]="Parkside Way"; aLoNum[120]=0; aHiNum[120]=99999; aPhase[120]=7.1               ;
aStreet[121]="Platt Trail"; aLoNum[121]=0; aHiNum[121]=99999; aPhase[121]=5.1                ;
aStreet[122]="Platte Place"; aLoNum[122]=0; aHiNum[122]=99999; aPhase[122]=6.3               ;
aStreet[123]="Point Reyes Drive"; aLoNum[123]=0; aHiNum[123]=99999; aPhase[123]=1            ;
aStreet[124]="Quachita Crossover Street"; aLoNum[124]=0; aHiNum[124]=99999; aPhase[124]=6.1  ;
aStreet[125]="Rainier Road"; aLoNum[125]=0; aHiNum[125]=99999; aPhase[125]=9                 ;
aStreet[126]="Rainier Road"; aLoNum[126]=0; aHiNum[126]=99999; aPhase[126]=8                 ;
aStreet[127]="Ram Ridge Court"; aLoNum[127]=0; aHiNum[127]=99999; aPhase[127]=11             ;
aStreet[128]="Ram Ridge Road"; aLoNum[128]=0; aHiNum[128]=99999; aPhase[128]=11              ;
aStreet[129]="Redwood Trail"; aLoNum[129]=0; aHiNum[129]=99999; aPhase[129]=2.4              ;
aStreet[130]="Redwood Trail"; aLoNum[130]=0; aHiNum[130]=99999; aPhase[130]=3                ;
aStreet[131]="Redwood Trail"; aLoNum[131]=0; aHiNum[131]=99999; aPhase[131]=6.1              ;
aStreet[132]="Redwood Trail"; aLoNum[132]=0; aHiNum[132]=99999; aPhase[132]=8                ;
aStreet[133]="Rincon Way"; aLoNum[133]=0; aHiNum[133]=99999; aPhase[133]=12.1                ;
aStreet[134]="Rio Blanco Court"; aLoNum[134]=0; aHiNum[134]=99999; aPhase[134]=2.1           ;
aStreet[135]="Rocky Mountain Road"; aLoNum[135]=0; aHiNum[135]=99999; aPhase[135]=4          ;
aStreet[136]="Rogue River Trail"; aLoNum[136]=0; aHiNum[136]=99999; aPhase[136]=3            ;
aStreet[137]="Rushmore Road"; aLoNum[137]=0; aHiNum[137]=99999; aPhase[137]=2.4              ;
aStreet[138]="Rushmore Road"; aLoNum[138]=0; aHiNum[138]=99999; aPhase[138]=8                ;
aStreet[139]="Sabine Street"; aLoNum[139]=0; aHiNum[139]=99999; aPhase[139]=12.1             ;
aStreet[140]="Salmon Run"; aLoNum[140]=0; aHiNum[140]=99999; aPhase[140]=12.1                ;
aStreet[141]="Salmon Run Way"; aLoNum[141]=0; aHiNum[141]=99999; aPhase[141]=12.1            ;
aStreet[142]="Salt River Road"; aLoNum[142]=0; aHiNum[142]=99999; aPhase[142]=9              ;
aStreet[143]="Salt River Road"; aLoNum[143]=0; aHiNum[143]=99999; aPhase[143]=8              ;
aStreet[144]="San Isabel Court"; aLoNum[144]=0; aHiNum[144]=99999; aPhase[144]=1             ;
aStreet[145]="Seneca Court"; aLoNum[145]=0; aHiNum[145]=99999; aPhase[145]=12.1              ;
aStreet[146]="Seneca Drive"; aLoNum[146]=0; aHiNum[146]=99999; aPhase[146]=12.1              ;
aStreet[147]="Sequoia Way"; aLoNum[147]=0; aHiNum[147]=99999; aPhase[147]=10                 ;
aStreet[148]="Silver Sage Drive"; aLoNum[148]=0; aHiNum[148]=99999; aPhase[148]=7.2          ;
aStreet[149]="Sitka Street"; aLoNum[149]=0; aHiNum[149]=99999; aPhase[149]=12.1              ;
aStreet[150]="Slide Rock Road"; aLoNum[150]=0; aHiNum[150]=99999; aPhase[150]=9              ;
aStreet[151]="Slide Rock Road"; aLoNum[151]=0; aHiNum[151]=99999; aPhase[151]=8              ;
aStreet[152]="Spanish River Trail"; aLoNum[152]=0; aHiNum[152]=99999; aPhase[152]=8          ;
aStreet[153]="St. Croix Lane"; aLoNum[153]=0; aHiNum[153]=99999; aPhase[153]=10              ;
aStreet[154]="Stillwater Court"; aLoNum[154]=0; aHiNum[154]=99999; aPhase[154]=5.2           ;
aStreet[155]="Stillwater Drive"; aLoNum[155]=0; aHiNum[155]=99999; aPhase[155]=5.2           ;
aStreet[156]="Tamiami Trail"; aLoNum[156]=0; aHiNum[156]=99999; aPhase[156]=6.3              ;
aStreet[157]="Tanque Trail"; aLoNum[157]=0; aHiNum[157]=99999; aPhase[157]=12.1              ;
aStreet[158]="Teal Drive"; aLoNum[158]=0; aHiNum[158]=99999; aPhase[158]=13                  ;
aStreet[159]="Teal Drive"; aLoNum[159]=0; aHiNum[159]=99999; aPhase[159]=7.2                 ;
aStreet[160]="Teal Drive"; aLoNum[160]=0; aHiNum[160]=99999; aPhase[160]=7.1                 ;
aStreet[161]="Teal Drive"; aLoNum[161]=0; aHiNum[161]=99999; aPhase[161]=12.1                ;
aStreet[162]="Teton Trail"; aLoNum[162]=0; aHiNum[162]=99999; aPhase[162]=9                  ;
aStreet[163]="Timken Trail"; aLoNum[163]=0; aHiNum[163]=99999; aPhase[163]=12.4              ;
aStreet[164]="Trace Ridge Parkway"; aLoNum[164]=0; aHiNum[164]=99999; aPhase[164]=11         ;
aStreet[165]="Truxton Court"; aLoNum[165]=0; aHiNum[165]=99999; aPhase[165]=12.1             ;
aStreet[166]="Tularosa Court"; aLoNum[166]=0; aHiNum[166]=99999; aPhase[166]=5.2             ;
aStreet[167]="Tularosa Drive"; aLoNum[167]=0; aHiNum[167]=99999; aPhase[167]=5.2             ;
aStreet[168]="Tularosa Drive"; aLoNum[168]=0; aHiNum[168]=99999; aPhase[168]=4               ;
aStreet[169]="Turtle River Court"; aLoNum[169]=0; aHiNum[169]=99999; aPhase[169]=3           ;
aStreet[170]="Union Lake Drive"; aLoNum[170]=0; aHiNum[170]=99999; aPhase[170]=9             ;
aStreet[171]="Union Lake Drive"; aLoNum[171]=0; aHiNum[171]=99999; aPhase[171]=8             ;
aStreet[172]="Vista Boulevard"; aLoNum[172]=0; aHiNum[172]=99999; aPhase[172]=6.3            ;
aStreet[173]="Wagon Run Drive"; aLoNum[173]=0; aHiNum[173]=99999; aPhase[173]=5.1            ;
aStreet[174]="Warm Springs Trail"; aLoNum[174]=0; aHiNum[174]=99999; aPhase[174]=5.2         ;
aStreet[175]="Washita Court"; aLoNum[175]=0; aHiNum[175]=99999; aPhase[175]=11               ;
aStreet[176]="Washita Way"; aLoNum[176]=0; aHiNum[176]=99999; aPhase[176]=11                 ;
aStreet[177]="White Hills Drive"; aLoNum[177]=0; aHiNum[177]=99999; aPhase[177]=5.1          ;
aStreet[178]="White Sands Drive"; aLoNum[178]=0; aHiNum[178]=99999; aPhase[178]=5.1          ;
aStreet[179]="Wind Cove Court"; aLoNum[179]=0; aHiNum[179]=99999; aPhase[179]=10             ;
aStreet[180]="Woodland Way"; aLoNum[180]=0; aHiNum[180]=99999; aPhase[180]=9                 ;
aStreet[181]="Yellowstone Court"; aLoNum[181]=0; aHiNum[181]=99999; aPhase[181]=6.1          ;
aStreet[182]="Yellowstone Trail"; aLoNum[182]=0; aHiNum[182]=99999; aPhase[182]=6.1          ;
aStreet[183]="Zion Trail"; aLoNum[183]=0; aHiNum[183]=99999; aPhase[183]=12.4                ;
  // end table

aStreet[184]="Leave this here"; aLoNum[184]=0; aHiNum[184]=99999; aPhase[184]=0;

  nCell = aStreet.length + 1;
  cStreet = GetSelValue( CcrPhase.cboStreetName );
  nStreetNo = CcrPhase.txtStreetNo.value - 0;

  if (cStreet.length > 0) {
    for (n = 1; n < aStreet.length; n++) {
      if (cStreet == aStreet[n]) {
        if (nStreetNo >= aLoNum[n]) {
           if (nStreetNo <= aHiNum[n]) {
              nCell = n;
              break;
           }
        }
      }
    }
  }
  else {
    cPhase = "X";
  }
  if (nCell > 0) {
    if (nCell <= aStreet.length) {
      if (aStreet[nCell] == aStreet[nCell+1] && aLoNum[nCell] == aLoNum[nCell+1]) {
        cPhase = "M";
      }
      else {
        for (n = 0; n < aPhId.length; n++) {
          if (aPhId[n] == aPhase[nCell]) {
            cPhase = aLoc[n];
            break;
            }
          }
        }
      }
    }

  return cPhase;
}

function SetStreetCriteria()
{
  var order = GetParam("order");
  var where = GetParam("where");
  var desc = GetParam("desc");

  if (order.length == 0) {
    order = "street";
  }
  if (desc.length == 0) {
    desc = "0";
  }
  document.forms[0].order.value = order;
  document.forms[0].where.value = where;
  document.forms[0].desc.value = desc;
}

function ReviewContent(cField)
{
  var success = true;
  var nope = 0;
  var msg = "";
  if ( cField == "Message" ) {
    msg = document.forms[0].Message.value.toLowerCase();
  }
  if ( cField == "Comments" ) {
    msg = document.forms[0].Comments.value.toLowerCase();
  }
  if ( cField == "Details" ) {
    msg = document.forms[0].Details.value.toLowerCase();
  }
  if ( cField == "Volunteer_At" ) {
    msg = document.forms[0].Volunteer_At.value.toLowerCase();
  }
  if ( cField == "Interests" ) {
    msg = document.forms[0].Interests.value.toLowerCase();
  }
  if ( cField == "Mail_Address" ) {
    msg = document.forms[0].Mail_Address.value.toLowerCase();
  }
  if ( cField == "Suggestions" ) {
    msg = document.forms[0].Suggestions.value.toLowerCase();
  }
  nope += msg.indexOf("href=") + 1;
  nope += msg.indexOf("http:") + 1;
  nope += msg.indexOf("javascript:") + 1;
  nope += msg.indexOf("vbscript:") + 1;
  nope += msg.indexOf("on*") + 1;
  nope += msg.indexOf("data*") + 1;
  nope += msg.indexOf("dynsrc") + 1;
  nope += msg.indexOf("<a href") + 1;
  nope += msg.indexOf("<applet") + 1;
  nope += msg.indexOf("<base") + 1;
  nope += msg.indexOf("<bgsound") + 1;
  nope += msg.indexOf("<blink") + 1;
  nope += msg.indexOf("<body") + 1;
  nope += msg.indexOf("<div") + 1;
  nope += msg.indexOf("<embed") + 1;
  nope += msg.indexOf("<frame") + 1;
  nope += msg.indexOf("<head") + 1;
  nope += msg.indexOf("<html") + 1;
  nope += msg.indexOf("<iframe") + 1;
  nope += msg.indexOf("<ilayer") + 1;
  nope += msg.indexOf("<img") + 1;
  nope += msg.indexOf("<layer") + 1;
  nope += msg.indexOf("<link") + 1;
  nope += msg.indexOf("<meta") + 1;
  nope += msg.indexOf("<object") + 1;
  nope += msg.indexOf("<script") + 1;
  nope += msg.indexOf("<span") + 1;
  nope += msg.indexOf("<style") + 1;
  nope += msg.indexOf("<title") + 1;
  nope += msg.indexOf("<xml") + 1;
  nope += msg.indexOf("<bgsound") + 1;
  if (nope > 0) {
    success = false;
  }
  return success;
}

function CheckMessage(pAction)
{
  var success = true;

  if ( typeof(pAction) == "undefined" ) {
     pAction = "send";
  }
  success = EditForm(pAction);
  if ( success ) {
     success = ReviewContent("Message");
    if ( success ) {
      document.forms[0].action = "http://www.parkglen.org/scripts/fmdirect.php";
    }
    else {
      alert("Message contains unacceptable content.\r\nPlease revise.");
    }
  }
return success;
}

function CheckComments(pAction)
{
  var success = true;

  if ( typeof(pAction) == "undefined" ) {
     pAction = "send";
  }
  success = EditForm(pAction);
  if ( success ) {
     success = ReviewContent("Comments");
    if ( success ) {
      document.forms[0].action = "http://www.parkglen.org/scripts/fmdirect.php";
    }
    else {
      alert("Comments contain unacceptable content.\r\nPlease revise.");
    }
  }
  return success;
}

function CheckFeedback(pAction)
{
  var success = true;

  if ( typeof(pAction) == "undefined" ) {
     pAction = "send";
  }
  success = EditForm(pAction);
  if ( success ) {
    success = ReviewContent("Suggestions");
    if ( success ) {
      document.forms[0].action = "http://www.parkglen.org/scripts/fmdirect.php";
    }
    else {
      alert("Suggestions contain unacceptable content.\r\nPlease revise.");
    }
  }
  return success;
}

function CheckVSquared(pAction)
{
  var success = true;

  if ( typeof(pAction) == "undefined" ) {
     pAction = "send";
  }
  success = EditForm(pAction);
  if ( success ) {
    success = ReviewContent("Interests");
    if ( success ) {
       success = ReviewContent("Volunteer_At");
       if ( success ) {
          success = ReviewContent("Comments");
          if ( success ) {
             success = ReviewContent("Mail_Address");
             if ( success ) {
               document.forms[0].action = "http://www.parkglen.org/scripts/fmdirect.php";
             }
             else {
               alert("One or more fields contain unacceptable content.\r\nPlease revise.");
             }
          }
       }
    }
  }
  return success;
}
function TestForm()
{
alert("here in js");
}
function SetStateStreet(cState, cStreet)
{
  var i;
  for (i = 0; i < document.forms[0].state.options.length; i++) {
    cOpt = document.forms[0].state.options[i].value;
    if (cOpt == cState) {
        document.forms[0].state.options[i].selected = true;
        break;
     }
  }
  var i;
  for (i = 0; i < document.forms[0].street_name.options.length; i++) {
    cOpt = document.forms[0].street_name.options[i].value;
    if (cOpt == cStreet) {
        document.forms[0].street_name.options[i].selected = true;
        break;
     }
  }
  return;
}

function OffDirectors()
{
  document.forms[0].director_01.checked = false;
  document.forms[0].director_02.checked = false;
  document.forms[0].director_03.checked = false;
  return;
}

function EditForm(pAction)
{
  var success = true;
  var nope = 0;
  var i = 0;
  var msg = "";
  var str = "";
  var areqfield = new Array();
  var areqtext = new Array();

  if ( typeof(pAction) == "undefined" ) {
     pAction = "send";
  }
  areqfield = document.forms[0].required.value.split(",");
  areqtext = document.forms[0].reqtext.value.split(",");

  for (i=0; i < areqfield.length; i++) {
    if ( areqfield[i] == "email" ) {
      areqfield[i] = "From_Email";
    }
    str = document.getElementById(areqfield[i]);
    //alert("reqtext " + i + " " + areqtext[i] + " " + str.value);
    if ( str.value ) {
    }
    else {
       if ( msg == "" ) {
          msg = "Cannot " + pAction + " because of errors:\r\n\r\n";
       }
       msg += areqtext[i] + " is a required field\r\n";
    }
  }

  if ( msg != "" ) {
     alert(msg);
     nope += 1;
  }
  if (nope > 0) {
    success = false;
  }
  return success;
}

function RegisterEmail(pAction)
{
  var success = false;

  if ( typeof(pAction) == "undefined" ) {
     pAction = "send";
  }
  success = EditForm(pAction);
  if ( success ) {
     success = SetAlertGet();
  }
  return success;
}

