// Brad: This file HAS BEEN updated with all your edits


var arrowR_on = new Image(); arrowR_on.src = "images/arrowR_on.gif";
var arrowL_on = new Image(); arrowL_on.src = "images/arrowL_on.gif";
PF = new PrinterFriendly();
var sCalHTML = ( macIE ) ? true : false;
//sCalHTML = true;
var dCalHTML = !sCalHTML;
var nYearsInPulldown = 3;

var dTextCal = [
	"",
	"Show previous day",
	"Go to Today",
	"Show next day",
	"Learn about using our calendar & booking form",
	"Insert data for this client into the booking form below",
	"Flushes new or updated data from server (if any)",
	"Done",
""
];

var calMsg = [
	"ERROR: We're sorry but our calendar is currently unable to display because a data error has been detected",
""];

var gToday = new Date();
var gThisYear = gToday.getFullYear();
var gThisMonth = gToday.getMonth() + 1;
var gThisDay = gToday.getDate();
//--------------------------------------------------------------------------------------
// Sets event date in form when user clicks iFrame Cal or arrows, etc...
function setEventDate( theMonth, theDay, theYear ) {

	try{
		var Form = document.form;
		Form.Wedding_Month.selectedIndex = theMonth - 1;
		Form.Wedding_Day.selectedIndex = theDay - 1;
		Form.Wedding_Year.selectedIndex = theYear - gThisYear;
	}
	catch( e ) {}

}

//--------------------------------------------------------------------------------------
// This function called from showNewDay in iframe when user clicks a new date in calendar OR "Today", "Right" or "Left" arrows in parent and onLoad

function setArrows( theMonth, theDay, theYear, LastDay ) {

	var FirstDay = new Date( gThisYear, gThisMonth - 1, 1 );
	var DateSelected = new Date( theYear, theMonth - 1, theDay );

	var LeftArrow = document.getElementById( "navLeftArrow" );

	if( FirstDay.getTime() == DateSelected.getTime() )
		LeftArrow.className = "visHide";
	else
		LeftArrow.className = "visShow";

	var RightArrow = document.getElementById( "navRightArrow" );

	if( LastDay.getTime() == DateSelected.getTime() )
		RightArrow.className = "visHide";
	else
		RightArrow.className = "visShow";

	var PriorDay = new Date( theYear, theMonth - 1, theDay - 1 );
	var LeftArrowLink = document.getElementById( "navLeftArrowLink" );
	LeftArrowLink.title = "Go to Previous Day: " + ( PriorDay.getMonth() + 1 ) + "/" + PriorDay.getDate() + "/" + PriorDay.getFullYear();

	var NextDay = new Date( theYear, theMonth - 1, theDay + 1 );
	var RightArrowLink = document.getElementById( "navRightArrowLink" );
	RightArrowLink.title = "Go to Next Day: " + ( NextDay.getMonth() + 1 ) + "/" + NextDay.getDate() + "/" + NextDay.getFullYear();

	setEventDate( theMonth, theDay, theYear );

}
//--------------------------------------------------------------------------------------

function getDatesFromQstr() {

	var qStrIsValid = true;
	var qStr = getQueryStr();
	var TheDate = new Array();

	if( qStr && qStr.toLowerCase().indexOf( "date=" ) == 0 ) {
		var dateStr = qStr.split( "=" )[ 1 ];
		dateStr = dateStr.replaceLiteral( "/", "-" );
		TheDate = dateStr.split( "-" );
		if( TheDate.length == 3 ) {
			for( var i = 0; i < TheDate.length; i++ ) {
				if( isNaN( TheDate[ i ] ) ) qStrIsValid = false;
			}
			if( TheDate[ 2 ].length == 2 || TheDate[ 2 ].length == 4 ) {
				if( TheDate[ 2 ].length == 2 )
					TheDate[ 2 ] = "20" + TheDate[ 2 ];
			}
			else
				qStrIsValid = false;
		}
		else qStrIsValid = false;
	}
	else
		qStrIsValid = false;

	// Overide incoming arguments with qStr values
	if( qStrIsValid ) {
		for( var i = 0; i < TheDate.length; i++ )
			TheDate[ i ] = parseInt( TheDate[ i ] );
	}
	else TheDate = null;

	return TheDate;

}

//--------------------------------------------------------------------------------------

function showAutoInsertMsg( evt ) {

	if( gArrIndex == -1 ) {

		var AutoFill = [ "Save Time", "" +

		"You can auto-insert your client's data directly into this booking form if you'd like. It's easy, here's how:" +

		"<OL STYLE='margin-top:4px; margin-bottom:0px;'>" +
			"<LI>If you haven't already done so, locate your client by clicking on their wedding date in the calendar above." +
			"<LI>Then, with your client's data displayed, click the <span style='color:rgb( 0,0,255 );'>Client</span> link located just to the left of their names." +
		"</OL>" +

		"" ];

		if( window.DW ) DW.createWindow( AutoFill, null, evt, [2,-100,-15 ], [0,400,0], 6 );

	}

}
//--------------------------------------------------------------------------------------

gArrIndex = -1;

function autoInsert( arrIndex ) {

	arrIndex = parseInt( arrIndex );

	var client = WebData[ arrIndex ][ 21 ];
	var clientMsg = ( client ) ? client : "this client";

	if( confirm( "Would you like to auto insert the data for \"" + clientMsg + "\" into the booking form below?" ) ) {

		unMarkAllFields();

		gArrIndex = arrIndex;

		var Form = document.form;

		Form.Video_Package.selectedIndex = 0;

		for( var i = 0; i < Form.Coverage_Start_Time.length; i++ ) {
			if( Form.Coverage_Start_Time[ i ].defaultSelected ) {
				Form.Coverage_Start_Time.selectedIndex = i;
				break
			}
		}

		var dateStr = WebData[ arrIndex ][ 0 ];
		var sTime = WebData[ arrIndex ][ 19 ].toLowerCase();
		var eTime = WebData[ arrIndex ][ 20 ].toLowerCase();
		var loc = Loc[ WebData[ arrIndex ][ 24 ].toString() ];
		var pkg = Pkg[ WebData[ arrIndex ][ 22 ].toString() ].toLowerCase();

		var EventDate = dateStr.split( "/" );
		var mon = parseInt( EventDate[ 0 ] );
		var day = parseInt( EventDate[ 1 ] );
		var yr = parseInt( EventDate[ 2 ] );

		Form.Wedding_Month.selectedIndex = mon - 1;
		Form.Wedding_Day.selectedIndex = day - 1;
		Form.Wedding_Year.selectedIndex = yr - gThisYear;

		switch( pkg ) {

			case "akamai":
				Form.Video_Package.selectedIndex = 1; break;

			case "alii":
				Form.Video_Package.selectedIndex = 2; break;

			case "no ka oi":
				Form.Video_Package.selectedIndex = 3; break;

			case "ohana":
				Form.Video_Package.selectedIndex = 4; break;

			case "me ke aloha":
				Form.Video_Package.selectedIndex = 5; break;

			case "kapiolani":
				Form.Video_Package.selectedIndex = 6; break;

			case "kamehameha":
				Form.Video_Package.selectedIndex = 7; break;

			case "directors cut":
				Form.Video_Package.selectedIndex = 8; break;

			// Package not found, so add it as last option in pull-down
			default:

				var addNewOption = true;
				var VideoPullDown = Form.Video_Package;

				// Make sure user didn't already add this one
				for( var i = 0; i < VideoPullDown.length; i++ ) {
					if( VideoPullDown[ i ].value == pkg ) {
						VideoPullDown.selectedIndex = i;
						addNewOption = false;
						break;
					}
				}

				if( addNewOption ) {
					VideoPullDown.length++;
					var newOptionNum = VideoPullDown.length - 1;

					VideoPullDown[ newOptionNum ].value = pkg;
					VideoPullDown[ newOptionNum ].text = pkg.charAt(0).toUpperCase() + pkg.substring( 1, 25 );
					VideoPullDown.selectedIndex = newOptionNum;
				}

		}
		if( sTime ) {
			sTime = sTime.removeWhiteSpace();

			var StartTime = Form.Coverage_Start_Time;
			var sTimeSet = false;
			for( var i = 0; i < StartTime.length; i++ ) {
				var sTimePullDown = StartTime[ i ].text.removeWhiteSpace();
				var sTimePullDown = sTimePullDown.toLowerCase();
				if( sTime == sTimePullDown ) {
					StartTime.selectedIndex = i;
					sTimeSet = true;
				}
			}
			if( eTime && sTimeSet ) {

				eTime = eTime.removeWhiteSpace();
				var EndTime = Form.Coverage_End_Time;
				for( var i = 0; i < EndTime.length; i++ ) {
					var eTimePullDown = EndTime[ i ].text.removeWhiteSpace();
					var eTimePullDown = eTimePullDown.toLowerCase();
					if( eTime == eTimePullDown ) {
						EndTime.selectedIndex = i;
					}
				}
			}
		}

		Form.Location.value = ( loc ) ? loc : Form.Location.defaultValue;
		Form.Number_Guests.value = ( WebData[ arrIndex ][ 25 ] ) ? WebData[ arrIndex ][ 25 ] : Form.Number_Guests.defaultValue;
		Form.Photographer.value = ( Pho[ WebData[ arrIndex ][ 26 ] ] ) ? Pho[ WebData[ arrIndex ][ 26 ] ] : Form.Photographer.defaultValue;
		Form.Minister.value = ( Min[ WebData[ arrIndex ][ 27 ] ] ) ? Min[ WebData[ arrIndex ][ 27 ] ] : Form.Minister.defaultValue;

		Form.Client_Email.value = ( WebData[ arrIndex ][ 9 ] ) ? WebData[ arrIndex ][ 9 ] : Form.Client_Email.defaultValue;

		var firstNames = WebData[ arrIndex ][ 2 ];
		var bFirst = firstNames, gFirst = firstNames;
		var FirstName = firstNames.split( "&" );

		if( FirstName.length == 2 ) {
			gFirst = FirstName[ 0 ].trim();
			bFirst = FirstName[ 1 ].trim();
		}

		Form.Bride_First_Name.value = ( bFirst ) ? bFirst : Form.Bride_First_Name.defaultValue;
		Form.Bride_Last_Name.value = ( WebData[ arrIndex ][ 4 ] ) ? WebData[ arrIndex ][ 4 ] : Form.Bride_Last_Name.defaultValue;
		Form.Groom_First_Name.value = ( gFirst ) ? gFirst : Form.Groom_First_Name.defaultValue;
		Form.Groom_Last_Name.value = ( WebData[ arrIndex ][ 3 ] ) ? WebData[ arrIndex ][ 3 ] : Form.Groom_Last_Name.defaultValue;
		Form.Street_Address.value = ( WebData[ arrIndex ][ 5 ] ) ? WebData[ arrIndex ][ 5 ].replaceLiteral( "<br>", "\n" ) : Form.Street_Address.defaultValue;
		Form.City.value = ( WebData[ arrIndex ][ 6 ] ) ? WebData[ arrIndex ][ 6 ] : Form.City.defaultValue;
		Form.State.value = ( WebData[ arrIndex ][ 7 ] ) ? WebData[ arrIndex ][ 7 ] : Form.State.defaultValue;
		Form.Zip.value = ( WebData[ arrIndex ][ 8 ] ) ? WebData[ arrIndex ][ 8 ] : Form.Zip.defaultValue;
		Form.Home_Tel.value = ( WebData[ arrIndex ][ 10 ] ) ? WebData[ arrIndex ][ 10 ] : Form.Home_Tel.defaultValue;
		Form.Work_Tel.value = ( WebData[ arrIndex ][ 11 ] ) ? WebData[ arrIndex ][ 11 ] : Form.Work_Tel.defaultValue;

		setTimeout( 'self.status = "Client data successfully inserted into booking form..."', 500 );
	}

}
//--------------------------------------------------------------------------------------

// This function returns the booking calendar

function getCalendar( theMonth, theDay, theYear ) {

	var TheDate = getDatesFromQstr();
	if( TheDate ) {
		theMonth = TheDate[ 0 ];
		theDay = TheDate[ 1 ];
		theYear = TheDate[ 2 ];
	}

	var TheDate = new Date( theYear, theMonth - 1, theDay );
	var dayOfWeek = getDayOfWeek( TheDate.getDay() );

	var todayStr = dayOfWeek + "; " + getMonthName( theMonth, true ) + " " + theDay + ", " + theYear;

	var todayStrToMatch = theMonth + "/" + theDay + "/" + theYear;

	var html = "";

	html +=
	"<SPAN ID='theCalendar'>" +
	"<TABLE ALIGN='center' BORDER='0' CELLSPACING='0' CELLPADDING='0'>" +
		"<TR>" +
			"<TD ALIGN='center'>" +
			"<FIELDSET CLASS='calPinLine'>" +
				"<LEGEND ALIGN='center' STYLE='margin:0px 0px 0px 0px;'><SPAN CLASS='calData'>&nbsp;" + todayStr.toUpperCase() + "&nbsp;</SPAN></LEGEND>";
				var sunSet = "";
				for( var i = 0; i < SunsetTime.length; i++ ) {
					if( theMonth == SunsetTime[ i ][ 0 ] && theDay == SunsetTime[ i ][ 1 ] && theYear == SunsetTime[ i ][ 2 ] + 2000 ) {
						var fTime = SunsetTime[ i ][ 3 ].toString();
						if( fTime.indexOf( "." ) >= 0 ) {
							fTime = fTime.replaceLiteral( ".", ":" );
							if( fTime.split( ":" )[ 1 ].length == 1 ) fTime += "0";
						}
						else fTime += ":00";
						sunSet += fTime;
						break;
					}
				}
				var sunSetTopMarg = ( IE ) ? 4 : 0;
				if( sunSet ) html += "<DIV CLASS='fSize8 fgLtBrn' STYLE='margin-top:" + sunSetTopMarg + "px;'>Sun sets at " + sunSet + " PM</DIV>";
				html +=
					"<TABLE ALIGN='center' BORDER='0' CELLSPACING='0' CELLPADDING='10'>" +
						"<TR>" +
							"<TD VALIGN='top'>";

	html += "<TABLE WIDTH='360' ALIGN='center' BORDER=0 CELLSPACING=0 CELLPADDING=0>";

	var nEvents = 0;

	// Loop thru each record set to find matches
	for( var i = 0; i < WebData.length; i++ ) {

		// Found a record with matching dates so extract data
		if( todayStrToMatch == WebData[ i ][ 0 ] ) {


			var arrIndex = i;
			var theStatus = Cal[ WebData[ i ][ 18 ].toString() ];
			var startTime = WebData[ i ][ 19 ];
			var endTime = WebData[ i ][ 20 ];
			var client = WebData[ i ][ 21 ];
			var theLocation = Loc[ WebData[ i ][ 24 ].toString() ];
			var thePackage = Pkg[ WebData[ i ][ 22 ].toString() ];
			var comments = WebData[ i ][ 23 ];

			//Clean up client field where "Wedding" & "Presentation" are in middle of string
			if( client.indexOf( " Wedding " ) >= 0 )
				client = client.replaceLiteral( " Wedding ", " " ) + " Wedding";

			if( client.indexOf( " Presentation " ) >= 0 )
				client = client.replaceLiteral( " Presentation ", " " ) + " Presentation";

			nEvents++;
			var vSpacer = ( nEvents == 1 ) ? 5 : 15;

			html += "<TR><TD COLSPAN='3' HEIGHT=" + vSpacer + "></TD></TR>";

			if( theStatus ) {
				var colorClass = "";

				switch( theStatus.toLowerCase() ) {

					case "booked":
						colorClass = " CLASS='calBooked'";
						break;

					case "tentative":
						colorClass = " CLASS='calTentative'";
						break;

					case "confirmed":
						colorClass = " CLASS='calConfirmed'";
						break;
				}


				html += "<TR><TD ALIGN='right' VALIGN='top' CLASS='calDataTitles'>STATUS: </TD><TD WIDTH='6'></TD><TD CLASS='calData'><SPAN" + colorClass + ">" + theStatus + "</SPAN></TD></TR>";
			}
			if( startTime || endTime )
				html += "<TR><TD ALIGN='right' VALIGN='top' CLASS='calDataTitles'>TIME: </TD><TD WIDTH='6'></TD><TD CLASS='calData'>" + startTime + " - " + endTime + "</TD></TR>";
			if( client )
				html += "<TR><TD ALIGN='right' VALIGN='top' CLASS='calData'><A HREF='javascript:autoInsert( \"" + arrIndex + "\" );' onMouseOver='self.status = dTextCal[ 5 ]; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='" + dTextCal[ 5 ] + "' oncontextmenu='return goToPWH( \"" + WebData[ i ][ 0 ] + "\", \"" + WebData[ i ][ 3 ].replaceLiteral( "'", "&#39;" ) + "\", this, event );'>CLIENT</A>: </TD><TD WIDTH='6'></TD><TD CLASS='calData'>" + client + "</TD></TR>";
			if( theLocation )
				html += "<TR><TD ALIGN='right' VALIGN='top' CLASS='calDataTitles'>LOCATION: </TD><TD WIDTH='6'></TD><TD CLASS='calData'>" + theLocation + "</TD></TR>";
			if( thePackage )
				html += "<TR><TD ALIGN='right' VALIGN='top' CLASS='calDataTitles'>PACKAGE: </TD><TD WIDTH='6'></TD><TD CLASS='calData'>" + thePackage + "</TD></TR>";
			if( comments )
				html += "<TR><TD ALIGN='right' VALIGN='top' CLASS='calDataTitles'>COMMENTS: </TD><TD WIDTH='6'></TD><TD CLASS='calData'>" + comments + "</TD></TR>";


		}
	}

	if( IE && nEvents ) {
		html += "<TR><TD ALIGN='center' VALIGN='middle' CLASS='calData' COLSPAN='3'>" +
		"<DIV STYLE='line-height:15px'> &nbsp;</DIV>" +
		"<A HREF='javascript:void( 0 );' onClick='PF.setView( this, null, false ); PF.printPage( this );' onContextMenu='PF.setView( this, null, false ); return false;' onMouseOver='self.status = this.title; linkOn(this); return true;' onMouseOut='self.status=\"\"; linkOff(this); return true;' TITLE='" + PF.dText[ 2 ] + "' ID='printer_friendly_1' STYLE='font-size:8pt;'>" + PF.dText[ 0 ] + "</A>";

		html += "</TD></TR>";
	}

	if( nEvents == 0 )  {
		var requestedTime = TheDate.getTime();
		var todayTime = new Date( gThisYear, gThisMonth - 1, gThisDay ).getTime();
			var noInfo = ( requestedTime >= todayTime ) ?
				"- No Bookings -" : "PAST DATE: Booking information no longer available";

			html += "<TR><TD ALIGN='center' VALIGN='middle' CLASS='calData'><DIV STYLE='line-height:20px'> &nbsp;</DIV><DIV CLASS='fgGray102'>" + noInfo + "</DIV><DIV STYLE='line-height:20px'> &nbsp;</DIV></TD></TR>";
		}

	html += "</TABLE>" +

							"</TD>" +
						"</TR>" +
					"</TABLE>" +
				"</FIELDSET>" +
			"</TD>" +
		"</TR>" +
	"</TABLE>" +
	"</SPAN>";

	return html;

}
//--------------------------------------------------------------------------------------

function isNavFrameReady() {

	var navFrameReady = false;
	if( eval( "typeof NavFrame" ) == "object" && NavFrame.initialized )
		navFrameReady = true;
	else {
		alert( "We're sorry but our database is currently being updated, please wait a moment & try again." );
		document.NavFrame.location.reload();
	}

	return navFrameReady;

}
//--------------------------------------------------------------------------------------
// Called onLoad of iframe
function showNav() {
	document.getElementById( "navShowToday" ).className = "visShow";
	document.getElementById( "navRightArrow" ).className = "visShow";
}
//--------------------------------------------------------------------------------------

// Called by static HTML browsers only (Macs) upon left or right arrow click

function showNextOrPriorDayStatic( offset ) {

	var DateSelector = document.DateSelector;

	var theMonth = parseInt( DateSelector.month.selectedIndex + 1 );
	var theDay = parseInt( DateSelector.day.selectedIndex + 1 );
	var theYear = parseInt( DateSelector.year[ DateSelector.year.selectedIndex ].text );

	var NewDate = ( theDay + offset ) ?
		new Date( theYear, theMonth - 1, theDay + offset ) :
		new Date( theYear, theMonth - 2, getNumDaysInMonth( theMonth - 1, theYear ) );

	if( NewDate.getFullYear() - gThisYear < nYearsInPulldown && NewDate.getFullYear() - gThisYear >= 0 ) {
		DateSelector.month.selectedIndex = NewDate.getMonth();
		DateSelector.day.selectedIndex = NewDate.getDate() - 1;
		DateSelector.year.selectedIndex = NewDate.getFullYear() - gThisYear;
		showNewDay();
	}
	else
		alert( "You have reached beginning or end of possible dates, please select another date & try again." );


}

//--------------------------------------------------------------------------------------

// Called by static HTML browsers when clicks "GO"

function showNewDay() {

	var DateSelector = document.DateSelector;

	var theMonth = parseInt( DateSelector.month.selectedIndex + 1 );
	var theDay = parseInt( DateSelector.day.selectedIndex + 1 );
	var theYear = parseInt( DateSelector.year[ DateSelector.year.selectedIndex ].text );

	var nDaysInMon = getNumDaysInMonth( theMonth, theYear );
	if( theDay > nDaysInMon ) {
		alert( getMonthName( theMonth, true ) + " has only " + nDaysInMon + " days, select a valid date & try again..." );
		TheDate = null;
	}
	else
		document.location.href = "calendar.html?date=" + escape( theMonth + "-" + theDay + "-" + theYear );

}

//--------------------------------------------------------------------------------------

CalHelp = [ "BOOKING CALENDAR", "" +

"<div class='fgBlack bold' style='margin:0px 0px 0px 0px;'>About</div>" +
	"<div style='margin:0px 0px 0px 10px;'>Our Booking Calendar is automated and database driven. It provides current booking information for our weddings and events. It is updated multiple times each day. You may click dates in the calendar to view booking information for that day.</div>" +

"<div class='fgBlack bold' style='margin:6px 0px 0px 0px;'>Using Our Booking Form</div>" +
	"<div style='margin:2px 0px 0px 6px;'>Just below our Booking Calendar, you will find our Booking Form. You may fill out and submit this booking form if you would like to:</div>" +
		"<div style='margin:0px 0px 0px 10px;'>" +
			"<OL STYLE='margin-top:0px; margin-bottom:0px;'>" +

				"<LI>Request a New Booking" +
				"<LI>Request a New Tentative Booking" +
				"<LI>Confirm an Existing Booking" +
				"<LI>Cancel an Existing Booking" +
			"</OL>" +
		"</div>" +

	"<div class='fSize10' style='margin:4px 0px 0px 6px;'>" +
		"TIP: For your convenience, you may \"auto-insert\" client data from the calendar display directly into the booking form. Doing so prevents you from having to re-type it. You will find this useful if you would like to confirm or cancel an existing booking. To \"auto-insert\" you client's data, simply click the \"Client\" link to the left of the client's name in the calendar data display." +
	"</div>" +

	"<div class='fSize10' style='margin:4px 0px 0px 6px;'>" +
		"Please Note: We would appreciate your sending us one request per client. For example, say you have two clients and you want to request a booking for each of them. In this case, you would fill out the form for client #1 and submit it, then fill out the form for client #2 and submit it." +
	"</div>" +

"<div class='fgBlack bold' style='margin:6px 0px 0px 0px;'>This Is A Date Sensitive Application</div>" +
	"<div style='margin:0px 0px 0px 10px;'>Upon loading, our calendar sets the display to today's date. It does so by reading the current date from the clock built into your operating system. If the calendar shows an incorrect date for today's date you will need to reset your computer's clock. On windows computers this is typically done by double-clicking the clock in the lower right hand corner of your screen or going to the date and time settings within your control pannels.</div>" +

"<div class='fgBlack bold' style='margin:6px 0px 0px 0px;'>Problems & Errors</div>" +
	"<div style='margin:0px 0px 0px 10px;'>Should you experience any technical problems with this page, please take a moment to  <a HREF='javascript:reportErr( \"Web Site Problem\", \"PLEASE DESCRIBE THE PROBLEM YOU EXPERIENCED: \", 2 )' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;'  TITLE='Report technical problems to the WebMaster'><nobr>Report a Problem</nobr></a>. Doing so will greatly assist us in resolving technical issues and improving our system to better serve you.</div>" +

"" ];

//--------------------------------------------------------------------------------------

function writeCalGUI( theMonth, theDay, theYear ) {

	var html =


		"<DIV STYLE='line-height:2px;'>&nbsp; </DIV>" +

		"<DIV ALIGN='center' CLASS='fSize7 fgGray151'>" +
			"Database updated " + lastUpdated + "&nbsp;&nbsp;&#149;&nbsp;&nbsp;<A Class='help' HREF='javascript:void(0);' onMouseOver='self.status = dTextCal[ 4 ]; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='" + dTextCal[ 4 ] + "' onClick='if( window.DW ) DW.createWindow( CalHelp, this, event, [1,-250,10 ], [1,450,250], 6 ); return false;'>Help</A>" +
		"</DIV>" +

		"<DIV CLASS='fSize9' ALIGN='center'>" + DB.Contact.TelDirect + "&nbsp;&nbsp;•&nbsp;&nbsp;" + DB.Contact.TelTollFree + "</DIV>" +

		"<DIV STYLE='line-height:2px;'>&nbsp; </DIV>";

		var visClass = ( dCalHTML ) ? "visHide" : "visShow";
		if( true ) html +=

			"<DIV ID='PRN_TOP2'>" +
			"<TABLE ALIGN='center'>" +
				"<TR>" +
					"<TD valign='middle' ID='navigator' CLASS='on' NOWRAP>" +
						"<SPAN CLASS='" + visClass + "' ID='navLeftArrow'>&nbsp;<A HREF='javascript:if( dCalHTML ) { if ( isNavFrameReady() ) { NavFrame.showNextOrPriorDay( -1 ); } } else { showNextOrPriorDayStatic( -1 ); }' onMouseOver='document.LeftArrow.src=\"images/arrowL_on.gif\"; self.status = this.title; return true;' onMouseOut='document.LeftArrow.src=\"images/arrowL_off.gif\"; self.status=\"\"; return true;' TITLE='" + dTextCal[ 1 ] + "' ID='navLeftArrowLink' STYLE='text-decoration:none;'>&nbsp;<IMG SRC='images/arrowL_off.gif' NAME='LeftArrow' BORDER='0' ALIGN='' WIDTH='15' HEIGHT='18' HSPACE='0' VSPACE='0'>&nbsp;</A>&nbsp;</SPAN>" +

						"<SPAN CLASS='" + visClass + "' ID='navShowToday'><A class='today' HREF='javascript:if( dCalHTML ) { if ( isNavFrameReady() ) { NavFrame.showToday(); } } else { document.location.href = \"calendar.html\"; }' onMouseOver='self.status = this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='" + dTextCal[ 2 ] + ": " + gThisMonth +"/" + gThisDay + "/" + gThisYear + "'>TODAY</A></SPAN>" +

						"<SPAN CLASS='" + visClass + "' ID='navRightArrow'>&nbsp;<A HREF='javascript:if( dCalHTML ) { if ( isNavFrameReady() ) { NavFrame.showNextOrPriorDay( 1 ); } } else { showNextOrPriorDayStatic( 1 ); }' onMouseOver='document.RightArrow.src=\"images/arrowR_on.gif\"; self.status = this.title; return true;' onMouseOut='document.RightArrow.src=\"images/arrowR_off.gif\"; self.status=dTextCal[ 0 ]; return true;' TITLE='" + dTextCal[ 3 ] + "' ID='navRightArrowLink' STYLE='text-decoration:none;'>&nbsp;<IMG SRC='images/arrowR_off.gif' NAME='RightArrow' BORDER='0' ALIGN='' WIDTH='15' HEIGHT='18' HSPACE='0' VSPACE='0'>&nbsp;</A>&nbsp;</SPAN>" +
					"</TD>" +
				"</TR>" +
			"</TABLE>" +
			"</DIV>" +

			"<DIV STYLE='line-height:10px;'>&nbsp; </DIV>";

		else if( false )
			html += "<A HREF='calendar.html' onMouseOver='self.status=\"" + dTextCal[ 2 ] + ": " + gThisMonth +"/" + gThisDay + "/" + gThisYear + "\"; return true;' onMouseOut='self.status=\"\"; return true;'>Go to Today</A>";


	html +=





	"<TABLE width='658' align='left' border='0' cellspacing='0' cellpadding='0'>" +

		"<TR>" +
			"<TD width='1'></TD>" +
			"<TD ALIGN='center' VALIGN='top' NOWRAP>";
				if( sCalHTML ) {

					html +=
					"<SPAN ID='PRN_PULLDOWN'>" +
						"<FORM Name='DateSelector' STYLE='margin-top:10px; margin-bottom:10px;'>" +
							"<SELECT NAME='month' CLASS='calPullDown'>";
								for( var i = 1; i < 13; i++ ) html += "<OPTION>" + getMonthName( i, true );
							html +=
							"</SELECT>&nbsp;&nbsp;" +
							"<SELECT NAME='day' CLASS='calPullDown'>";
								for( var i = 1; i < 32; i++ ) html += "<OPTION>" + i;
							html +=
							"</SELECT>&nbsp;&nbsp;" +
							"<SELECT NAME='year' CLASS='calPullDown'>";
								for( var i = 0; i < nYearsInPulldown; i++ ) html += "<OPTION>" + ( gThisYear + i );
							html +=
							"</SELECT>&nbsp;&nbsp;" +
							"<INPUT TYPE='button' VALUE='GO' CLASS='calButton' onClick='showNewDay();'>" +
						"</FORM>" +
					"</SPAN>";
				}
				html +=
				"<DIV>" +
					getCalendar( theMonth, theDay, theYear ) +
				"</DIV>" +
			"</TD>" +
			"<TD WIDTH=3 NOWRAP>" +
				"&nbsp; " +
			"</TD>" +

// BRAD: Double check this area, I see you introuduced some new table tags it appears???
			"<TD VALIGN='top' align='right'><TABLE align='right' border='0'><TR><TD height='1px'></TD></TR><TR><TD height='5px' align='right'>";

			if( dCalHTML ) html +=
				"<SPAN ID='PRN_IFRAME'>" +
					"<IFRAME NAME='NavFrame' SRC='hvm-calendar-nav.html' WIDTH='300' HEIGHT='390' FRAMEBORDER='0' SCROLLING='auto' marginheight='0' marginwidth='0' ALIGN='right'><BR> &nbsp;</IFRAME>" +

				"</SPAN>";

			html +=
			"</TD>" +
		"</TR></TABLE>" +


	"</TD></TR></TABLE>";

	document.write( html );
}

//--------------------------------------------------------------------------------------

function setCalPullDown() { // Called onLoad

	if( sCalHTML ) {
		if( eval( "typeof document.DateSelector" ) == "object" ) {

			var DateSelector = document.DateSelector;

			var TheDate = getDatesFromQstr();

			DateSelector.month.selectedIndex = ( TheDate ) ? TheDate[ 0 ] - 1 : gThisMonth - 1;
			DateSelector.day.selectedIndex = ( TheDate ) ? TheDate[ 1 ] - 1 : gThisDay - 1;
			DateSelector.year.selectedIndex = ( TheDate ) ? TheDate[ 2 ] - gThisYear : 0;

			if( TheDate )
				setEventDate( TheDate[ 0 ], TheDate[ 1 ], TheDate[ 2 ] )

		}
	}

}
////////////////////////////////// FORM FUNCTIONS //////////////////////////////////

setAccess( "full" );

//--------------------------------------------------------------------------------------

function autoFillForm() {

	if( hvmCook != null ) {

		var Coordinator_Name = hvmCook.getVal( "Coordinator_Name" );
		if( Coordinator_Name ) document.form.Coordinator_Name.value = Coordinator_Name;

		var Coordinator_Company = hvmCook.getVal( "Coordinator_Company" );
		if( Coordinator_Company ) document.form.Coordinator_Company.value = Coordinator_Company;

		var emailVal = hvmCook.getVal( "email" );
		if( emailVal ) document.form.email.value = emailVal;

	}

}

//--------------------------------------------------------------------------------------

function unMarkAllFields() {

	var Form = document.form;

	markField( Form.Coordinator_Name, false );
	markField( Form.Coordinator_Company, false );
	markField( Form.email, false );
	markField( Form.Wedding_Month, false );
	markField( Form.Wedding_Day, false );
	markField( Form.Wedding_Year, false );
	markField( Form.Booking_Type[ 0 ], false );
	markField( Form.Video_Package, false );
	markField( Form.Coverage_Start_Time, false );
	markField( Form.Location, false );
	markField( Form.Number_Guests, false );
	markField( Form.Photographer, false );
	markField( Form.Minister, false );
	markField( Form.Client_Email, false );
	markField( Form.Bride_First_Name, false );
	markField( Form.Bride_Last_Name, false );
	markField( Form.Groom_First_Name, false );
	markField( Form.Groom_Last_Name, false );
	markField( Form.Street_Address, false );
	markField( Form.City, false );
	markField( Form.State, false );
	markField( Form.Zip, false );
	markField( Form.Home_Tel, false );
	markField( Form.Work_Tel, false );

}

//--------------------------------------------------------------------------------------

function showModifiedData( Form ) {

	Form.Modified_Data.value = "";
	var txt = "";
	var c = " ==> ";
	var id = -1;
	var evtMnFM = Form.Wedding_Month[ Form.Wedding_Month.selectedIndex ].value;
	var evtDyFM = Form.Wedding_Day[ Form.Wedding_Day.selectedIndex ].value;
	var evtYyFM = Form.Wedding_Year[ Form.Wedding_Year.selectedIndex ].value;
	var todayStrToMatch = evtMnFM + "/" + evtDyFM + "/" + evtYyFM;

	if( gArrIndex >= 0 ) { // user auto-inserted
		id = gArrIndex;
		txt = Form.Coordinator_Name.value + " Auto-Inserted Data for: " + WebData[ id ][ 21 ] + "\n";
	}
	else { // User did not auto-insert

		// Loop thru each record set to find match
		for( var i = 0; i < WebData.length; i++ ) {
			if( todayStrToMatch == WebData[ i ][ 0 ] && Form.Groom_Last_Name.value == WebData[ i ][ 3 ] ) {
				id = i;
				txt = Form.Coordinator_Name.value + " Failed to Auto-Insert Data for: " + WebData[ id ][ 21 ] + "; matched on Groom-Last-Name & Event-Date instead...\n";
				break;
			}
		}
	}

	if( id >= 0 ) {

		var dFM, dDB;

		txt += "\nMODIFIED EVENT INFORMATION; If any";

		var EvtDateDB = WebData[ id ][ 0 ].split( "/" );
		if( EvtDateDB.length == 3 ) {
			txt += ( evtMnFM == EvtDateDB[ 0 ] ) ? "\n  Month:        N/C" : "\n  Month:        " + EvtDateDB[ 0 ] + c + evtMnFM;
			txt += ( evtDyFM == EvtDateDB[ 1 ] ) ? "\n  Day:          N/C" : "\n  Day:          " + EvtDateDB[ 1 ] + c +  evtDyFM;
			txt += ( evtYyFM == EvtDateDB[ 2 ] ) ? "\n  Year:         N/C" : "\n  Year:         " + EvtDateDB[ 2 ] + c +  evtYyFM;
		}
		try{
			dFM = Form.Video_Package[ Form.Video_Package.selectedIndex ].value.split( ":" )[ 0 ];
			dDB = Pkg[ WebData[ id ][ 22 ].toString() ];
			txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Package:      N/C" : "\n  Package:      " + dDB + c + dFM;
		}
		catch( e ) {}

		dFM = Form.Coverage_Start_Time[ Form.Coverage_Start_Time.selectedIndex ].text;
		dDB = WebData[ id ][ 19 ];
		dFM1 = dFM.replaceLiteral( " ", "" ).toLowerCase();
		dDB1 = dDB.replaceLiteral( " ", "" ).toLowerCase();
		txt += ( dFM1 == dDB1 ) ? "\n  Start Time:   N/C" : "\n  Start Time:   " + dDB + c + dFM;

		dFM = Form.Coverage_End_Time[ Form.Coverage_End_Time.selectedIndex  ].text;
		dDB = WebData[ id ][ 20 ];
		dFM1 = dFM.replaceLiteral( " ", "" ).toLowerCase();
		dDB1 = dDB.replaceLiteral( " ", "" ).toLowerCase();
		txt += ( dFM1 == dDB1 ) ? "\n  End Time:     N/C" : "\n  End Time:     " + dDB + c + dFM;

		dFM = Form.Location.value.trim();
		dDB = Loc[ WebData[ id ][ 24 ].toString() ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Location:     N/C" : "\n  Location:     " + dDB + c + dFM;

		dFM = parseInt( Form.Number_Guests.value.trim() );
		dDB = WebData[ id ][ 25 ];
		txt += ( dFM == dDB ) ? "\n  Num Guests:   N/C" : "\n  Num Guests:   " + dDB + c + dFM;

		dFM = Form.Photographer.value.trim();
		dDB = Pho[ WebData[ id ][ 26 ].toString() ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Photographer: N/C" : "\n  Photographer: " + dDB + c + dFM;

		dFM = Form.Minister.value.trim();
		dDB = Min[ WebData[ id ][ 27 ].toString() ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Minister:     N/C" : "\n  Minister:     " + dDB + c + dFM;

		txt += "\n\nMODIFIED CLIENT INFORMATION; If any";

		dFM = Form.Client_Email.value.trim();
		dDB = WebData[ id ][ 9 ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  E-Mail:       N/C" : "\n  E-Mail:       " + dDB + c + dFM;

		if( WebData[ id ][ 2 ].indexOf( "&" ) >= 0 ) {
			var bFM = Form.Bride_First_Name.value.trim();
			var gFM = Form.Groom_First_Name.value.trim();
			FnDB = WebData[ id ][ 2 ].split( "&" );
			var bDB = FnDB[ 1 ].trim();
			var gDB = FnDB[ 0 ].trim();
			txt += ( bFM.toLowerCase() == bDB.toLowerCase() ) ? "\n  Br First:     N/C" : "\n  Br First:     " + bDB + c + bFM;
			txt += ( gFM.toLowerCase() == gDB.toLowerCase() ) ? "\n  Gr First:     N/C" : "\n  Gr First:     " + gDB + c + gFM;
		}

		dFM = Form.Bride_Last_Name.value.trim();
		dDB = WebData[ id ][ 4 ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Br Last:      N/C" : "\n  Br Last:      " + dDB + c + dFM;

		dFM = Form.Groom_Last_Name.value.trim();
		dDB = WebData[ id ][ 3 ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Gr Last:      N/C" : "\n  Gr Last:      " + dDB + c + dFM;

		dFM = Form.Street_Address.value.trim();
		dFM = dFM.replaceLiteral( "\r\n", "" );
		dFM = dFM.replaceLiteral( "\r", "" );
		dFM = dFM.replaceLiteral( "\n", "" );
		dFM = dFM.removeWhiteSpace();

		dDB = WebData[ id ][ 5 ].trim();
		dDB = dDB.replaceLiteral( "<br>", "" );
		dDB = dDB.removeWhiteSpace();

		var dDB1 = WebData[ id ][ 5 ].trim();
		dDB1 = dDB1.trim( "<br>" );
		dDB1 = dDB1.replaceLiteral( "<br>", "\n" );

		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Address:      N/C" : "\n  Address:      " + dDB1 + c + Form.Street_Address.value;

		dFM = Form.City.value.trim();
		dDB = WebData[ id ][ 6 ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  City:         N/C" : "\n  City:         " + dDB + c + dFM;

		dFM = Form.State.value.trim();
		dDB = WebData[ id ][ 7 ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  State:        N/C" : "\n  State:        " + dDB + c + dFM;

		dFM = Form.Zip.value.trim();
		dDB = WebData[ id ][ 8 ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Zip:          N/C" : "\n  Zip:          " + dDB + c + dFM;

		dFM = Form.Home_Tel.value.trim();
		dDB = WebData[ id ][ 10 ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Primary Tel:  N/C" : "\n  Primary Tel:  " + dDB + c + dFM;

		dFM = Form.Work_Tel.value.trim();
		dDB = WebData[ id ][ 11 ];
		txt += ( dFM.toLowerCase() == dDB.toLowerCase() ) ? "\n  Alt Tel:      N/C" : "\n  Alt Tel:      " + dDB + c + dFM;

	}

	Form.Modified_Data.value = ( id >= 0 ) ? txt : "Our appologies but we are unable to find a matching record in our database based upon the Coordinator Form input: Groom Last Name & Wedding Date.";

}

//--------------------------------------------------------------------------------------

function writeCsvFormattedData( Form ) {

	// Write CSV Client Data
	Form.Client_Data.value =

		"!^!\"Client\"," +

		"\"" + Form.Groom_Last_Name.value.formatCsvData() + ", " + Form.Groom_First_Name.value.formatCsvData() + " & " + Form.Bride_First_Name.value.formatCsvData() + "\"," +

		"\"" + Form.Groom_First_Name.value.formatCsvData() + " & " + Form.Bride_First_Name.value.formatCsvData() + "\"," +

		"\"" + Form.Groom_Last_Name.value.formatCsvData() +  "\"," +

		"\"" + Form.Bride_Last_Name.value.formatCsvData() +  "\"," +

		"\"" + Form.Street_Address.value.formatCsvData() +  "\"," +

		"\"" + Form.City.value.formatCsvData() +  "\"," +

		"\"" + Form.State.value.formatCsvData() +  "\"," +

		"\"" + Form.Zip.value.formatCsvData() +  "\"," +

		"\"" + Form.Client_Email.value.formatCsvData() +  "\"," +

		"\"" + Form.Home_Tel.value.formatCsvData() +  "\"," +

		"\"" + Form.Work_Tel.value.formatCsvData() +  "\"," +

		"\"" + Form.Groom_Last_Name.value.formatCsvData() + "," + Form.Groom_First_Name.value.formatCsvData() + " & " + Form.Bride_First_Name.value.formatCsvData() + "\"," +

		"\"" + Form.Groom_Last_Name.value.formatCsvData() + ";" + Form.Groom_First_Name.value.formatCsvData() + " & " + Form.Bride_First_Name.value.formatCsvData() + "\"!^!";

	var bookingType = ( Form.Booking_Type[ 0 ].checked ) ? "Booked" : "Tentative";

	var pkgVal = Form.Video_Package[ Form.Video_Package.selectedIndex ].text;

	var commencePkgName = "Custom";
	if( pkgVal.indexOf( ":" ) >= 0 )
		commencePkgName = pkgVal.split( ":" )[ 0 ];
	else if( pkgVal == "To Be Determined" )
		commencePkgName = "TBD";


	// Write CSV Event Data
	Form.Event_Data.value =

		"!^!\"Event\"," +

		"\"" + Form.Groom_Last_Name.value.formatCsvData() + ", " + Form.Groom_First_Name.value.formatCsvData() + " & " + Form.Bride_First_Name.value.formatCsvData() + "\"," +

		"\"" + Form.Wedding_Month[ Form.Wedding_Month.selectedIndex ].value + "/" + Form.Wedding_Day[ Form.Wedding_Day.selectedIndex ].value + "/" + Form.Wedding_Year[ Form.Wedding_Year.selectedIndex ].value + "\"," +

		"\"" + bookingType + "\"," +

		"\"" + Form.Coverage_Start_Time[ Form.Coverage_Start_Time.selectedIndex ].value + "\"," +

		"\"" + Form.Coverage_End_Time[ Form.Coverage_End_Time.selectedIndex  ].value + "\"," +

		"\"" + Form.Groom_Last_Name.value.formatCsvData() + " Wedding;" + Form.Groom_First_Name.value.formatCsvData() + " & " + Form.Bride_First_Name.value.formatCsvData() + "\"," +

		"\"" + commencePkgName + "\"!^!";

//prompt( "Client_Data:", Form.Client_Data.value );
//prompt( "Event_Data:", Form.Event_Data.value );
}

//---------------------------------------------------------------------------------------

function checkForm( Form ) {

	if( cb ) {

		Form.recipient.value = DB.Contact.Email;

		if( window.event && event.ctrlKey && event.altKey ) {
			if( confirm( "ADMIN: Delete \"hvmCook\"?" ) ) {
				Form.reset();
				DeleteCookie( "hvmCook", "/" );
				document.location.reload();
			}
			return false;
		}

		unMarkAllFields();
		var access = getAccessLevel();

		setButton( Form.submit_button, "disable", "Submit" );

		var missingInfo = "";
		var lineNumber = 0;
		var missingObj = null;

		var wedYearIndex = Form.Wedding_Year.selectedIndex;
		var wedMonthIndex = Form.Wedding_Month.selectedIndex;
		var wedDayIndex = Form.Wedding_Day.selectedIndex;

		var Coordinator_Name = Form.Coordinator_Name;
		if( Coordinator_Name.value == Coordinator_Name.defaultValue ) {
			lineNumber++;
			missingInfo += "\n   " + lineNumber + ". Coordinator/Booking Agent Name";
			if( missingObj == null ) missingObj = Coordinator_Name;
			markField( Coordinator_Name, true );
		}

		var davidTesting = ( Coordinator_Name.value.indexOf( "^_^" ) >= 0 );
		if( davidTesting ) {
			alert( "TEST MODE ^_^: Recipient is " + DB.Contact.WebMaster + "; otherwise, it goes to " + Form.recipient.value + " unless it is New or Tentative, in which case it goes to " + DB.Contact.EmailCommence );
			Form.recipient.value = DB.Contact.WebMaster;
		}

		var Coordinator_Company = Form.Coordinator_Company;
		if( Coordinator_Company.value == Coordinator_Company.defaultValue ) {
			lineNumber++;
			missingInfo += "\n   " + lineNumber + ". Coordinator/Booking Agent Company Name";
			if( missingObj == null ) missingObj = Coordinator_Company;
			markField( Coordinator_Company, true );
		}

		var emailObj = Form.email;
		if( emailObj.value == emailObj.defaultValue ) {
			lineNumber++;
			missingInfo += "\n   " + lineNumber + ". Coordinator/Booking Agent Email Address";
			if( missingObj == null ) missingObj = emailObj;
			markField( emailObj, true );
		}

		var Booking_Type_Unchecked = true;
		var newOrTentative = false;
		var confirmation = false;
		var otherInquiry = false;
		var Booking_Type = Form.Booking_Type;
		for( var i = 0; i < Booking_Type.length; i++ ) {
			if( Booking_Type[ i ].checked ) {
				Booking_Type_Unchecked = false;
				Form.subject.value = "Hawaii Video Memories; " + Booking_Type[ i ].value;
				if( i < 2 ) newOrTentative = true;
				if( i == 2 ) confirmation = true;
				if( i == 4 ) otherInquiry = true;
				break;
			}
		}

		if( Booking_Type_Unchecked ) {
			lineNumber++;
			missingInfo += "\n   " + lineNumber + ". Booking Request Type";
			if( missingObj == null ) missingObj = Booking_Type[ 0 ];
			markField( Booking_Type[ 0 ], true );
		}

		if( newOrTentative ) {
			if( !davidTesting ) Form.recipient.value = DB.Contact.EmailCommence;
			var wedDayIndex = document.form.Wedding_Day.selectedIndex;
			var wedMonthIndex = document.form.Wedding_Month.selectedIndex;
			var wedYearIndex = document.form.Wedding_Year.selectedIndex;

			eventIsToday = ( wedDayIndex == gThisDay - 1 && wedMonthIndex == gThisMonth - 1 && wedYearIndex == 0 );

			if( eventIsToday ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Event Date";
				if( missingObj == null ) missingObj = document.form.Wedding_Month;
				markField( document.form.Wedding_Month, true );
				markField( document.form.Wedding_Day, true );
				markField( document.form.Wedding_Year, true );
			}
		}

		if( !otherInquiry ) {

			if( newOrTentative || confirmation ) {

				var Video_PackageObj = Form.Video_Package; // Pull Down
				var videoPkgIndex = Video_PackageObj.selectedIndex;
				if( Video_PackageObj.selectedIndex == 0 ) {
					lineNumber++;
					missingInfo += "\n   " + lineNumber + ". Video package";
					if( missingObj == null ) missingObj = Video_PackageObj;
					markField( Video_PackageObj, true );
				}

				var Ceremony_TimeObj = Form.Coverage_Start_Time; // Pull Down
				var ceremonyTimeIndex = Ceremony_TimeObj.selectedIndex;
				if( Ceremony_TimeObj[ Ceremony_TimeObj.selectedIndex ].defaultSelected ) {
					lineNumber++;
					missingInfo += "\n   " + lineNumber + ". Coverage Start Time";
					if( missingObj == null ) missingObj = Ceremony_TimeObj;
					markField( Ceremony_TimeObj, true );
				}
			}

			var Location = Form.Location;
			if( Location.value == Location.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Location";
				if( missingObj == null ) missingObj = Location;
				markField( Location, true );
			}
		}

		if( newOrTentative || confirmation ) {

			var Client_Email = Form.Client_Email;
			if( Client_Email.value == Client_Email.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Client E-mail Address";
				if( missingObj == null ) missingObj = Client_Email;
			markField( Client_Email, true );
			}

			var Bride_First_Name = Form.Bride_First_Name;
			if( Bride_First_Name.value == Bride_First_Name.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Bride's First Name";
				if( missingObj == null ) missingObj = Bride_First_Name;
				markField( Bride_First_Name, true );
			}

			var Bride_Last_Name = Form.Bride_Last_Name;
			if( Bride_Last_Name.value == Bride_Last_Name.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Bride's Last Name";
				if( missingObj == null ) missingObj = Bride_Last_Name;
				markField( Bride_Last_Name, true );
			}

			var Groom_First_Name = Form.Groom_First_Name;
			if( Groom_First_Name.value == Groom_First_Name.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Groom's First Name";
				if( missingObj == null ) missingObj = Groom_First_Name;
				markField( Groom_First_Name, true );
			}

			var Groom_Last_Name = Form.Groom_Last_Name;
			if( Groom_Last_Name.value == Groom_Last_Name.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Groom's Last Name";
				if( missingObj == null ) missingObj = Groom_Last_Name;
				markField( Groom_Last_Name, true );
			}

			var Street_Address = Form.Street_Address;
			if( Street_Address.value == Street_Address.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Client's Address";
				if( missingObj == null ) missingObj = Street_Address;
				markField( Street_Address, true );
			}
			else {
				var trimVal = Form.Street_Address.value.trim();
				trimVal = trimVal.trim( "\r\n" );
				trimVal = trimVal.trim( "\r" );
				trimVal = trimVal.trim( "\n" );
				Form.Street_Address.value = trimVal;
			}

			var City = Form.City;
			if( City.value == City.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Client's City";
				if( missingObj == null ) missingObj = City;
				markField( City, true );
			}

			var State = Form.State;
			if( State.value == State.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Client's State";
				if( missingObj == null ) missingObj = State;
				markField( State, true );
			}

			var Zip = Form.Zip;
			if( Zip.value == Zip.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Client's Zip/Postal Code";
				if( missingObj == null ) missingObj = Zip;
				markField( Zip, true );
			}

			var Home_TelObj = Form.Home_Tel;
			var Work_TelObj = Form.Work_Tel;
			if(Home_TelObj.value == Home_TelObj.defaultValue  && Work_TelObj.value == Work_TelObj.defaultValue) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". One phone Number (home or work)";
				if( missingObj == null ) missingObj = Home_TelObj;
				markField( Home_TelObj, true );
				markField( Work_TelObj, true );
			}

		}

		if( confirmation ) {

			var Number_Guests = Form.Number_Guests;
			if( Number_Guests.value == Number_Guests.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Number of Guests";
				if( missingObj == null ) missingObj = Number_Guests;
				markField( Number_Guests, true );
			}

			var Photographer = Form.Photographer;
			if( Photographer.value == Photographer.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Photographer";
				if( missingObj == null ) missingObj = Photographer;
				markField( Photographer, true );
			}

			var Minister = Form.Minister;
			if( Minister.value == Minister.defaultValue ) {
				lineNumber++;
				missingInfo += "\n   " + lineNumber + ". Minister";
				if( missingObj == null ) missingObj = Minister;
				markField( Minister, true );
			}

		}

		// Missing Fields, Stop submission
		if( missingInfo != "" && Coordinator_Name.value != "^_^" ) {
			alert("Please provide the following:\n"+missingInfo+"\n\nand try again.");
			missingObj.focus();
			setButton( Form.submit_button, "enable", "Submit" );
			return false;
		}

		// Form passed inspection, so send it...
		else {

			if( !verifyEmail( Form.submit_button, Form.email, "Submit Request" ) ) return false;

			var coordFirstName = getFirstName( Coordinator_Name.value );
			var successPage = ( coordFirstName ) ? "../associates.html?name=" + coordFirstName : "calendar.html?name=";

			Form.redirect.value = successPage;

			recordData( "Coordinator_Name", Coordinator_Name.value );
			recordData( "Coordinator_Company", Coordinator_Company.value );
			recordData( "email", emailObj.value );

			// Change text fields having a default value to empty string so they are not e-mailed
			// IMPORTANT: DO NOT TOUCH HIDDEN CONTROL FIELDS: "recipient", etc
			var nFields = Form.elements.length;
			var changeField = false;
			for( var i = 0; i < nFields; i++ ) {
				var fieldObj = Form.elements[ i ];

				if( fieldObj.name == "Hidden_Marker" ) changeField = true;

				if( changeField ) {
					if( ( fieldObj.type == "text" || fieldObj.type == "textarea" ) && fieldObj.value == fieldObj.defaultValue ) {
						fieldObj.value = "";
					}
				}

			}

			if( confirmation ) showModifiedData( Form );

			// Replace values with visible text so visible text gets e-mailed
			var startTime = Form.Coverage_Start_Time[ Form.Coverage_Start_Time.selectedIndex ].text;
			var startTimeSelected = ( !isNaN( startTime.charAt( 0 ) ) );
			Form.Coverage_Start_Time[ Form.Coverage_Start_Time.selectedIndex ].value = ( startTimeSelected ) ? startTime : "TBD";

			var endTime = Form.Coverage_End_Time[ Form.Coverage_End_Time.selectedIndex ].text;
			var endTimeSelected = ( !isNaN( endTime.charAt( 0 ) ) );
			Form.Coverage_End_Time[ Form.Coverage_End_Time.selectedIndex ].value = ( endTimeSelected ) ? endTime : "TBD";

			if( newOrTentative ) writeCsvFormattedData( Form );

			if( 0 ) { // Set to true to load homepage w/o generating e-mail
				alert( "Running in Test Mode: No e-mail will be generated" );
				document.location.href = successPage;
				return false;
			}

			return true;
		}
	}
	// not current browser;
	return true;

}

//--------------------------------------------------------------------------------------
SunsetTime = [[9,1,8,6.41],[9,2,8,6.40],[9,3,8,6.39],[9,4,8,6.38],[9,5,8,6.38],[9,6,8,6.37],[9,7,8,6.36],[9,8,8,6.35],[9,9,8,6.34],[9,10,8,6.33],[9,11,8,6.32],[9,12,8,6.31],[9,13,8,6.30],[9,14,8,6.29],[9,15,8,6.28],[9,16,8,6.27],[9,17,8,6.26],[9,18,8,6.25],[9,19,8,6.24],[9,20,8,6.23],[9,21,8,6.23],[9,22,8,6.22],[9,23,8,6.21],[9,24,8,6.20],[9,25,8,6.19],[9,26,8,6.18],[9,27,8,6.17],[9,28,8,6.16],[9,29,8,6.15],[9,30,8,6.14],[10,1,8,6.13],[10,2,8,6.12],[10,3,8,6.11],[10,4,8,6.11],[10,5,8,6.10],[10,6,8,6.09],[10,7,8,6.08],[10,8,8,6.07],[10,9,8,6.06],[10,10,8,6.05],[10,11,8,6.05],[10,12,8,6.04],[10,13,8,6.03],[10,14,8,6.02],[10,15,8,6.01],[10,16,8,6.01],[10,17,8,6.00],[10,18,8,5.59],[10,19,8,5.58],[10,20,8,5.58],[10,21,8,5.57],[10,22,8,5.56],[10,23,8,5.55],[10,24,8,5.55],[10,25,8,5.54],[10,26,8,5.53],[10,27,8,5.53],[10,28,8,5.52],[10,29,8,5.52],[10,30,8,5.51],[10,31,8,5.51],[11,1,8,5.50],[11,2,8,5.50],[11,3,8,5.49],[11,4,8,5.49],[11,5,8,5.48],[11,6,8,5.48],[11,7,8,5.47],[11,8,8,5.47],[11,9,8,5.47],[11,10,8,5.46],[11,11,8,5.46],[11,12,8,5.46],[11,13,8,5.45],[11,14,8,5.45],[11,15,8,5.45],[11,16,8,5.44],[11,17,8,5.44],[11,18,8,5.44],[11,19,8,5.44],[11,20,8,5.44],[11,21,8,5.44],[11,22,8,5.44],[11,23,8,5.44],[11,24,8,5.44],[11,25,8,5.43],[11,26,8,5.43],[11,27,8,5.44],[11,28,8,5.44],[11,29,8,5.44],[11,30,8,5.44],[12,1,8,5.44],[12,2,8,5.44],[12,3,8,5.44],[12,4,8,5.44],[12,5,8,5.45],[12,6,8,5.45],[12,7,8,5.45],[12,8,8,5.45],[12,9,8,5.46],[12,10,8,5.46],[12,11,8,5.46],[12,12,8,5.47],[12,13,8,5.47],[12,14,8,5.47],[12,15,8,5.48],[12,16,8,5.48],[12,17,8,5.49],[12,18,8,5.49],[12,19,8,5.49],[12,20,8,5.50],[12,21,8,5.50],[12,22,8,5.51],[12,23,8,5.52],[12,24,8,5.52],[12,25,8,5.53],[12,26,8,5.53],[12,27,8,5.54],[12,28,8,5.54],[12,29,8,5.55],[12,30,8,5.56],[12,31,8,5.56] ];

