/* author: John Haddock */
/* Creation date: 28/07/2007 */
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Toicontien | http://www.webdeveloper.com/forum/showthread.php?t=155379 */

function emailPage() {
  var messageText = 'Hello, I found a great web page at ' + window.location;
  var subjectText = 'Check out this Website';
  var email = prompt("Enter your friend's email address:", '');
  if ( (email == "") || (email == null) ) {
      alert("You need to enter an e-mail address");
      emailPage();
  } else {
    window.location = 'mailto:' + email +
      '?subject=' + encodeURIComponent(subjectText) +
      '&body=' + encodeURIComponent(messageText);
  }
}
