// JavaScript Document
function CopyRight(){
	var mydate=new Date()
	var year=mydate.getYear()
	if (year < 2000) year = 1900 + year;
    var cRight = "Copyright " + year + " - Virtual Vista, a division of FormsTech Inc."
	
	cRight = cRight + "&nbsp;|&nbsp;<a href='http://www.riccaswebdesigns.com' target='_blank'>Created by Riccas Web Designs</a>"
	
	return(cRight)
}

function checkform_1(form)
{
	var msg=new String()	
  	msg = ""
  	if (form.INPUT_01.value == "") {
		msg = msg +  "\n Name must be filled";
    	
	}
	if (form.INPUT_02.value == "") {
		msg = msg + "\n Email must be filled";
    	
	}
	if (msg != "") {		
    	alert( msg );
		form.INPUT_01.focus();
    	return false ;
	}	
  
  return true ;
}
function verifyRequired() {
  if (document.orderform["req_name"].value == "") {
    document.orderform["req_name"].focus();
    alert("The Requestor's Name field is required.");
    return false;
  }
  if (document.orderform["req_company"].value == "") {
    document.orderform["req_company"].focus();
    alert("The Requestor's Company or Agency field is required.");
    return false;
  }
  if (document.orderform["req_city"].value == "") {
    document.orderform["req_city"].focus();
    alert("The Requestor's City field is required.");
    return false;
  }
  if (document.orderform["req_state"].value == "") {
    document.orderform["req_state"].focus();
    alert("The Requestor's State field is required.");
    return false;
  }
  if (document.orderform["req_zip"].value == "") {
    document.orderform["req_zip"].focus();
    alert("The Requestor's Zip Code field is required.");
    return false;
  }
  if (document.orderform["req_email"].value == "") {
    document.orderform["req_email"].focus();
    alert("The Requestor's Email field is required.");
    return false;	 
  } 
  if (echeck(document.orderform["req_email"].value)==false){
		document.orderform["req_email"].value="";
		document.orderform["req_email"].focus();
		return false;
	}
  
  if (document.orderform["req_phone"].value == "") {
    document.orderform["req_phone"].focus();
    alert("The Requestor's Phone field is required.");
    return false;
  }


return true;

}
function isValidEmail(str) {

   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
 


}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}




