// admin newsletter pre-send alert
function newsletter_send_alert(){
	return confirm("Are you sure you would like to send this newsletter?\n\nClick 'OK' to send the newsletter to the mailer queue now OR 'Cancel' to abort");
}


// input buttons hover class handling
function hov(loc,cls){
	if(loc.className) {
		loc.className=cls;
	}
}

// depreciated March 22 2007
// on registration form - new user/member link
function create_user_before_create_registration( post_confirm_url ){
	var message = "After you create the new Member, you will be re-directed back to this page to complete the new Registration.\n\nWould you like to create the new Member now?";
	var bool = confirm( message );
	if ( bool == true ) {
		document.location = post_confirm_url;
	} else {
		return false;
	}
}




















// survey validation helpers
function validateRadioQuestion(radioObject) {
	var was_checked = false;
	for (var i=0; i < radioObject.length; i++)	{
		if (radioObject[i].checked) {
			var was_checked = true;
		}
	}
	return was_checked;
}
function validateTextareaQuestion(textareaObject) {
	if(textareaObject.value==null || textareaObject.value=="") {
		return false;
	}
}
function validateTextQuestion(textObject) {
	if(textObject.value==null || textObject.value=="") {
		return false;
	}
}
// validation
function validateForm() {
	/*formObject = '';
	alert(document.booking.p1_q1.length);
	return false;*/
	var formObjectPath = document.booking;
	// name
	if (validateTextQuestion(formObjectPath.name) == false) {
		alert('Please include your name');
		formObjectPath.name.focus();
		return false;
	}
	// loba_phone_number
	if (validateTextQuestion(formObjectPath.lob_phone_number) == false) {
		alert('Please include your phone number in the Lake of Bays region');
		formObjectPath.lob_phone_number.focus();
		return false;
	}
	// done validation
}

