function verifyStateFt()
{
    var statesAndProvincesTextForJS = new String("state");
    var state = document.stateFormFooter.state.selectedIndex;

    if (state == 0)
    {
        alert('Please select a ' + statesAndProvincesTextForJS + ' to continue.');
    }
    else
    {
        document.stateFormFooter.submit();
    }

}

function emailWindow(url) {
  	theWindow = window.open(url,
  	'mapWin', 'width=515,height=298,left=0,top=0,scrollbars=yes,resizable=yes,left=300,top=250')
	theWindow.focus();
	}
	
function emailCheck(type) // not sure if anybody uses this, but just in case i'm leaving it functional
{
    if (!validateEmail(document.emailForm.emailAddress.value))
	{
        alert('Please enter a valid e-mail address.');
        return false;
    }
	if(type == 1)
	{
        document.emailForm.submit();
	}
}

function validateEmail(email)
{
    var vAtSym    = email.indexOf('@')
    var vPeriod   = email.lastIndexOf('.')
    var vSpace    = email.indexOf(' ')
    var vLength   = email.length - 1   // Array is from 0 to length-1

    if (vAtSym < 1 ||                     // '@' cannot be in first position
    	vPeriod <= vAtSym + 1 ||          // Must be atleast one valid char btwn '@' and '.'
    	vPeriod == vLength  ||            // Must be atleast one valid char after '.'
    	vSpace  != -1)                    // No empty spaces permitted
	{
        return false;
    }
	return true;
}
