var txtCnt=1;function add_Another(){    if (eval(txtCnt)>9)    {        alert('You can send a maximum of 10 friends at a time!');        return;    }    else    {        var mnArea = document.getElementById('divFrmName');
        var newTextBox = document.createElement('input');
        newTextBox.setAttribute('type','text');        newTextBox.setAttribute('class','txtCls');        newTextBox.setAttribute('name','txtFrndName');        var newBreak = document.createElement('div');        newBreak.setAttribute('style','height:6px');        mnArea.appendChild(newBreak);        mnArea.appendChild(newTextBox);                var mnAreaEmail = document.getElementById('divFrmEmail');
        var newTextBoxEmail = document.createElement('input');
        newTextBoxEmail.setAttribute('type','text');        newTextBoxEmail.setAttribute('class','txtCls');        newTextBoxEmail.setAttribute('name','txtFrndEmail');        newTextBoxEmail.setAttribute('id','txtFrndEmail'+txtCnt);        var newBreakEmail = document.createElement('div');        newBreakEmail.setAttribute('style','height:6px');        mnAreaEmail.appendChild(newBreakEmail);        mnAreaEmail.appendChild(newTextBoxEmail);                txtCnt = eval(txtCnt) + 1    }}function reset_Form(){    document.getElementById('divFrmName').innerHTML= '';    document.getElementById('divFrmEmail').innerHTML= '';    txtCnt=1;}function frm_Submit(){    if (document.frmFTAF.txtSendEmail.value=='')    {        alert('Enter your email address');        document.frmFTAF.txtSendEmail.focus();        return false;    }    if (validate('txtSendEmail') == false)    {        return false;    }    if (document.frmFTAF.txtFrndEmail.value=='')    {        alert('Please enter senders email address');        document.frmFTAF.txtFrndEmail.focus();        return false;    }    if (validate('txtFrndEmail') == false)    {        return false;    }    if (document.frmFTAF.txtSub.value=='')    {        alert('Enter Subjectline');        document.frmFTAF.txtSub.focus();        return false;    }    /*for (i=1; i<txtCnt; i++)    {        txtFrm_ = 'txtFrndEmail'+i;        if (document.getElementById(txtFrm_).value=='')        {            alert('Enter senders email address');            document.getElementById(txtFrm_).focus();            return false;        }        if (validate(txtFrm_) == false)        {            return false;        }    }*/}function validate(emlText) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.getElementById(emlText).value;
   if(reg.test(address) == false) {
      alert('Invalid Email Address');
      document.getElementById(emlText).focus();
      return false;
   }
}
