//============================================================
//Script:     Automatic E-mail This Link Script 
//            With Auto-Capture and Validation
//
//Functions:  This script automatically captures the title of
//            the current page and the url of the current page
//            and sends them via the user's e-mail client to
//            an address entered in a box on the form.  The
//            e-mail address field is also checked to see that
//            it is not empty, and that the e-mail address is
//            in valid format.
//
//Browsers:   IE4-6, NS4-6
//
//Author:     etLux
//============================================================
//
//Put the following script in the body of your page.  No
//modifications are needed. Note the two expressions commented
//in the script that each must be placed intact on a single
//line.

//<!-- Begin E-Mail-This-Page Script //-->

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header

var good;
function checkEmailAddress(field) {
// the following expression must be all on one line...
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
if (goodEmail){
   good = true
} else {
   alert('Please enter a valid e-mail address.')
   field.focus()
   field.select()
   good = false
   }
}

u = window.location;
v = "Visit Melcer Tile online at http://www.melcertile.com";
m = "Melcer Tile website page link for your reference";
function mailThisUrl(){
   good = false
   checkEmailAddress(document.eMailer.address)
   if (good){
      // the following expression must be all on one line...
      window.location = "mailto:"+document.eMailer.address.value+"?subject="+m+"&body="+document.title+" "+u+"\n\n" +v+".";
   }
}

