// global variables
var msg ="Please make sure all the proper fields are filled.";

function _select(box) {
	url = 'calendar.cfm?' + box.options[box.selectedIndex].value
	top.location = url
}

function event_submit() {

	// first check fields
	var m = verify();
	
	if (m == true) {
		document.getElementById('eventform').submit();
	}
}

function verify() {
	with(document.eventform) {
		var missing = false;
		var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
		var check=/@[\w\-]+\./;
		var checkend=/\.[a-zA-Z]{2,3}$/;
		
		if(contact.value == "" ) {missing=true; msg="Please enter contact information about this event.";}
		if(city.value == "" ) {missing=true; msg="Please enter the city where this event will be held.";}
		if(address.value == "") {missing=true; msg="Please enter the street address where this event will be held.";}
		if(location.value == "") {missing=true; msg="Please enter venue information.";}
		if(eventname.value == "" ) {missing=true; msg="Please enter the name of the event.";}
		
		
		if (missing) {
			alert(msg);
			return false;
		}
		
	 	document.eventform.action = "calendar_event_add.cfm";
		return true;
	
	}
}

function areyousure(URL)
{
if (confirm("Are you sure you want to permanently delete this event?") )
{
parent.location=URL;
}
	else
	{
	}

}
