// JavaScript Document

// pop-up function from accessify.com
var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
			newWin.close();
	}
}
function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="console") strOptions="resizable,scrollbars,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
newWindow = window.open(strURL, 'newWin', strOptions);
newWindow.focus(); //my modification to give the pop-up focus again if user does not close 
}

//text limit function - use for text areas
function textLimit(field, maxlen) {
if (field.value.length > maxlen + 1)
alert('Maximum of 255 characters please');
if (field.value.length > maxlen)
field.value = field.value.substring(0, maxlen);
}

//from: http://www.ardamis.com/2007/07/12/defeating-contact-form-spam/
function formProtect() {
	document.getElementById("form_form").setAttribute("action","apvwZmW8lbvB5Y9jrH1BMdnYuYZGR5b6aqZpounSVqGBRICrkayAbPJtNlLKBbt.php");
}
