emailRegEx = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;

function checkminisignup()
{   
    if(!$F('email'))
    {   alert('Please enter email');
        return false;
    }
    else
    { 
        var reg = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
		if(reg.test($F('email')) == false)
        {   alert('Sorry but the e-mail you have entered does not appear to be a real e-mail address. Please verify that you have entered it correctly. (Example: youremail@address.com)');
            return false;
        }
    }
    if(!$F('password'))
    {   alert('Please enter password');
        return false;
    }
    if(!$F('repassword'))
    {   alert('Please reenter password');
        return false;
    }
    if($F('password') != $F('repassword'))
    {   alert('Passwords do not match');
        return false;
    }
	return true;
}
function checksignup()
{   
    if(!$F('email'))
    {   alert('Please enter email');
        return false;
    }
    else
    { 
        var reg = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
		if(reg.test($F('email')) == false)
        {   alert('Sorry but the e-mail you have entered does not appear to be a real e-mail address. Please verify that you have entered it correctly. (Example: youremail@address.com)');
            return false;
        }
    }
	if(!$F('fname'))
    {   alert('Please enter your first name');
        return false;
    }
	if(!$F('lname'))
    {   alert('Please enter your last name');
        return false;
    }	
	if(!$F('address'))
    {   alert('Please enter your address');
        return false;
    }
	if(!$F('city'))
    {   alert('Please enter your city');
        return false;
    }
	if(!$F('state'))
    {   alert('Please enter your state');
        return false;
    }
	if(!$F('zip'))
    {   alert('Please enter your area code');
        return false;
    }
	if(!$F('billfname'))
    {   alert('Please enter your billing first name');
        return false;
    }
	if(!$F('billlname'))
    {   alert('Please enter your billing last name');
        return false;
    }
	if(!$F('billaddress'))
    {   alert('Please enter your billing address');
        return false;
    }
	if(!$F('billcity'))
    {   alert('Please enter your billing city');
        return false;
    }
	if(!$F('billstate'))
    {   alert('Please enter your billing state');
        return false;
    }
	if(!$F('billzip'))
    {   alert('Please enter your billing area code');
        return false;
    }
    /*
	if(!$F('ccfirstdigits1'))
    {   alert('Invalid Credit Card number');
        return false;
    }
	if(!$F('ccfirstdigits2'))
    {   alert('Invalid Credit Card number');
        return false;
    }
	if(!$F('ccfirstdigits3'))
    {   alert('Invalid Credit Card number');
        return false;
    } */
	if(!$F('ccnum'))
    {   alert('Invalid Credit Card number');
        return false;
    }
	if(!$F('ccexpmonth'))
	{   alert("Please enter your Credit Card's expiration month");
        return false;
    }
	if(!$F('ccexpyear'))
	{   alert("Please enter your Credit Card's expiration year");
        return false;
    }
    return true;
}

function checkminisignup()
{   
	if(!$F('fname'))
    {   alert('Please enter your first name');
        return false;
    }
	if(!$F('lname'))
    {   alert('Please enter your last name');
        return false;
    }
	
	if(!$F('address'))
    {   alert('Please enter your address');
        return false;
    }
	if(!$F('city'))
    {   alert('Please enter your city');
        return false;
    }
	if(!$F('state'))
    {   alert('Please enter your state');
        return false;
    }
	if(!$F('zip'))
    {   alert('Please enter your area code');
        return false;
    }
    return true;
}

function chkForm()
{	_form = $('acctselect'); //document.profile;
	err = '';
	emailRegEx = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;

	if( _form.fname.value.length == 0 )
		err += '\n\r       - Please Enter your First Name';

	if( _form.lname.value.length == 0 )
		err += '\n\r       - Please Enter your Last Name';
	
	if( _form.email.value.search(emailRegEx) != 0 )
		err += '\n\r       - Please supply a proper email address';
	
	if( _form.password.value != _form.password2.value )
		err += '\n\r       - The password fiels must match the verify password field';
	
	
	if( err == '')
		_form.submit();
	else
		alert('Please complete all the required fields.\n\rThe following fields were not completed properly.'+err);
}
