function clearHtmlForm()
{
document.all["d1"].style.display="none";
document.all["d2"].style.display="none";
document.all["d3"].style.display="none";
document.all["d4"].style.display="none";
document.all["d5"].style.display="none";
document.all["d6"].style.display="none";
}

function check_email(Email) // check for Email field
{
  if (Email.length >0 )
	  {
		var i   = Email.indexOf("@")
		var j   = Email.indexOf(".",i)
		var k   = Email.indexOf(",")
		var kk  = Email.indexOf(" ")
		var jj  = Email.lastIndexOf(".") + 1
		var len = Email.length

		if (!(i > 0 && j > (i + 1) && k == -1 && kk == -1 && (len - jj) >= 2 && (len - jj) <= 3))
			{
			document.mail_info.email_c.value=100
			return false;
			}
  }
   else
	   {     
   		document.mail_info.email_c.value=100
		return false;
		}
  return true;
}

function check_field(str)    // check for an empty field
{
  if (str=="" || str=="null" ||  str.length==0)
    return false;
  else
    return true;
}

function check_num(num)    // check for a valid number
{
 	if (isNaN(num))
      return false
  else
      return true
}

function sendmail1()  // check the form before sending the mail
{
user_name=document.mail_info.full_name.value
email=document.mail_info.email.value
flag=false

if(!check_field(user_name))
	document.mail_info.full_name_c.value=99
else
	document.mail_info.full_name_c.value=-1
	
if(!check_field(email))
	document.mail_info.email_c.value=99
else if(!check_email(email))
	document.mail_info.email_c.value=100
else 
	document.mail_info.email_c.value=-1
	
if((document.mail_info.email_c.value==-1)  && ( document.mail_info.full_name_c.value==-1))
	flag=true
if(flag)
{
	document.mail_info.method="post"
	document.mail_info.action="thanks1.asp"
	
}
else
{
	document.mail_info.method="post"	
}
	document.mail_info.submit()
}



