function toggleView(objID) {
	var dispType = document.getElementById(objID).style.display;
	if (dispType == 'block') {
		document.getElementById(objID).style.display = 'none';
		document.getElementById('ctl.'+objID).innerHTML = 'Show';
	} else {
		document.getElementById(objID).style.display = 'block';
		document.getElementById('ctl.'+objID).innerHTML = 'Hide';
	}
}

function guestRSVP() {
	var maxGuests = 7;
	var menuOptions = "<option value='0'>Choose an Option</option>";
	menuOptions += "<option value='0' disabled='disabled'>&nbsp;&nbsp;&nbsp;-----</option>";
	var guestCount;
	this.addMenuOption = function(i,t) { menuOptions += "<option value='"+i+"'>"+t+"</option>"; }

	this.initGuest = function(n) {
		guestCount = n;
		for(i=1; i<=guestCount; i++) {
			var nextLine = this.addLine(i);
			document.getElementById('rsvpForm1').innerHTML += nextLine;
		}
	}
	this.addAnotherGuest = function() {
		var nextID = guestCount + 1;
		var nextLine = this.addLine(nextID);
		document.getElementById('rsvpForm1').innerHTML += nextLine;

		guestCount++; 
//		alert("Guest Count: "+guestCount);
		this.refreshGuestCount();
		if(guestCount >= maxGuests) { document.getElementById('rsvpAddButton').innerHTML = ""; }
	}
	this.addLine = function(i) {
		r = "<p><b>Name:</b> <input type='text' name='rsvpName"+i+"' id='rsvpName"+i+"' /> ";
		r += "<select name='rsvpMenu"+i+"' id='rsvpMenu"+i+"'>"+menuOptions+"</select> ";
		r += "<input type='text' name='rsvpNotes"+i+"' />";
		r += "</p>";
		return r;
	}
	this.refreshGuestCount = function() { document.getElementById('mpp_num_rsvp').value = guestCount; }
}

function validFormRSVP2() {
	this.setError = function(t) { document.getElementById('mpp_rsvp_error').value = "<p class='errorText'>"+t+"</p>"; }
	if(document.getElementById('rsvpName1').value == "") { 
		this.setError("At least, the first listed name must not be blank");
		return false;
	}
return false;

}

function validFormRSVP() {
	setError = function(t) { document.getElementById("mpp_rsvp_error").innerHTML = "<p class='errorText'>"+t+"</p>"; }

	if(document.getElementById('rsvpName1').value.length <= 0) { 
		setError("At least, the first listed name must not be blank");
		return false;
	} 
	for(var i=1; i < 7; i++) {
		var rsvpName = 'rsvpName'+i;
		var rsvpMenu = 'rsvpMenu'+i;
		if((document.getElementById(rsvpName).value.length > 0) && (document.getElementById(rsvpMenu).value == 0)) { 
			setError("There is no menu choice listed for "+document.getElementById(rsvpName).value+".");
			return false;
		}
	}

	return true;
}