// Function: Is Blank?
// Returns true or false depending on whether source string is blank.

function isBlank( str ) { return str.match( /^\s*$/ ) }


// Function: Jump To
// Jumps to a URL without having the actual URL in the page (to avoid spiders
// and indexing -- for now.)

function JumpTo( url ) {
   url = 'http://' + url.replace( /\s*[\[\(]dot[\]\)]\s*/gi, '.' );
   var wdw = window.open( url );
   wdw.focus();
}


// Function: Send Mail
// Forms anti-spam "mailto:" tag base on input of:
//    username (at) host (dot) TLD  -or-
//    username [at] host [dot] TLD

function SendMail( mailto, subject ) {
   // Anti-spam function.  Spammers are pathetic low-life...
   mailto   = mailto.replace( /\s*[\[\(]at[\]\)]\s*/gi, '@' );
   var addr = mailto.replace( /\s*[\[\(]dot[\]\)]\s*/gi, '.' );
   if (!isBlank( subject )) addr += '?subject=' + subject;
   parent.location = 'mailto:' + addr;
   return true;
}


// Function: Show Mail
// Shows email from "anti-spam" format in HTML to real format in status window.
// Use format of SendMail().

function ShowMail( mailto ) {
   // Anti-spam function.  Spammers are pathetic low-life...
   mailto   = mailto.replace( /\s*[\[\(]at[\]\)]\s*/i, '@' );
   var addr = mailto.replace( /\s*[\[\(]dot[\]\)]\s*/i, '.' );
   parent.status = 'Send Email To ' + addr;
   return true;
}


// Function: Status
// Shows status on status line for easy onMouseOver/onMouseOut calls.
// (Call as onMouseOver="return Status( 'Some message' );" )

function Status( msg ) {

   // Strip tags in status messages, then present message in parent window.

   msg = msg.replace( /\<\/?\w+\>/g, '' );
   window.parent.status = msg;
   return true;

}


// Function: Puts
// Puts string to document, Ruby-style.

function puts( str ) { document.write( str ) }

