// SUBMIT WITH ENTER




///SHOW HIDE DIVS

function showHide(inID) {
     if (document.getElementById(inID).style.display == 'none') {
          document.getElementById(inID).style.display = 'block';
     } else {
          document.getElementById(inID).style.display = 'none';
     }
}

// POPUP

function popitup(url) {
	newwindow=window.open(url,'name','height=425,width=625');
	if (window.focus) {newwindow.focus()}
	return false;
}


//QUICK CONTACT POPUP

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=340,left = 415,top = 214');");
}


//COUNTY LIST POPUP

function popUpCT(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=340,left = 415,top = 214');");
}


// AUTO TAB

function autoTab(element, nextElement) {
    if (element.value.length == element.maxLength && nextElement != null) {
        element.form.elements[nextElement].focus();
    }
}


// TEXT AREA COUNTER >> Counter Box <input readonly type=text name=message_size size=3 maxlength=3 value="0">  <textarea NAME="message" ROWS="5" wrap="physical" COLS="50" onKeyDown="textCounter(this.form.message,this.form.message_size,1000);" onKeyUp="textCounter(this.form.message,this.form.message_size,1000);"></textarea>

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value =  field.value.length;
}
