// JavaScript Document

function resetCount(textArea,counterField,maxLength)
{
    counterField.value = maxLength - textArea.value.length;
}
	
	
function countCharacters(textArea, counterField, maxLength)
{		
    if(textArea !=null && textArea.value != null) 
    {
        if (textArea.value.length > maxLength)
        {
            alert("Your message may not exceed " +  maxLength +" characters in length.");
            textArea.value = textArea.value.substring( 0, maxLength);
        } 
        else 
        {
            counterField.value = maxLength - textArea.value.length;
        }
    }
}

function openMapForm(page)
{
    window.open(page,'MapForm','height=550,width=750,scrollbars=yes,resizable=yes');
}


function validateForm(formName)
{
    var phone = document.forms[formName].elements["phone"].value;
    if (phone == "") 
    {
        alert("PLEASE INCLUDE A CALLBACK NUMBER SO WE CAN CONTACT YOU RIGHT AWAY.");
        return false;
    }
}