function DTitle(i,a){
var d;
if(a!=null){
d=a}
else if(a==null){
d=i.defaultValue}
if(navigator.appName=='Microsoft Internet Explorer'){
i.title=d}}
function DFocus(i,a){
var d;
if(a!=null){
d=a}
else{
d=i.defaultValue}
if(i.value==d){
i.value=''}
window.status=d;
i.select()}
function DBlur(i){
if(i.value==''){
i.value=i.defaultValue}
window.status=window.defaultStatus}
function DFocusTextArea(i,a){
var d;
if(a!=null){
d=a}
else{
d=i.defaultValue}
if(i.value==d){
i.value=''}
window.status=d;
i.select()}
function DBlurTextArea(i,b){
if(i.value==''){
if(b!=null){
i.value=b}}
window.status=window.defaultStatus}
function BeforeEmailCheck(i){
if(!(i.value==''||i.value==i.defaultValue||i.value=='n/a'||i.value=='E-mail*')){
return EmailCheck(i.value)}}
function LabelCheckbox(i){
if(i.checked==true){
i.checked=false}
else{
i.checked=true}}
function BeforeSubmit(i){
var msgError='';
if(i.fn.value==i.fn.defaultValue){
i.fn.value=='';
msgError+='\n *  Your name'}
if(i.fromemail.value==i.fromemail.defaultValue){
i.fromemail.value=='';
msgError+='\n *  Your e-mail'}
if(i.mb.value==i.mb.defaultValue){
i.mb.value=='';
msgError+='\n *  Comments'}
if(msgError.length>0){
alert('First type:'+msgError+'\nThen select \"Send\" again to continue...');
return false}
else if(confirm('As a condition of use, you must agree without limitation:\nto take on yourself full legal responsibility for all the\nelectronic communications that you send from this\nsite, and to indemnify the producer(s) and owner(s)\nof this site from all liabilities and costs. It may be possible\nfor third parties to intercept these communications.')==true){
return true}
else{
return false}}

//This script and many more are available free online at
//The JavaScript Source!! http://javascript.internet.com
function EmailCheck(emailStr){
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s"+specialChars+"\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars+'+'
var word="("+atom+"|"+quotedUser+")"
var userPat=new RegExp("^"+word+"(\\."+word+")*$")
var domainPat=new RegExp("^"+atom+"(\\."+atom+")*$")
var matchArray=emailStr.match(emailPat)
if(matchArray==null){
alert("The e-mail address is not correct.\n(Check @ and .'s)")
return false}
var user=matchArray[1]
var domain=matchArray[2]
if(user.match(userPat)==null){
alert("The e-mail address is not correct.\n(Its username is not valid.)\ne.g. username@example.com")
return false}
var IPArray=domain.match(ipDomainPat)
if(IPArray!=null){
for(var i=1;i<=4;i++){
if(IPArray[i]>255){
alert("Destination IP address is invalid!")
return false}}
return true}
var domainArray=domain.match(domainPat)
if(domainArray==null){
alert("The e-mail address is not correct.\n(Its domain is not valid.)\ne.g. example@domain.com")
return false}
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if(len<2){
alert("The e-mail address is not correct.\n(It is missing a hostname.)\ne.g. example@domain.com")
return false}
return true}
