// BEGIN COOKIE CODE


    function addCookie(tag, value) {
       var expireDate = new Date();
       var expireString = "";
       expireDate.setTime(expireDate.getTime() + (1000 * 60 * 60 * 24 * 365));
       expireString = "expires=" + expireDate.toGMTString();
       document.cookie = tag + "=" + escape(value) + ";" + expireString + ";";
    }

    function getCookie(tag) {
       var value = null
       var myCookie = document.cookie + ";"
       var findTag = tag + "="
       var endPos
    
       if (myCookie.length > 0) {
          var beginPos = myCookie.indexOf(findTag);
          if (beginPos != -1) {
             beginPos += findTag.length
             endPos = myCookie.indexOf(";", beginPos)
             if (endPos == -1) 
                endPos = myCookie.length;
             value = unescape(myCookie.substring(beginPos, endPos));
          }
       }
       if (value == null) {
          value = " "
       }
       return value;
    }

function saveInfo() {
		 addCookie("field4x", document.contact.field4x.value)
		 addCookie("suggestionsx", document.contact.suggestionsx.value)
		 addCookie("memberx", document.contact.memberx.value)
 		 addCookie("notifyx", document.contact.notifyx.value)
		 addCookie("field1x", document.contact.field1x.value)
		 addCookie("field2x", document.contact.field2x.value)
		 addCookie("field3x", document.contact.field3x.value)
		 addCookie("phonex", document.contact.phonex.value)
		 addCookie("streetx", document.contact.streetx.value)
		 addCookie("cityx", document.contact.cityx.value)
 		 addCookie("statex", document.contact.statex.value)
		 addCookie("zipx", document.contact.zipx.value)
		 }


// END COOKIE CODE



var eAddrGood;

function checkemail(field) {

    var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);

    if (goodEmail){
        eAddrGood = true
    } else {
        eAddrGood = false
    }
} //end checkEmailAddr


function checkField(f)
{
    for (var j=0; j < f.value.length; j++)
    {
        /*
		if  (f.value.charAt(j) == "'") 
        {
            f=" ";
            alert("Do not use the single quote ( ' ) .") ;
            return false;
        }
		*/
    }
    if( f.value.length < 1 ) 
    {
        return false ;
    }
    return true;
}

                   function checkFieldb(f)
{
    for (var j=0; j < f.value.length; j++)
    {
        /*
		if  (f.value.charAt(j) == "'") 
        {
            f=" ";
            alert("Do not use the single quote ( ' ) .") ;
            return false;
        }
		*/
    }
 	if( f.value.length < 8 ) 

    {
        return false ;
    }
    return true;
}
//

function checkForm(form){
   eAddrGood = false ;
   checkemail(form.email) ;

    if(!checkField(form.fname) )
    {
        alert('Please enter your first name.') ;
        form.fname.focus() ;
        return false ;
    }
    if(!checkField(form.lname) )
    {
        alert('Please enter your last name.') ;
        form.lname.focus() ;
        return false ;
    }
    if(!checkFieldb(form.strCAPTCHA) )
    {
 alert('Please type the number from the picture in the box provided.') ;
		form.strCAPTCHA.focus() ;
        return false ;
    }

    if(eAddrGood == false) 
    {
        alert('Please enter a valid email address.');
        form.email.focus() ;
        return false ;
    }
	//return saveInfo()
}




