/* drop down functionality */

function dropdown(objectID,opacity) {
	if (document.getElementById) document.getElementById(objectID).style.visibility = (opacity) ? "visible" : "hidden";
}


/* jquery contact form validation */

$(document).ready(function(){
	$('INPUT,TEXTAREA').keypress(function(){
		this.form.elements.pv.value='verified';
	});
});

function fnValidate(f) {
	if (f.Name.value.length < 1) {
		alert('Please enter your name to continue.');
		f.Name.focus();
		return false;
	}
	if (!IsValidEmail(f.Email.value)) {
		alert('Please enter a valid email address to continue.');
		f.Email.focus();
		return false;
	}
	return true;
}

function isNumeric(val) {
	var ValidChars = "0123456789.-()";
	for (i=0; i<val.length; i++) if (ValidChars.indexOf(val.charAt(i)) == -1) return false;
	return true;
}

function IsValidEmail(val) {
	var iLen = val.length;
	if 	(iLen < 6 || val.indexOf('@') < 1 || (val.charAt(iLen - 3) != '.' && val.charAt(iLen - 4) != '.' && val.charAt(iLen - 5) != '.')) return false;
	return true;
}


/* pop up window */

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=400,height=800,left=400,top=50');");
}

