
function val(){ 
if (document.dowemail.name.value.length <=0) fail ("Please enter your name");
else if (document.dowemail.email.value.length <=0) fail ("Please enter your E-mail address");
else if(document.dowemail.email.value.indexOf("@")== -1)
fail("No '@' in E-mail address");
else{
var adr = document.dowemail.email.value.split("@");
if (adr[0].length < 1) fail ("User address absent");
else if (adr[1].length <=0) fail ("No domain entered");
else if (document.dowemail.mesg.value.length <=0) fail ("No Message!"); 
else dowemsg();}
}

function fail(msg){
alert("Please enter your Information correctly:\n" +msg);}

if (navigator.appVersion.lastIndexOf('Win') != -1) {
      dropline = "\r\n"  } else { dropline = "\n" }

function dowemsg(form) {

document.dowemail.Message.value = ('  ' + dropline 
 + 'Subject     : ' + document.dowemail.subject.value + dropline
 + 'Name        : ' + document.dowemail.name.value + dropline
 + 'Company Name: ' + document.dowemail.compname.value + dropline
 + 'Phone       : ' + document.dowemail.phone.value + dropline
 + 'E-mail      : ' + document.dowemail.email.value + dropline
 + 'Message     : ' + document.dowemail.mesg.value + dropline
 + dropline+ '------End------- ');

document.dowemail.submit();
}


