// PKJA-LIB.JS         A library of useful JavaScript functions

// Our soul waits for the Lord, he is our help and shield. Paslm 33:20

// 10/03/2001 - Added: SendMail for making an email html page
// 01/15/2002 - Added: DeBug(text) - for infinite & fast loops
// 05/09/2002 - Added: HexStng(val) - covers 0-255 to 0-FF string
// 12/30/2002 - Added: TrimStn(Stn), TrimBackEnd(Stn), & TrimFrontEnd(Stn)
// 04/24/2003 - Added: DeBugW(txt)

// -------------------------------------------------------------------
// This function displays an alert message
// inputs: a name
// output: Displays the Greeting message and name in an alert window
// Action: Waits for a click of the mouse
// return: nothing
// -------------------------------------------------------------------
function Greeting(who) {
   alert ("Greetings there, " + who);
}


// -------------------------------------------------------------------
// This function displays an alert message
// inputs: the message
// output: Displays the message in an alert window
// Action: Waits for a click of the mouse
// return: nothing
// -------------------------------------------------------------------
function Message(msg) {
   alert (msg);
}


// -------------------------------------------------------------------
// This function displays an alert ERROR * message * ERROR
// inputs: the message
// output: Displays the message in an alert window
// Action: Waits for a click of the mouse
// return: nothing
// -------------------------------------------------------------------
function Error(msg) {
   alert ("ERROR * "+msg+" * ERROR");
}


// -------------------------------------------------------------------
// This function returns the square of a number
// inputs: a number
// output: nothing
// Action: none
// return: number squared
// -------------------------------------------------------------------
function Squared(n) {
   return (n*n);
}


// -------------------------------------------------------------------
// This function swaps a multi-part strings parts & sends it back
// inputs: a multi part string
// output: nothing
// Action: none
// return: a reverse order multi part string
// -------------------------------------------------------------------
function SwapStr(instr) {
   var outstr;
   var tmpstr;
   var partstr;
   var mmax, max, i;

   partstr = instr.split(" "); // Split string apart on a space
   max = partstr.length; // Get the # of parts
   mmax = max/2;         // Get the # of swaps
   for(i=0; i<mmax; ++i) { // actual swapping code
      tmpstr = partstr[i];           // Put lowest part in tmp
      partstr[i] = partstr[max-i-1]; // put highest part in lowest part
      partstr[max-i-1] = tmpstr;     // put lowest part in highest part
   }
   outstr = partstr.join(" "); // put the reversed string back together

   return (outstr);
}


// -------------------------------------------------------------------
// This function Checks a string for a char
// inputs: a string and a char
// output: nothing
// Action: none
// return: (0/1) = Char (Not found / Found) in string
// -------------------------------------------------------------------
function ChkChar(instr, inchar) {

   Rtn = 0;
   atPos = instr.indexOf(inchar, 1);
   if(atPos > 0)
      Rtn = 1;

   return Rtn;
}


// -------------------------------------------------------------------
// This function Prints a string as a "level" html <h> headder
// inputs: Title, level of headder, "c" == to center it.
// output: none or can return html header as a string
// Action: Prints the headder or none
//
// If we use the printing of the headder string the call must be:
// Call: AddHead("Title Goes Here", 1, "c");
//
// If we use the return of the headder string the call must be:
// Call: document.write(AddHead("Title Goes Here", 1, "c"));
// -------------------------------------------------------------------
function AddHead(text, level, cnt) {
   var c1 = "", c2 = "";

   if(cnt == "c") {
      c1 = "<center>";
      c2 = "</center>";
   }
   html = "H" + level;
   start = c1 + "<" + html + ">";
   stop = c2 + "</" + html + ">";

   document.write(start + text + stop); // call: AddHead("...)

   return; // (start+text+stop); // Call: doc.write(AddHead("...))
}


// -------------------------------------------------------------------
// This function Checks an input to see if it IS a number
// inputs: a string
// output: nothing
// Action: none
// return: (0/1) = (Not a number / Is a number)
// -------------------------------------------------------------------
function IsNum(Vnum) {
   return (!isNaN(Vnum));
}


// -------------------------------------------------------------------
// This function Starts the e-mail <a href= tag
// inputs: two email address strings, and email subject
// output: nothing
// Action: none
// return: complete email html line
// -------------------------------------------------------------------
function MailMe(add1, add2, subj) {
   var atsign = "@";
   var dotcom = ".com";
   var subject = "";
   if(subj.length > 0) {
      subject = "?subject=";
      subject += subj;
   }
   var Mail2 = "mailto:";//HA@HA.HA.nothing.here.com!
   var Ovr = " onMouseOver=\"window.status='Send an Email: " + subj + "'; return true;\"";
   var Out = " onMouseOut=\"window.status=''\"";
   var Msg = '<a href="' + (Mail2+add1+atsign+add2+dotcom+subject) + '"' + (Ovr+Out) + ">";
   //alert(Msg);
   return(document.write(Msg));
}


function MailMe01(add1, add2) {
   var atsign = "@";
   var dotcom = ".com";

   var Mail2 = "mailto:";//HA@HA.HA.nothing.here.com!
   var Ovr = " onMouseOver=\"window.status='Send an Email: " + "'; return true;\"";
   var Out = " onMouseOut=\"window.status=''\"";
   return(document.write("<a href=\"",Mail2+add1+atsign+add2+dotcom+"\""+Ovr+Out, ">"));
}


// -------------------------------------------------------------------
// This function Builds an entire e-mail html page to send email to
// the address about the subject. This was a test to see if I could 
// send email even if Yahoo were down. It works!
// inputs: email address string, and email subject
// output: You get moved to the email html-page, click on [Click Here]
//         to get the email fill-in form
// Action: none
// return: nothing
// -------------------------------------------------------------------
function SendMail(add, subj) {
   var subject = "";
   var Page = "<html><body>";  // The complete email web-page!
   if(subj.length > 0) {
      subject = "?subject=";
      subject += subj;
   }
   var Ovr = " onMouseOver=\"window.status='To send an Email to: " + add + " about: " + subj + "'; return true;\"";
   var Out = " onMouseOut=\"window.status=''\"";
   Page += "<br><br><center><font face='arial'><h3>To send email to: ";
   Page += add+"</h3></font><br>";
   Page += "About: "+subj+" - ";
   Page += "<a href=\"mailto:"+add+subject+"\""+Ovr+Out+">";
   Page += "[Click Here]</a>  </center>  <br></body></html>";

   document.write(Page);
}


// -------------------------------------------------------------------
// This function puts together two strings into an email address
// inputs: two email address strings
// output: nothing
// Action: none
// return: complete email html line
// -------------------------------------------------------------------
function MailTxt(add1, add2) {
   var atsign = "@";
   var dotcom = ".com";
   return(document.write(add1+atsign+add2+dotcom));
}


// -------------------------------------------------------------------
// This function builds & writes the e-mail <a href="..."> tag
// inputs: email 1, 2, & 3 as in: email1 @ email2 . email3
// inputs: the two status message strings, in and out
// inputs: the subject string
// output: nothing
// Action: none
// return: complete email "<a href=...>" html line
// -------------------------------------------------------------------
function E_Mail(email1, email2, email3, statMsgIn, statMsgOut, subject) {
   var Mail2 = "\"mailto:";//HA@HA.HA.nothing.here.com!
   Mail2  += email1+"@"+email2+"."+email3;
   Mail2  += "?subject=" + subject + "\"";
   var Ovr = " onMouseOver=\"window.status='";
   Ovr    += statMsgIn + "'; return true;\"";
   var Out = " onMouseOut=\"window.status='";
   Out    += statMsgOut + "'\"";
   // window.alert("<a href="+Mail2+Ovr+Out+">");
   return(document.write("<a href=",Mail2+Ovr+Out,">"));
}


// -------------------------------------------------------------------
// This function swaps two images so we can do a roll-over
// inputs: two image file names
// output: none
// Action: New image put in place of image being used
// return: none
// -------------------------------------------------------------------
function swapImages(ImageName, NewImage) {

   // test to see if the browser understands rollover
   // If it does swap one image for the other
   if (document.images) {
      document[ImageName].src = NewImage;
   }
}


// -------------------------------------------------------------------
// On Mouse Over we display the txt in the status bar, and myimage at
// the lnk position.
// inputs: txt, lnk, image
// output: none
// Action: calls swapImages to place the sent image at the lnk position
// return: none
// -------------------------------------------------------------------
function RollMeOver(txt, lnk, myimage) {
   window.status=txt;
   swapImages(lnk, myimage);
//   return true;  // is this needed? Seems to work without it.
}

// What does this do?
// -------------------------------------------------------------------
// On Mouse Over we display the txt in the status bar, and myimage at
// the lnk position.
// inputs: txt, lnk, image
// output: none
// Action: calls swapImages to place the sent image at the lnk position
// return: none
// -------------------------------------------------------------------
function RollMeOver2(txt, lnk, width, height) {
   window.status=txt;
   // swapImages(lnk, myimage);
   var message = "<applet code=";
   message    += "\""+lnk+"\"" + " width="+width;
   message    += " height="+height+"></applet>";

   document.write(message); // Makes the different window

//   return true;  // is this needed? Seems to work without it.
}


// -------------------------------------------------------------------
// On Mouse Over we clear the status bar, and put myimage at
// the lnk position.
// inputs: lnk, image
// output: none
// Action: calls swapImages to place the sent image at the lnk position
// return: none
// -------------------------------------------------------------------
function ClearMe(lnk, myimage) {
   //window.status="";
   swapImages(lnk, myimage);
}


// -------------------------------------------------------------------
// Converts a numeric to a money string
// Input: a numeric that's supposed to me money, 2 decimal places
// Return: A Money numeric-string, rounded & truncated to 2 places
// -------------------------------------------------------------------
function Money(amount) {
  var a = amount * 100;
  a = Math.ceil(a);
  a /= 100;
  var b = parseInt(a);
  if (a == b) { // If it IS an int then add the decimal point
    a += ".";
  }
  a += "00";  // converts it to a string with exta 0's
  var where = a.indexOf(".");
  var b = a.substring(0, where+3);
  return(b); // returns a STRING in money format
}


// -------------------------------------------------------------------
// Converts a numeric to a rounded number string
// Input: number to be rounded, and the number of places to round to
// Return: A rounded numeric-string, truncated to "places" places
// -------------------------------------------------------------------
function Round(amount, places) {
  var tens = 1;       // no tens yet
  var money = 0;
  if(places == "$") { // If it is money 
     money = 1;       // set the money flag
     places = 2;      // set decimal places to 2
  }
  for(j=0; j<places; ++j) { // Build the correct multiplier/divider
     tens *= 10;
  }
  var a = amount * tens; // adjust number to correct int value for rounding

  if(!money) { // If not money use standard rounding
     a = Math.round(a);
  }
  else {       // otherwise use ceiling function (ALWAYS round up)
     a = Math.ceil(a);
  }
  a /= tens;   // adjust the rounded number to correct decimal places

  var b = parseInt(a); // Get just the integer portion on the number
  if (a == b) { // If it IS an int then add the decimal point
    a += ".";
  }

  for(j=0; j<places; ++j) { // Add correct number of extra 0's
     a += "0";  // converts it to a string with exta 0's
  }

  var where = a.indexOf("."); // find where the "." is and then 
  var b = a.substring(0, where+places+1); // get correct size sub string
  return(b);                  // & return the corrected rounded number-string
}



// -------------------------------------------------------------------
// This function Converts a number into a comma-ed number-string
// inputs: a number
// output: a string of the number with correctly placed commas, if needed
// return: the number-string
/*
Thanks for the great script, Phil. This is one of those things that seems like it should be really simple, but isn't.
--------------------
Michael Moncur (mgm) 
Owner and Maintainer, The JavaScript Workshop
09/25/2001
*/
// -------------------------------------------------------------------
  function Commas(num1) {
    var num = new String(num1+""); // make a string of that number
    var end = "";
    point = num.indexOf("."); // Find decimal point, if there is one
    if(point > -1) {
       end = num.substring(point, num.length); // get decimal part
       num = num.substring(0, point);              // get integer part
    }

    var commas = num.length/3; // No of commas needed, sort of
    var ints = parseInt(commas); // Just the integer part

    var left = 3*(commas - ints); // If this is zero we need one less comma
    var nxt = 0;

    if(!left) {
       --commas;
       nxt = 3;
    }
    else {
      nxt = Math.round(left);
    }

    var Snumber = num.substring(0, nxt);

    var last = nxt;
    nxt += 3;
    if(nxt <= num.length)
       Snumber += ",";

    for(j=0; j<commas; ++j) { // add remaining commas
       if(nxt <= num.length) {
          Snumber += num.substring(last, nxt);
       }

       last = nxt;
       nxt += 3;
       if(nxt <= num.length)
          Snumber += ",";
    }

    //document.write("Done - Comma-ed number: "+Snumber+"<br><br>");
    if(point) {
       Snumber += end;
    }
    return(Snumber);
  }


// -------------------------------------------------------------------
// This function Sorts two Objects based on the values of a text field
// called: name.   This function should be called 
// as in: SortObj = ArrayObj.sort(ObjSortName);
// inputs: Two Objects with a text filed called: name
// output: nothing.
// return: integer -1, 0, 1 = Arg1 is sorted: first, same, last
// -------------------------------------------------------------------
function ObjSortName(Arg1, Arg2) {
  var tmp = new Array(2); // Unsorted names
  var srt = new Array(2); // Sorted Names

  tmp[0] = Arg1.name; // Load unsorted names array
  tmp[1] = Arg2.name;
  srt = tmp.sort();   // Get the sorted names array

  // Now find out HOW they were sorted.
  var Rtn = 0; // Returned if Arg1 == Arg2, actually never returned
  if(srt[0] == Arg1.name) {
     Rtn = -1; // Returned if Arg1 sorted before Arg2
  }
  else if(srt[0] == Arg2.name) {
     Rtn = 1;  // Returned if Arg2 sorted before Arg1
  }

  return(Rtn);
}


// -------------------------------------------------------------------
// This function Sorts two Objects based on the values of a numeric
// field called: numb.   This function should be called 
// as in: SortObj = ArrayObj.sort(ObjSortNumb);
// inputs: Two Objects with a text filed called: name
// output: nothing.
// return: integer -1, 0, 1 ==  if Arg1.numb < = > Arg2.numb
// -------------------------------------------------------------------
function ObjSortNumb(Arg1, Arg2) {

  // Now find out HOW they are rated.
  var Rtn = 0; // Returned if Arg1 == Arg2

  // The multiplication by 1 forces the Arg#.numb values to be
  // numbers just in case they aren't.
  if((1*Arg1.numb) < (1*Arg2.numb)) {
     Rtn = -1; // Returned if Arg1.numb sorted before Arg2.numb
  }
  else if((1*Arg2.numb) < (1*Arg1.numb)) {
     Rtn = 1;  // Returned if Arg2.numb sorted before Arg1.numb
  }

  return(Rtn);
}


// -------------------------------------------------------------------
// This function Sorts two numbers based on their values.  This 
// function is called like: Sorted = NumbArray.sort(NumberSort);
// inputs: Two Numbers in an array of numbers
// output: nothing.
// return: integer -1, 0, 1 = Arg1 if Arg1 < = > Arg2
// -------------------------------------------------------------------
function NumberSort(Arg1, Arg2) {

  // Now find out HOW they are rated.
  var Rtn = 0; // Returned if Arg1 == Arg2

  // The multiplication by 1 forces the Arg values to be a number
  // just in case it isn't.
  if((1*Arg1) < (1*Arg2)) {
     Rtn = -1; // Returned if Arg1 sorted before Arg2
  }
  else if((1*Arg2) < (1*Arg1)) {
     Rtn = 1;  // Returned if Arg2 sorted before Arg1
  }

  return(Rtn);
}


// -------------------------------------------------------------------
// Generates the user's new password
// inputs: none
// output: nothing
// Action: none
// return: New password, six characters
// -------------------------------------------------------------------
function PassWord() {
  var PassWord = "";
  var Alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDE";
  var tmp1 = 0

  for(j=0; j<3; ++j) {
    tmp1 = Math.random();
    tmp1 *= 100;
    if (tmp1 > 51)
       tmp1 -= 51;
    PassWord += Alpha.substring(tmp1, tmp1+1);

    tmp1 -= Math.floor(tmp1);

    PassWord += Math.floor(tmp1*10);
  }
  // alert(PassWord);
  return(PassWord);
}


// -------------------------------------------------------------------
// This function converts a month in text to a month number
// inputs: the month in three letter text, first letter is upper case
// output: none
// Action: none
// return: corresponding month number (Jan = 1, ..., Dec = 12)
// -------------------------------------------------------------------
function MonthNumb(Month) {
  var Months = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", 
                         "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
  for(j=0; j<12; ++j) {
    if(Month == Months[j]) { // Got a match!
       var MN = j + 1;       // Give the number.
    }
  }
  return (MN); // Return the month number.
}


// -----------------------------------------------------------
// This function checks to see if the dob entered indicates
// that the user is 18 years old or older.
// input:  user's dob in mm/dd/yyyy format (no checking)
// output: none
// Action: none
// return: true/false is the user is/in-not 18 or older
// more:   This function uses function: MonthNumb()
// -----------------------------------------------------------
function Is18() {
   var Rtn = false; // No he/she is NOT 18
   var Today = Date(); // math operations string
   var Each = Today.split(" "); // 1:Month, 2:day, 4:Year

   var dob = document.DOBform.dob.value
   var dobs = dob.split("/"); // 0:mm, 1:dd, 2:yyyy
   var Ydiff = Each[4] - dobs[2];
   var Mdiff = MonthNumb(Each[1]) - dobs[0];

   if(Mdiff < 0) {
      --Ydiff;
      Mdiff += 12;
   }

   var Ddiff = Each[2] - dobs[1];
   if(Ddiff < 0) {
      --Mdiff;
   }

   // --------------------------------------------
   // Now check for 18 years old or older
   // --------------------------------------------
   if(Ydiff >= 19) { // No need to check any more!
     Rtn = true;
   }
   else if (Ydiff == 18 && Mdiff > 0) { // 18 years, check Month
     Rtn = true; // If month > 0 diff then we're done, 18ys x months
   }
   else if(Ydiff == 18 && Mdiff == 0 && Ddiff >= 0) { // If user 18ys 0m
     Rtn = true; // Got to check days, if days-diff >=0 then still 18!
   }
   // --------------------------------------------

//alert("This dob is 18 years old or older:   "+Rtn);
   return Rtn;
}


// ----------------------------------------------------------
// Displays a message & allows an exit from this code
// inputs:  Message text to display
// outputs: Displays the message & wait for key inputs
// actions: Returns to this code, or to previous html page
// returns: none
// ----------------------------------------------------------
function DeBug(txt) {
  A=prompt(txt, "Continue/Exit == Enter/X-key.");
  if(A=="X" || A=="x") { // Go back to the LAST safe page!
    javascript:history.go(-1);
    //javascript:history.G0(-1); // May be needed to cause an ERROR
  }
}


// ----------------------------------------------------------
// Displays large text as a new web-page
// inputs:  Message text to be displayed
// outputs: Displays the text & waits to be close [X]
// actions: Returns to this code, or to previous html page
// returns: none
// ----------------------------------------------------------
function DeBugW(txt) {
   tmpw = window.open("", "tmp");
   tmpw.document.write(txt);
   tmpw.document.close();
}


// ---------------------------------------------------------
// Makes a decimal number into a HEXidecimal numeric string
//   
// inputs:  decimal value, val from 0 - 255
// outputs: none
// returns: Hexidecimal two-digit string, '0' - 'FF'
// actions: none
// ---------------------------------------------------------
function HexStng(val) {
   var Vals = "0123456789ABCDEF023";
   var Big = 0;
   var Sml = 0;
   
   while (val > 255) { // Make sure we start with a valid number
      val -= 255;
   }
   Big = Vals.substring(val/16, val/16+1);
   Sml = Vals.substring(val%16, val%16+1);
   //DeBug(val + " == " + Big + Sml);
   return(Big+Sml);
}


// ---------------------------------------------------------
// Removes all leading & trailing Chrs on the passed-in string.
//
// inputs:  The string to clean up: Stn & the Chr to remove
// Outputs: none (alert or DeBug messages as needed)
// returns: The cleaned-up string.
// ---------------------------------------------------------
function TrimStn(Stn, Chr) {
   return TrimBackEnd(TrimFrontEnd(Stn, Chr));
}


// -----------------------------------------------------------
// Remove all leading Chrs or spaces on the passed-in string.
//
// inputs:  The string to clean up: Stn & the Chr to remove
//          If Chr is null then assume use of Chr = space.
// Outputs: none (alert or DeBug messages as needed)
// returns: The cleaned-up string.
// -----------------------------------------------------------
function TrimFrontEnd(Stn, Chr) {
   var OldStn = Stn;
   var Slen = Stn.length;
   if(Chr == null) // If no Chr given, remove spaces
      Chr = ' ';
   var First = Stn.indexOf(Chr);

   while (First == 0) {
      Stn = Stn.substring(1, Slen);
      Slen = Stn.length;
      First = Stn.indexOf(Chr);
   }

   return Stn; // return the cleaned-up string
}

// -----------------------------------------------------------
// Remove all trailing Chrs or spaces on the passed-in string.
//
// inputs:  The string to clean up: Stn & the Chr to remove
//          If Chr is null then assume use of Chr = space.
// Outputs: none (alert or DeBug messages as needed)
// returns: The cleaned-up string.
// -----------------------------------------------------------
function TrimBackEnd(Stn, Chr) {
   var OldStn = Stn;
   var Slen = Stn.length;
   if(Chr == null) // If no Chr given, remove spaces
      Chr = ' ';
   var Last = Stn.lastIndexOf(Chr);

   while (Slen-1 == Last) {
      Stn = Stn.substring(0, Slen-1);
      Slen = Stn.length;
      Last = Stn.lastIndexOf(Chr);
   }

   return Stn; // return the cleaned-up string
}



// -----------------------------------------------------------
// Remove all leading & trailing spaces or spaces from the 
// passed-in string.
//
// inputs:  The string to clean up.
// Outputs: none (alert or DeBug messages as needed)
// returns: The cleaned-up string.
// -----------------------------------------------------------
function Trim(s_value) {
   var o_re;

   //right trim
   o_re    = /\s*$/;
   s_value = s_value.replace(o_re, "");

   //left trim   
   o_re    =/^\s*/;
   s_value = s_value.replace(o_re, "");
   //alert(s_value);
   return(s_value);
}


// -------------------------------------------------------
// This function correctly gets the last update date for 
// both IE & NS browsers.
//
// inputs:  none
// outputs: none
// actions: Save correct date & year in global vars
// returns: none
// -------------------------------------------------------
var LastUpdate = ""; // These need to be global Or, placed 
var Year = "";       // in your HTML <head><script> section
function GetLastUpDate() {

   var Dt = document.lastModified; // added 01/15/2003
   var Dt02;
   var pnt = Dt.lastIndexOf(" "); // find the last space

   if(Dt.length > 25) { // Needed to get to correct version for NetScape 7.0
      //document.location.href="indexNS.html";
   }

   Dt02 = Dt.substring(0, pnt); // chop off everything after last space
   
   // ----------------------------------------------------
   // If there was a "GTM" at the end of the original time,
   // then we also need to still remove the hrs:mins:sec
   // So, once again remove all past new last space
   // ----------------------------------------------------
   if(Dt.lastIndexOf("GMT") != -1) { // Got GMT!
      pnt = Dt02.lastIndexOf(" ");

      LastUpdate = Dt02.substring(0, pnt);
      Year = LastUpdate.substring(LastUpdate.length-4, LastUpdate.length);
   }
   else {
      LastUpdate = Dt02;
      Year = LastUpdate.substring(LastUpdate.length-4);
   }
   // -------------------------------------------------------


}


// -------------------------------------------------------------------
// Parses all innerHTML sent to find E: & BuildIt and replace it with
// the actual email address.
// Form of the email address line is:
// Email line form: |ke3fl|hoo|ya|0|
//                     0    2  1  3
//
// inputs:  PgDat - the full html page
// outputs: none
// actions: email addresses are rebuilt and replace the email lines
// returns: The corrected full html page
// -------------------------------------------------------------------
function BuildIt(a, b, c, d) { // pk01

   var Stng = ""; // This line being built up

   Stng = '<a href="mailto:' + a  + "@" + c + b;
   switch (d/1) { // Make sure it's a number!
      case 0:
         Stng += ".com";
         break;
      case 1:
         Stng += ".net";
         break;
      case 2:
         Stng += ".org";
         break;
      case 3:
         Stng += ".gov";
         break;
      default:
         Stng += ".ccc";
   }
   Stng +=  '">[Send Mail]</a>';

   document.write(Stng);
   //alert(Stng);

} // end of: BuildIt(PgDat)


// ###################################################################
