// JavaScript Document

function fullcheck()
{
var str=document.oi_form.email.value;
//alert(str);


if (document.oi_form.fname.value=="")
  {
    alert ("White space is not allowed.Please fill out Your Name.");
    document.oi_form.fname.select(); 
    return false;
  }



 if (document.oi_form.compname.value=="")
  {
    alert ("White space is not allowed.Please fill out Your Company Name.");
    document.oi_form.compname.select(); 
    return false;
  }
  
  
 if (document.oi_form.websiteurl.value=="")
  {
    alert ("White space is not allowed.Please fill out Your Website url.");
    document.oi_form.websiteurl.select(); 
    return false;
  }
  
  
  
 if (document.oi_form.phone.value=="")
  {
    alert ("White space is not allowed.Please fill out Your Phone Number.");
    document.oi_form.phone.select(); 
    return false;
  }
  
  
  
  
  if ((document.oi_form.email.value).indexOf(" ")>=0)
		{
		alert ("White space is not allowed within your email!");
		document.oi_form.email.select();
		return false;
		}
	
		if (document.oi_form.email.value.indexOf("@",1) == -1)
		{
			alert("Invalid E-Mail");
			document.oi_form.email.focus();
			document.oi_form.email.select();
			return(false);
		}
		if (document.oi_form.email.value.indexOf("@") == 0)
		{
			alert("Invalid E-Mail");
			document.oi_form.email.focus();
			document.oi_form.email.select();
			return(false);
		}
		if (document.oi_form.email.value.indexOf(".",5) == -1)
		{
			alert("Invalid E-Mail");
			document.oi_form.email.focus();
			document.oi_form.email.select();
			return(false);
		}
		if (document.oi_form.email.value.indexOf(".") == 0)
		{
			alert("Invalid E-Mail");
			document.oi_form.email.focus();
			document.oi_form.email.select();
			return(false);
		}
		
		if ((document.oi_form.email.value.lastIndexOf(".")) -(document.oi_form.email.value.indexOf("@"))<4 )
		{
		
			alert("Invalid E-Mail");
			document.oi_form.email.focus();
			document.oi_form.email.select();
			return(false);
		}
		
		if ((document.oi_form.email.value.length)-(document.oi_form.email.value.indexOf("."))<2)
		{
			alert("Invalid E-Mail");
			document.oi_form.email.focus();
			myform.oi_form.select();
			return(false);
		}
		

var posat=str.indexOf("@");
var posdot=str.indexOf(".");
var rposdot=str.lastIndexOf(".");
//alert(posat); 
//alert(posdot);
//alert(rposdot);


if(rposdot==posdot)
if((posdot < posat) || (posdot-posat < 4))
{
//alert("needs at last 3 cars between @ and . sign");
alert("Invalid E-Mail");
return false;
}

if(str.charAt(str.length-1)==".")
{
//alert("cannot end with .");
alert("Invalid E-Mail");
return false;
}

if(str.charAt(str.length-1)=="@")
{
//alert("cannot end with @");
alert("Invalid E-Mail");
return false;
}

var j=0;
for( var i=0;i<str.length;i++)
{
if(str.charAt(i) == "@")
j++;
}
if(j > 1)
{
//alert("only one @ sign allowed");
alert("Invalid E-Mail");
return false;
}

if (document.oi_form.number.value=="")
  {
	alert("Please enter your verification code.");
    document.oi_form.number.select(); 
    return false;
  }

return true;
}
