// Brad: This file HAS NOT BEEN updated with all your edits


gEmail = "";

// This file contains common code for edit-room.html, find.html & client.aspx.

function orderForm() {
	document.location.href = ( live ) ? "https://www.hawaiivideomemories.com/event.aspx" : "event.aspx";
}

//--------------------------------------------------------------------------------------

EditRoomHelp = [ "About our Project Status Database", "" +

"<div class='fgBlack bold' style='margin:0px 0px 0px 0px;'>Purpose</div>" +
	"<div style='margin:0px 0px 0px 10px;'>Use our Project Status Interface to get a current status report on your past client's Video, DVD or any other product provided by HVM. This is a database driven page. To ensure you are receiving our most current data, HVM automatically updates it multiple times daily.</div>" +

"<div class='fgBlack bold' style='margin:6px 0px 0px 0px;'>Search Tips</div>" +
	"<div style='margin:0px 0px 0px 10px;'>" +
		"<OL STYLE='margin-top:0px; margin-bottom:0px;'>" +

			"<LI>Initially, when you load this page, the current date will be displayed. Enter the event date you would like to query, then press the Search Button." +

			"<LI>The event date must be entered in the \"mm/dd/yy\" format with the following exception: You may omit the current year and enter the month and day only \"mm/dd\" if you are querying the current year." +

			"<LI>To minimize typing, you do not need to enter preceding zeros. For example, you may enter February 6, 2004 as \"2/6/4\"." +

			"<LI>For your convenience, while your cursor is in the Date field, you may press & release the up-arrow key \"&uarr;\" to incrementally change the date ; OR press & release your down-arrow key \"&darr;\" to decrementally change the date." +

			"<LI>Performing the above action (up/down arrow) while holding down your Ctrl key will increment / decrement a week at a time." +

			"<LI>Pressing your Enter key while your cursor is in the Event Date field is equivalent to pressing the Search Button." +
		"</OL>" +

"<div class='fgBlack bold' style='margin:6px 0px 0px 0px;'>Search Results</div>" +
	"<div style='margin:0px 0px 0px 10px;'>" +
	"After successfully locating & reviewing your client's data, you may:" +
		"<OL STYLE='margin-top:0px; margin-bottom:0px;'>" +

			"<LI>Click \"Send E-mail\" to send that data to your client; or" +

			"<LI>If you have questions about the record, Click \"Send E-mail\" to send it back to us with your questions; or" +

			"<LI>You may track the shipment using the tracking number provided (if any). If the tracking number is properly formatted it will be presented as a hyperlink. Clicking it will load that shipper's data-base in a pop-up window." +

		"</OL>" +

"" ];

//--------------------------------------------------------------------------------------

function sendMailER( recipient, subject, body ) {
	document.location = "mailto:" + recipient + "?" + "subject=" + escape( subject ) + "&body=" + escape( body );
}
//--------------------------------------------------------------------------------------

function getShipInfo( id, trackNum ) {

	var ShipInfo = [ "", "" ];
	var hRef = "";

	switch( id ) {

		case 1: // US Mail
			var hRef = "";
			if( trackNum ) {
				var trackNumURL = trackNum.replaceLiteral( " ", "" );
				var trackRE = /^\d{20}$/;
				hRef = ( trackRE.test( trackNumURL ) ) ? "<a href = 'javascript:PopUp.openWin(\"http://trkcnfrm1.smi.usps.com/netdata-cgi/db2www/cbd_243.d2w/output\", 1, 1, 1, 1, .8, .6, 1, 1, 1 );' onClick='if( prompt( \"For your convenience, we suggest you copy (Ctrl+C) this\\ntracking number for use (Ctrl+V) on the Post Office Web Site\", \"" + trackNumURL + "\" ) ) return true; else return false;' onMouseover='self.status=this.title; return true;' onMouseout='self.status=\"\"; return true;' title='Track this shipment at USPS.com'>" + trackNum + "</a>" : trackNum;
			}
			ShipInfo = [ "US Mail", hRef ];
			break;

		case 2: // FedEx
			var hRef = "";
			if( trackNum ) {
				var trackNumURL = trackNum.replaceLiteral( " ", "" );
				var trackRE = /^\d{12}$/;
				hRef = ( trackRE.test( trackNumURL ) ) ? "<a href = 'javascript:PopUp.openWin(\"http://fedex.com/cgi-bin/tracking?action=track&language=english&cntry_code=us&initial=x&tracknumbers=" + trackNumURL + "\", 1, 1, 1, 1, .8, .6, 1, 1, 1 );' onMouseover='self.status=this.title; return true;' onMouseout='self.status=\"\"; return true;' title='Track this shipment at FedEx.com'>" + trackNum + "</a>" : trackNum;
			}
			ShipInfo = [ "FedEx", hRef ];
			break;

		case 3: // UPS
			// 3 Formats for UPS where 9 can be any character or digit:
			// 1Z 999 999 99 9999 999 9 ==> 1Z9999999999999999
			// 9999 9999 9999           ==> 999999999999
			// T999 9999 999            ==> T9999999999

			var hRef = "";
			if( trackNum ) {
				var trackNumURL = trackNum.replaceLiteral( " ", "" );

				var trackRE1 = /^1Z\w{16}$/;
				var trackRE2 = /^\w{12}$/;
				var trackRE3 = /^\T\w{10}$/;

				hRef = ( trackRE1.test( trackNumURL ) || trackRE2.test( trackNumURL ) || trackRE3.test( trackNumURL ) ) ? "<a href = 'javascript:PopUp.openWin(\"http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&loc=en_US&Requester=UPSHome&tracknum=" + trackNumURL + "&AgreeToTermsAndConditions=yes&track.x=41&track.y=8\", 1, 1, 1, 1, .8, .6, 1, 1, 1 );' onMouseover='self.status=this.title; return true;' onMouseout='self.status=\"\"; return true;' title='Track this shipment at UPS.com'>" + trackNum + "</a>" : trackNum;
			}
			ShipInfo = [ "UPS", hRef ];
			break;

		case 4:
			ShipInfo = [ "Pick up", trackNum ];
			break;

		case 5:
			ShipInfo = [ "DHL", trackNum ];
			break;

		case 6:
			ShipInfo = [ "On File", trackNum ];
			break;

		case 7:
			ShipInfo = [ "Delivered", trackNum ];
			break;

	}

	return ShipInfo;
}

//--------------------------------------------------------------------------------------

function getStatus( id ) {

	var theStatus = "";
	switch( id ) {

		case 1: theStatus = "Not Started"; break;
		case 2: theStatus = "Waiting On Someone"; break;
		case 3: theStatus = "In-Progress"; break;
		case 4: theStatus = "Completed"; break;

	}
	return theStatus;
}
//--------------------------------------------------------------------------------------

function showErrorER() {
	document.getElementById( "results" ).innerHTML = errorEditRoom;
}
//--------------------------------------------------------------------------------------

function getEmailLinkER( ThisRecord, ShipInfo ) {
	var EmailRecord = ThisRecord;
	for( i in EmailRecord ) {
		if( typeof EmailRecord[ i ] == "string" ) {
			EmailRecord[ i ] = EmailRecord[ i ].replaceLiteral( "'", "´" );
			EmailRecord[ i ] = EmailRecord[ i ].replaceLiteral( "<br>", " " );
		}
	}

	var shipMeth = ShipInfo[ 0 ].replaceLiteral( "'", "´" );

	var recipient = ThisRecord[ 9 ];
	var emailRE = /^[\w\.-]+@[\w\.-]+\.[a-zA-Z]{2,3}$/;
	recipient = ( recipient && emailRE.test( recipient ) ) ? recipient : "";

	return "<A HREF='javascript:sendMailER( \"" + recipient + "\", \"HVM Progress/Status Report\", \"Event Date: " + EmailRecord[ 0 ] + "\\nClient Name: " + EmailRecord[ 1 ]  + "\\nE-mail address on file: " + recipient + "\\nDue Date: " + EmailRecord[ 12 ] + "\\nStatus: " + getStatus( EmailRecord[ 13 ] ) + "\\nShip Date: " + EmailRecord[ 14 ] + "\\nShip Method: " + shipMeth + "\\nTracking No: " + EmailRecord[ 16 ] + "\\nRemarks: " + EmailRecord[ 17 ] + "\" );' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='E-mail this data to your client or whoever...' oncontextmenu='return goToPWH( \"" + ThisRecord[ 0 ] + "\", \"" + ThisRecord[ 3 ] + "\", this, event );' class='emailLink' valign='bottom'>Click to send this info to your client.</A>";
}
//--------------------------------------------------------------------------------------

function showMatchingRecords( MatchingRecords, SearchDate ) {

	var html = "<table border=0 cellpadding=0 cellspacing=0 class='fSize11'>";

	if( MatchingRecords ) {

		// Only one client for this date so expose all info for this client
		if( MatchingRecords.length == 1 ) {

			var ThisRecord = MatchingRecords[ 0 ];

			var shipMethodNum = ThisRecord[ 15 ];
			var trackNum = ThisRecord[ 16 ];
			var ShipInfo = getShipInfo( shipMethodNum, trackNum );

			html += "<tr><td colspan='2' height='1'>&nbsp;</td></tr>";

			html += "<tr><td align=right valign=top CLASS='calDataTitles' nowrap>Event Date:&nbsp;</td><td><div class='calData'>" + ThisRecord[ 0 ] + "</div></td></tr>";

			html += "<tr><td align=right valign=top CLASS='calDataTitles' nowrap>Client Name:&nbsp;</td><td><div class='calData'>" + ThisRecord[ 1 ] + "</div></td></tr>";

			html += "<tr><td align=right valign=top CLASS='calDataTitles' nowrap>Due Date:&nbsp;</td><td><div class='calData'>" + ThisRecord[ 12 ] + "</div></td></tr>";

			html += "<tr><td align=right valign=top CLASS='calDataTitles' nowrap>Status:&nbsp;</td><td><div class='calData'>" +  getStatus( ThisRecord[ 13 ] ) + "</div></td></tr>";

			html += "<tr><td align=right valign=top CLASS='calDataTitles' nowrap>Ship Date:&nbsp;</td><td><div class='calData'>" + ThisRecord[ 14 ] + "</div></td></tr>";

			html += "<tr><td align=right valign=top CLASS='calDataTitles' nowrap>Ship Method:&nbsp;</td><td><div class='calData'>" + ShipInfo[ 0 ] + "</div></td></tr>";

			html += "<tr><td align=right valign=top CLASS='calDataTitles' nowrap>Tracking No:&nbsp;</td><td><div class='calData'>" + ShipInfo[ 1 ] + "</div></td></tr>";

			html += "<tr><td align=right valign=top CLASS='calDataTitles' nowrap>Remarks:&nbsp;</td><td><div class='calData'>" + ThisRecord[ 17 ] + "</div></td></tr>";

			html += "<tr><td align='right' valign='bottom' nowrap colspan='2'>" + getEmailLinkER( ThisRecord, ShipInfo ) + "&nbsp;</td></tr>";

		}


		// More than one client on this date show data by client names
		else {

			for( var i = 0; i < MatchingRecords.length; i++ ) {

				var ThisRecord = MatchingRecords[ i ];

				var clientName = ThisRecord[ 1 ];

				if( clientName ) {

					var shipMethodNum = ThisRecord[ 15 ];
					var trackNum = ThisRecord[ 16 ];
					var ShipInfo = getShipInfo( shipMethodNum, trackNum );

					html += "<tr><td colspan='2' height='1'>&nbsp;</td></tr>";

					html += "<tr><td><div STYLE='margin:1px 0px 1px 0px;'><span class='cePlusMinus'>+</span><a href='javascript:void(0)' class='ceHead' onClick='if( window.CE ) { CE.switchDisplay( this ); }' onMouseover='if( window.CE ) CE.showTip( this ); return true;' onMouseout='self.status=\"\"; return true;'>" + clientName + "</a></div><div class='ceInfo'><table border=0 cellpadding=0 cellspacing=0 class='fSize11' style='margin:0px 0px 8px 0px;'>";

						html += "<tr><td align=right valign=top  CLASS='calDataTitles' nowrap>Event Date &nbsp;</td><td><div class='calData'>" + ThisRecord[ 0 ] + "</div></td></tr>";

						html += "<tr><td align=right valign=top  CLASS='calDataTitles' nowrap>Due Date &nbsp;</td><td><div class='calData'>" + ThisRecord[ 12 ] + "</div></td></tr>";

						html += "<tr><td align=right valign=top  CLASS='calDataTitles' nowrap>Status &nbsp;</td><td><div class='calData'>" +  getStatus( ThisRecord[ 13 ] ) + "</div></td></tr>";

						html += "<tr><td align=right valign=top  CLASS='calDataTitles' nowrap>Ship Date &nbsp;</td><td><div class='calData'>" + ThisRecord[ 14 ] + "</div></td></tr>";

						html += "<tr><td align=right valign=top  CLASS='calDataTitles' nowrap>Ship Method &nbsp;</td><td><div class='calData'>" + ShipInfo[ 0 ] + "</div></td></tr>";

						html += "<tr><td align=right valign=top  CLASS='calDataTitles' nowrap>Tracking No &nbsp;</td><td><div class='calData'>" + ShipInfo[ 1 ] + "</div></td></tr>";

						html += "<tr><td align=right valign=top  CLASS='calDataTitles' nowrap>Remarks &nbsp;</td><td><div class='calData'>" + ThisRecord[ 17 ] + "</div></td></tr>";

						html += "<tr><td align='right' valign='bottom' nowrap colspan='2'>" + getEmailLinkER( ThisRecord, ShipInfo ) + "&nbsp;</td></tr>";

					html += "</table></div></td></tr>";
				}
			}
		}
	}
	else { // no matching records found

		var eventDate = document.form1.Wedding_Date.value;

		html += "<tr><td><div class='calDataTitles' style='width:500px;'>We're sorry, there we no matching records found for " + eventDate + ".<BR><BR>Are you looking for a particular event but unable to find it? Don't hesitate to send us an <NOBR><A HREF='javascript:sendMailER( \"" + DB.Contact.Email + "\", \"HVM; Project Status Database\", \"Event Date: " + eventDate + "\\nMy Client&#39;s Name is: \\n\\nProblem: I am unable to find my client in your data-base at " + document.location.href + "\" );' TITLE='Send an e-mail to HVM'>e-mail</A></NOBR> or call us at " + DB.Contact.Tel + " during our normal business hours: " + DB.Contact.BusHours + ".<BR><BR>It's <SPAN ID='time'>&nbsp;</SPAN> at our office right now.</td></tr>";

		showHawaiiTime();

	}
	html += "</TABLE>";

	document.getElementById( "results" ).innerHTML = html;
	self.status = getFullDate( SearchDate );
	window.scrollBy( 0, 1000 );

}
//--------------------------------------------------------------------------------------

// Called on form1 submission
function searchRecords( Form ) {
	if( validDate( Form ) ) {

 		//hideBkg();
		var FormDate = Form.Wedding_Date.value.split( "/" );

		var formMon = parseInt( FormDate[ 0 ] );
		var formDay = parseInt( FormDate[ 1 ] );
		var formYr  = parseInt( FormDate[ 2 ] ) + 2000;
		var MatchingRecords = null;
		var counter = 0;

		for( var i = 0; i < WebDataPast.length; i++ ) {

			var ThisRecord = WebDataPast[ i ];

			var RecordDate   = ThisRecord[ 0 ].split( "/" );
			var recordMon    = parseInt( RecordDate[ 0 ] );
			var recordDay    = parseInt( RecordDate[ 1 ] );
			var recordYr     = parseInt( RecordDate[ 2 ] );
			var recordClient = ThisRecord[ 1 ];

			// Got a match and client name is NOT blank
			if( recordClient && formMon == recordMon && formDay == recordDay && formYr == recordYr ) {

				if( !MatchingRecords ) MatchingRecords = new Array();
				MatchingRecords[ counter ] = ThisRecord;

				counter++;
			}
		}
		var SearchDate = new Date( formYr, formMon - 1, formDay );
		showMatchingRecords( MatchingRecords, SearchDate );
	}
	return false;

}
//--------------------------------------------------------------------------------------

function getFullDate( TheDate ) {

	var theDay = TheDate.getDate();
	var dayOfWeek = getDayOfWeek( TheDate.getDay() );
	var theMonth = TheDate.getMonth();
	var theYear = TheDate.getFullYear();

	return dayOfWeek + "; " + getMonthName( theMonth + 1, true ) + " " + theDay + ", " + theYear;

}

//--------------------------------------------------------------------------------------

function showToday() {
	try {

		var Today = new Date();
		var month = Today.getMonth() + 1;
		var day = Today.getDate();
		var year = Today.getFullYear() - 2000;

		var Wedding_Date = document.form.Wedding_Date;

		Wedding_Date.value = month + "/" + day + "/" + year;
		Wedding_Date.focus();

		self.status = getFullDate( Today );

	}
	catch( e ) { setTimeout( "showToday()", 250 ); }
}
//--------------------------------------------------------------------------------------
var gCtrlPressed = false;

// Called onKeyDown of Event_Data TextField
function isShiftKey( e ) {
  var whichASC = ( IE ) ? event.keyCode : e.which;
  if( !gCtrlPressed && whichASC == 17 ) gCtrlPressed = true;
}
//--------------------------------------------------------------------------------------


// Called onKeyUp of Event_Data TextField
function changeDate( ThisField, e ) {

	var increment = false, decrement = false;

  var whichASC = ( IE ) ? event.keyCode : e.which;
  var whichKey = String.fromCharCode( whichASC ).toLowerCase();

  if( gCtrlPressed && whichASC == 17 ) gCtrlPressed = false;

  switch( whichKey ) {
    case "&": increment = true; break; // up arrow
    case "(": decrement = true; break; // down arrow
  }

	if( increment || decrement ) {

		var dateAbbrevRE = /^\d{1,2}\/{1}\d{1,2}$/;
		// User input abbreviated date like this: 12/5 (Dec 5th) so append current year
		if( dateAbbrevRE.test( ThisField.value ) ) {
			var Now = new Date();
			ThisField.value += "/" + ( Now.getFullYear() - 2000 );
		}

		var dateRE = /^\d{1,2}\/{1}\d{1,2}\/{1}\d{1,2}$/;
		if( !dateRE.test( ThisField.value ) ) {
			alert( "ERROR: Unable to " + ( ( increment ) ? "increment" : "decrement" ) + " date, it must be in the mm/dd/yy format, and mm, dd & yy must be digits." );
			ThisField.focus();
			return false;
		}

		if( gCtrlPressed )
			var offset = ( decrement ) ? -7 : 7;
		else
			var offset = ( decrement ) ? -1 : 1;

		var ThisDate = ThisField.value.split( "/" );
		for( var i = 0; i < ThisDate.length; i++ ) ThisDate[ i ] = parseInt( ThisDate[ i ] );

		ThisDate[ 1 ] = ThisDate[ 1 ] + offset;

		var NewDate = new Date( ThisDate[ 2 ] + 2000, ThisDate[ 0 ] - 1, ThisDate[ 1 ] );

		ThisField.value = ( NewDate.getMonth() + 1 ) + "/" + NewDate.getDate() + "/" + ( NewDate.getFullYear() - 2000 );

		self.status = getFullDate( NewDate );
	}
}

//--------------------------------------------------------------------------------------

function validDate( Form ) {

	var Wedding_Date = Form.Wedding_Date;

	var dateAbbrevRE = /^\d{1,2}\/{1}\d{1,2}$/;
	// User input abbreviated date like this: 12/5 (Dec 5th) so append current year
	if( dateAbbrevRE.test( Wedding_Date.value ) ) {
		var Now = new Date();
		Wedding_Date.value += "/" + ( Now.getFullYear() - 2000 );
	}

	var dateFullRE = /^\d{1,2}\/{1}\d{1,2}\/{1}(\d{1}|\d{2}|\d{4})$/;

	if( !dateFullRE.test( Wedding_Date.value ) ) {
		alert( "Event date is invalid, it must be in the mm/dd/yy format, and mm, dd & yy must be digits." );
		Wedding_Date.focus();
		return false;
	}

	var EventDates = Wedding_Date.value.split( "/" );

	var monthStr = EventDates[ 0 ];
	monthStr = monthStr.trim( "0", 1, 0 );
	if( !monthStr ) monthStr = "0";

	var dayStr = EventDates[ 1 ];
	dayStr = dayStr.trim( "0", 1, 0 );
	if( !dayStr ) dayStr = "0";

	var yrStr = EventDates[ 2 ];
	yrStr = yrStr.trim( "0", 1, 0 );
	if( !yrStr ) yrStr = "0";

	var month = parseInt( monthStr );
	var day = parseInt( dayStr );
	var year = parseInt( yrStr );
	if( year >= 2000 ) year -= 2000;

	Wedding_Date.value = month + "/" + day + "/" + year;

	var nDaysInMon = getNumDaysInMonth( month, year );

	// Trap errors
	if( month <= 0 || day <= 0 || year <= 0 ) {
		alert( "Invalid start date: The month, day and year must be greater than 0" );
		Wedding_Date.focus();
		return false;
	}
	else if( month > 12 ) {
		alert( "Invalid date: The month number \"" + month + "\" is greater than 12." );
		Wedding_Date.focus();
		return false;
	}
	else if( day > nDaysInMon ) {
		alert( "Invalid date: The day of month \"" + day + "\" is greater than the number of actual days (" + nDaysInMon + ") in the month." );
		Wedding_Date.focus();
		return false;
	}
	return true;
}
//--------------------------------------------------------------------------------------

// Called by go button on client.aspx
function getPWH( Form ) {
	if( validDate( Form ) ) {
		if( Form.Groom_LastName.value ) {
			var wDy = Form.Wedding_Date.value.split( "/" )[ 0 ];
			var wMn = Form.Wedding_Date.value.split( "/" )[ 1 ];
			var wYr = parseInt( Form.Wedding_Date.value.split( "/" )[ 2 ] );
			wYr += 2000;
			var dom = ( live ) ? "https://www.hawaiivideomemories.com/" : "";
			document.location.href = dom + "client.aspx?wedDate=" + wDy + "/" + wMn + "/" + wYr + "&grLast=" + Form.Groom_LastName.value;
		}
		else {
			alert( "Please enter groom's last name" );
			Form.Groom_LastName.focus();
		}
	}
	return false;
}
//--------------------------------------------------------------------------------------

function getEmailErrPWH() {
	return "<A HREF='mailto:" + DB.Contact.Email + "?subject=" + escape( "Unable to find private wedding homepage; HVM" ) + "&body=" + escape( "To help us best serve you, please answer the following questions:\n  1. Groom Last Name:\n  2. Bride Maiden Name:\n  3. Wedding Date:\n  4. Your relationship to Bride/Groom:\n\n\nERRANT LINK (do not edit):\n  URL: " + document.location.href ) + "' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='Inform us that you cannot find your private wedding homepage'>Send us an e-mail</A>";
}
//--------------------------------------------------------------------------------------

function writeDataFile() {

	var eIntro = "<span class='bold fgRed'>ERROR</span>: This is a dynamically generated page. It can only be displayed correctly when the query string portion of the URL (text that follows \"client.aspx\" in the address bar of your Browser) is properly formatted. There is a problem with the query string portion of this URL, specifically:<br><br>";

	var eEnd = "<br><br>If you are unable to resolve this problem, please " + getEmailErrPWH() + " to see if we can help, or go to our <A HREF='find.html' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='Search by wedding date & groom´s last name' style='font-size:11pt;'>search</A> page.";

	var qStr = unescape( document.location.search ).substring( 1 );
	if( qStr ) {


		var wDate = qStr.getVal( "wedDate" );
		if( wDate ) {

			var dateRE = /^\d{1,2}\/{1}\d{1,2}\/{1}\d{4}$/;
			if( !dateRE.test( wDate ) ) {
				errMsg = eIntro + "The wedding date within the query string portion of the URL is malformed: <span class='fgRed'>" + wDate + "</span>, it must be in the mm/dd/yyyy format such as these examples \"3/4/2006\" or \"12/9/2005\" or \"11/22/2005\"." + eEnd;
				return;
			}

			var WedDate = wDate.split( "/" );
			for( var i in WedDate ) WedDate[ i ] = parseInt( WedDate[ i ] );

			var Now  = new Date();
			var Today = new Date( Now.getFullYear(), Now.getMonth(), Now.getDate() );
			var today = Today.getTime();

			var TodayQstr = new Date( WedDate[ 2 ], WedDate[ 0 ] - 1, WedDate[ 1 ] );
			var todayQstr = TodayQstr.getTime();

			dataFile = ( todayQstr >= today ) ? "WebDataFuture.js" : "WebDataPast.js";
		}
		else {
			errMsg = eIntro + "The wedding date (wedDate=) cannot be found in the query string portion of the URL: <span class='fgRed'>" + qStr + "</span>" + eEnd;
			return;
		}

		var grLast = qStr.getVal( "grLast" );
		if( !grLast ) {
			errMsg = eIntro + "The groom's last name (grLast=) cannot be found in the query string portion of the URL: <span class='fgRed'>" + qStr + "</span>" + eEnd;
			return;
		}

	document.write( "<script language='javascript1.2' src='data/" + dataFile + "'></script>" );
	}
	else
		errMsg = eIntro + "The query string portion of the URL is completely missing" + eEnd;
}
//--------------------------------------------------------------------------------------

function getRecNum() {

	var recordNum = -1;

	var qStr = getQueryStr();
	var wDateQstr = qStr.getVal( "wedDate" );
	var gLast = qStr.getVal( "grLast" );

	for( var i = 0; i < WebData.length; i++ ) {

		// Client name is NOT blank & got a match on wed date & grLast
		if( WebData[ i ][ 1 ] && wDateQstr == WebData[ i ][ 0 ] ) {

			var gLast = gLast.toLowerCase();
			var gLastLen = gLast.length;
			var gLastDB = WebData[ i ][ 3 ].toLowerCase();

			if( gLast == gLastDB ) { recordNum = i; break; }
		}
	}

	return recordNum;
}
//--------------------------------------------------------------------------------------

function writePWH() {

	if( recNum >= 0 ) {

		var emailRE = /^[\w\.-]+@[\w\.-]+\.[a-zA-Z]{2,4}$/;
		var eMailValid = ( WebData[ recNum ][ 9 ] && emailRE.test( WebData[ recNum ][ 9 ] ) ) ? true : false;
		gEmail = ( eMailValid ) ? WebData[ recNum ][ 9 ].trim() : "";

		var adr = WebData[ recNum ][ 5 ];
		adr = adr.trim(); adr = adr.trim( "\r\n" ); adr = adr.trim( "\r" ); adr = adr.trim( "\n" ); adr = adr.trim();
		adr = adr.replaceLiteral( "<br>", "\n" );

		var htm = "";

		//////////////////////////// CONTACT INFO ////////////////////////////

		htm += "<div align='right'><img src='images/contactInfoTitle.gif'></div>";

		htm += "<div style='margin:0px 0px 0px 10px;'><span class='cePlusMinus' style='font-size:10pt; margin-right:3px;' id='form1'></span><a href='javascript:void(0)' class='ceHead' onClick='if( window.CE ) CE.switchDisplay( this );' onMouseover='if( window.CE ) CE.showTip( this ); return true;' onMouseout='self.status=\"\"; return true;' style='font-size:10pt;'>Edit</A></div>";

		htm += "<div class='ceInfo' align='center' style='margin:2px 0px 0px 25px;' id='form1Container'>" +

		"<table border='0' cellspacing='0' cellpadding='0' class='fgLtBrn fSize8b'>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:10px 8px 0px 10px;'>" +
						"First Names" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:10px 12px 0px 8px;'>" +
						"<input name='First_Names' class='textInputHalfWid' style='width:282px;' value='" + WebData[ recNum ][ 2 ].trim() + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
					"Groom Last" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Groom_Last_Name' class='textInputHalfWid' style='width:282px;' value='" + WebData[ recNum ][ 3 ].trim() + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"Bride Last" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Bride_Last_Name' class='textInputHalfWid' style='width:282px;' value='" + WebData[ recNum ][ 4 ].trim() + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"Address" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<textarea name='Address_Contact_Sect' wrap='true' rows='2' class='textInputHalfWid' style='width:282px;'>" + adr + "</textarea>" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"City St & Zip" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='City_Contact_Sect' class='textInputHalfWid' style='width:120px;' value='" + WebData[ recNum ][ 6 ].trim() + "' />&nbsp;&nbsp;" +
						"<input name='State_Contact_Sect' class='textInputHalfWid' style='width:80px;' value='" + WebData[ recNum ][ 7 ].trim() + "' />&nbsp;&nbsp;" +
						"<input name='Zip_Contact_Sect' class='textInputHalfWid' style='width:70px;' value='" + WebData[ recNum ][ 8 ].trim() + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"E-Mail" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Email_Contact_Sect' class='textInputHalfWid' style='width:282px;' value='" + gEmail + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"Phone 1" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Primary_Phone' class='textInputHalfWid' style='width:282px;' value='" + WebData[ recNum ][ 10 ].trim() + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"Phone 2" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Other_Phone' class='textInputHalfWid' style='width:282px;' value='" + WebData[ recNum ][ 11 ].trim() + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 10px 10px;'>" +
						"Comments" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 10px 8px;'>" +
						"<textarea name='Comments_Contact_Sect' wrap='true' rows='3' class='textInputHalfWid' style='width:282px;'></textarea>" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td></td>" +
				"<td align='left'>" +
					"<div style='margin:2px 12px 10px 8px;'>" +
						"<input type='button' value='Submit Changes' name='submit_ci_button' class='fSize8' onClick='return submitContactInfoForm();'>" +
					"</div>" +
				"</td>" +
			"</tr>" +

		"</table>" +

		"</div>";

		htm += "<div style='margin:8px 0px 0px 20px;'><table border='0' cellspacing='0' cellpadding='0' class='fgLtBrn fSize8b'>";

		// Names
		if( WebData[ recNum ][ 2 ].indexOf( "&" ) >= 0 ) {
			var FN = WebData[ recNum ][ 2 ].split( "&" );
			var gF = FN[ 0 ].trim();
			var bF = FN[ 1 ].trim();
			htm += "<tr><td>" + gF + " " + WebData[ recNum ][ 3 ] + " & " + bF + " " + WebData[ recNum ][ 4 ] + "</td></tr>";
		}
		else
			htm += "<tr><td>" + WebData[ recNum ][ 2 ] + " " + WebData[ recNum ][ 3 ] + "</td></tr>";

		// Address
		htm += "<tr><td>" + WebData[ recNum ][ 5 ] + "</td></tr>";

		// City, St & Zip
		htm += "<tr><td>" + WebData[ recNum ][ 6 ] + " " + WebData[ recNum ][ 7 ] + " " + WebData[ recNum ][ 8 ] + "</td></tr>";

		//E-Mail
		if( eMailValid )
			htm += "<tr><td><A class='emailLink' HREF='mailto:" + WebData[ recNum ][ 9 ] + "?subject=" + escape( WebData[ recNum ][ 21 ] + " " + WebData[ recNum ][ 0 ] ) + "' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='Send e-mail to " + WebData[ recNum ][ 9 ] + "'>" + WebData[ recNum ][ 9 ] + "</A></td></tr>";

		// Phone
		htm += "<tr><td>" + WebData[ recNum ][ 10 ] + "</td></tr>";

		// Alt Phone
		htm += "<tr><td>" + WebData[ recNum ][ 11 ] + "<br><br><br></td></tr></table></div>";



		//////////////////////////// WEDDING INFO ////////////////////////////

		// HEADER
		htm += "<div align='right'><img src='images/weddingInfoTitle.gif'></div>";

		htm += "<div style='margin:0px 0px 0px 10px;'><span class='cePlusMinus' style='font-size:10pt; margin-right:3px;' id='form2'></span><a href='javascript:void(0)' class='ceHead' onClick='if( window.CE ) CE.switchDisplay( this );' onMouseover='if( window.CE ) CE.showTip( this ); return true;' onMouseout='self.status=\"\"; return true;' style='font-size:10pt;'>Edit</A></div>";

		htm += "<div class='ceInfo' align='center' style='margin:2px 0px 0px 25px;' id='form2Container'>" +

		"<table border='0' cellspacing='0' cellpadding='0' class='fgLtBrn fSize8b'>" +

			"<tr>" +
				"<td align='left'>" +
					"<div style='margin:10px 8px 0px 10px;'>" +
"Wedding Date" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:10px 12px 0px 8px;'>" +
						"<select name='Wedding_Month' onFocus='self.status=\"Please select the event month\"' class='pullDownDark'>" +
							"<option value='1'>January" +
							"<option value='2'>February" +
							"<option value='3'>March" +
							"<option value='4'>April" +
							"<option value='5'>May" +
							"<option value='6'>June" +
							"<option value='7'>July" +
							"<option value='8'>August" +
							"<option value='9'>September" +
							"<option value='10'>October" +
							"<option value='11'>November" +
							"<option value='12'>December" +
						"</select>&nbsp;&nbsp;" +

						"<select name='Wedding_Day' onFocus='self.status=\"Please select the event Day\"' class='pullDownDark'>" +
							"<option value='1'>1" +
							"<option value='2'>2" +
							"<option value='3'>3" +
							"<option value='4'>4" +
							"<option value='5'>5" +
							"<option value='6'>6" +
							"<option value='7'>7" +
							"<option value='8'>8" +
							"<option value='9'>9" +
							"<option value='10'>10" +
							"<option value='11'>11" +
							"<option value='12'>12" +
							"<option value='13'>13" +
							"<option value='14'>14" +
							"<option value='15'>15" +
							"<option value='16'>16" +
							"<option value='17'>17" +
							"<option value='18'>18" +
							"<option value='19'>19" +
							"<option value='20'>20" +
							"<option value='21'>21" +
							"<option value='22'>22" +
							"<option value='23'>23" +
							"<option value='24'>24" +
							"<option value='25'>25" +
							"<option value='26'>26" +
							"<option value='27'>27" +
							"<option value='28'>28" +
							"<option value='29'>29" +
							"<option value='30'>30" +
							"<option value='31'>31" +
						"</select>&nbsp;&nbsp;" +

						"<select name='Wedding_Year' onFocus='self.status=\"Please select the event Year\"' class='pullDownDark'>" +
								getYearOptions() +
						"</select>" +
					"</div>" +

				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:10px 8px 0px 10px;'>" +
						"Package" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						getPackageOptions( "form" ) +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='left'>" +
					"<div style='margin:10px 8px 0px 10px;'>" +
"Coverage Time" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<select name='Coverage_Start_Time' onFocus='self.status=\"Please select your Event Start Time\"' onChange='setPkgEndTime( \"pcp\", this );' class='pullDownDark'>" +
							getWedTimeOptions( true, false ) +
						"</select>&nbsp;&nbsp;TO&nbsp;&nbsp;" +

						"<select name='Coverage_End_Time' onFocus='self.status=\"Please select your Event Start Time\"' onChange='setPkgStartTime( this )' class='pullDownDark'>" +
							getWedTimeOptions( false, false ) +
						"</select>" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"Location" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Location' class='textInputHalfWid' style='width:282px;' value='" + Loc[ WebData[ recNum ][ 24 ].toString() ].trim() + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"Number Guests" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Number_Guests' class='textInputHalfWid' style='width:282px;' value='" + WebData[ recNum ][ 25 ] + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"Photographer" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Photographer' class='textInputHalfWid' style='width:282px;' value='" + Pho[ WebData[ recNum ][ 26 ].toString() ].trim() + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"Minister" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Minister' class='textInputHalfWid' style='width:282px;' value='" + Min[ WebData[ recNum ][ 27 ].toString() ].trim() + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 0px 10px;'>" +
						"E-Mail" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 0px 8px;'>" +
						"<input name='Email_Wed_Sect' class='textInputHalfWid' style='width:282px;' value='" + gEmail + "' />" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td align='right'>" +
					"<div style='margin:4px 8px 10px 10px;'>" +
						"Comments" +
					"</div>" +
				"</td>" +
				"<td>" +
					"<div style='margin:4px 12px 10px 8px;'>" +
						"<textarea name='Comments_Wed_Sect' wrap='true' rows='3' class='textInputHalfWid' style='width:282px;'></textarea>" +
					"</div>" +
				"</td>" +
			"</tr>" +

			"<tr>" +
				"<td></td>" +
				"<td align='left'>" +
					"<div style='margin:2px 12px 10px 8px;'>" +
						"<input type='button' value='Submit Changes' name='submit_wi_button' class='fSize8' onClick='return submitWedInfoForm();'>" +
					"</div>" +
				"</td>" +
			"</tr>" +

		"</table>" +

		"</div>";


		htm += "<div class='ceInfo' align='center' style='margin:2px 0px 0px 25px;'>";

		htm += "Edit Wedding Info GUI Forthcoming...";

		htm += "</div>";

		htm += "<div style='margin:8px 0px 0px 0px;'><table border='0' cellspacing='0' cellpadding='0'>";

		//htm += "<tr><td valign=top><div class='pwhCol1'>Wedding Date</div></td><td>" + WebData[ recNum ][ 0 ] + "</td></tr>";

		// Time
		htm += "<tr><td width='190' valign=top align='right' class='fgWhite fSize8b'><div class='fgLtBrn' style='margin:0px 10px 12px 20px;'>Time</div></td><td align='left' valign='top' class='fgWhite fSize8b'>" + WebData[ recNum ][ 19 ] + " to " + WebData[ recNum ][ 20 ] + "</td></tr>";
		// Pkg
		htm += "<tr><td valign=top align='right' class='fgWhite fSize8b'><div class='fgLtBrn' style='margin:0px 10px 12px 20px;'>Package</div></td><td align='left' valign='top' class='fgWhite fSize8b'>" + Pkg[ WebData[ recNum ][ 22 ].toString() ] + "</td></tr>";
		// Loc
		htm += "<tr><td valign=top align='right' class='fgWhite fSize8b'><div class='fgLtBrn' style='margin:0px 10px 12px 20px;'>Location</div></td><td align='left' valign='top' class='fgWhite fSize8b'>" + Loc[ WebData[ recNum ][ 24 ].toString() ] + "</td></tr>";
		// nGuests
		htm += "<tr><td valign=top align='right' class='fgWhite fSize8b'><div class='fgLtBrn' style='margin:0px 10px 12px 20px;'>Guests</div></td><td align='left' valign='top' class='fgWhite fSize8b'>" + WebData[ recNum ][ 25 ] + "</td></tr>";
		// Photographer
		htm += "<tr><td valign=top align='right' class='fgWhite fSize8b'><div class='fgLtBrn' style='margin:0px 10px 12px 20px;'>Photographer</div></td><td align='left' valign='top' class='fgWhite fSize8b'>" + Pho[ WebData[ recNum ][ 26 ].toString() ] + "</td></tr>";
		// Officiant
		htm += "<tr><td valign=top align='right' class='fgWhite fSize8b'><div class='fgLtBrn' style='margin:0px 10px 12px 20px;'>Officiant</div></td><td align='left' valign='top' class='fgWhite fSize8b'>" + Min[ WebData[ recNum ][ 27 ].toString() ] + "</td></tr>";

		// Videographer
		var vidStr = Vid[ WebData[ recNum ][ 28 ].toString() ];
		var vLinkInfo = "<A class='emailLink' HREF='mailto:" + DB.Contact.Email + "?subject=" + escape( WebData[ recNum ][ 21 ] + " " + WebData[ recNum ][ 0 ] ) + "' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='Send e-mail to " + DB.Contact.Email + "'>" + DB.Contact.Email + "</A><br>";
		var vLink = "";
		var photoHtm = "";
		var photoCaptionHtm = "";
		if( vidStr ) {
			var Video = vidStr.split( "<br>" );
			for( var i = 0; i < Video.length; i++ ) {
				var VidLink = Video[ i ].split( "," );
				if( VidLink[ 1 ] ) {
					var fName = VidLink[ 1 ].trim();
					var fNameLC = fName.toLowerCase();

					vLink += "<A HREF='mailto:" + fName + "@HawaiiVideoMemories.com?subject=" + escape( WebData[ recNum ][ 21 ] + " " + WebData[ recNum ][ 0 ] ) + "' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='Send e-mail to " + fName + "@HawaiiVideoMemories.com'>" + fName + "@HawaiiVideoMemories.com</A><br>";

					switch( fNameLC ) {

						case "brendan":
							photoHtm += "<td><A HREF='images/staffBrendan.jpg' onMouseOver='self.status=dText[ 18 ]; this.title=dText[ 18 ]; return true;' onMouseOut='self.status=\"\"; return true;' onClick='if( window.DW ) { DW.createWindow( [ \"Brendan Reiss &#149; Cinematographer\", \"imgSrc=images/staffBrendan.jpg\" ], this, event, [2,10,-10], [0,333,500] ); return false; }'><IMG SRC='images/staffBrendanTN.jpg' BORDER='0' WIDTH='120' HEIGHT='120' HSPACE='0' VSPACE='0' onAbort='this.src=this.src;' CLASS='staff' style='margin:0px 6px 0px 0px;'></A></td>";
							photoCaptionHtm += "<td align=center>" + fName + "</td>";
							break;

						case "etan":
							photoHtm += "<td><A HREF='images/staffEtan.jpg' onMouseOver='self.status=dText[ 18 ]; this.title=dText[ 18 ]; return true;' onMouseOut='self.status=\"\"; return true;' onClick='if( window.DW ) { DW.createWindow( [ \"Etan Krupnick &#149; Cinematographer\", \"imgSrc=images/staffEtan.jpg\" ], this, event, [2,10,-10], [0,333,500] ); return false; }'><IMG SRC='images/staffEtanTN.jpg' BORDER='0' WIDTH='120' HEIGHT='120' HSPACE='0' VSPACE='0' onAbort='this.src=this.src;' CLASS='staff' style='margin:0px 6px 0px 0px;'></A></td>";
							photoCaptionHtm += "<td align=center>" + fName + "</td>";
							break;

						case "trent":
							photoHtm += "<td><A HREF='images/staffTrent.jpg' onMouseOver='self.status=dText[ 18 ]; this.title=dText[ 18 ]; return true;' onMouseOut='self.status=\"\"; return true;' onClick='if( window.DW ) { DW.createWindow( [ \"Trent Welsh &#149; Cinematographer\", \"imgSrc=images/staffTrent.jpg\" ], this, event, [2,10,-10], [0,333,500] ); return false; }'><IMG SRC='images/staffTrentTN.jpg' BORDER='0' WIDTH='120' HEIGHT='120' HSPACE='0' VSPACE='0' onAbort='this.src=this.src;' CLASS='staff' style='margin:0px 6px 0px 0px;'></A></td>";
							photoCaptionHtm += "<td align=center>" + fName + "</td>";
							break;

						case "ryssa":
							photoHtm += "<td><A HREF='images/staffRyssa.jpg' onMouseOver='self.status=dText[ 18 ]; this.title=dText[ 18 ]; return true;' onMouseOut='self.status=\"\"; return true;' onClick='if( window.DW ) { DW.createWindow( [ \"Ryssa Tam Ho &#149; Cinematographer\", \"imgSrc=images/staffRyssa.jpg\" ], this, event, [2,10,-10], [0,333,500] ); return false; }'><IMG SRC='images/staffRyssaTN.jpg' BORDER='0' WIDTH='120' HEIGHT='120' HSPACE='0' VSPACE='0' onAbort='this.src=this.src;' CLASS='staff' style='margin:0px 6px 0px 0px;'></A></td>";
							photoCaptionHtm += "<td align=center>" + fName + "</td>";
							break;

						case "todd":
							photoHtm += "<td><A HREF='images/staffTodd.jpg' onMouseOver='self.status=dText[ 18 ]; this.title=dText[ 18 ]; return true;' onMouseOut='self.status=\"\"; return true;' onClick='if( window.DW ) { DW.createWindow( [ \"Todd Perkins &#149; President\", \"imgSrc=images/staffTodd.jpg\" ], this, event, [2,10,-10], [0,333,500] ); return false; }'><IMG SRC='images/staffToddTN.jpg' BORDER='0' WIDTH='120' HEIGHT='120' HSPACE='0' VSPACE='0' onAbort='this.src=this.src;' CLASS='staff' style='margin:0px 6px 0px 0px;'></A></td>";
							photoCaptionHtm += "<td align=center>" + fName + "</td>";
							break;

					}
				}
			}
		}

		if( photoHtm )
			photoHtm = "<div style='margin:4px 0px 4px 0px;'><table border='0' cellspacing='0' cellpadding='0' class='fSize9'><tr>" + photoHtm + "</tr><tr>" + photoCaptionHtm + "</tr></table></div>";

		htm += "<tr><td valign=top nowrap align='right' class='fgWhite fSize8b'><div class='fgLtBrn' style='margin:0px 10px 12px 10px;'>Cinematographer</div></td><td align='left' valign='top' class='fgWhite fSize8b'>" + ( ( vidStr ) ? vidStr : "To be assigned" ) + "</td></tr>";
		htm += "<tr><td valign=top nowrap>&nbsp;</td><td align='left' valign='top'>" + photoHtm + "</td></tr>";
		htm += "<tr><td valign=top nowrap align='right' class='fgWhite fSize8b'><div class='fgLtBrn' style='margin:0px 10px 12px 10px;'>Email</div></td><td align='left' valign='top' class='fgWhite fSize8b'>" + ( ( vLink ) ? vLink : vLinkInfo ) + "</td></tr>";

		if( WebData[ recNum ][ 23 ] )
			htm += "<tr><td valign=top nowrap align='right' class='fgWhite fSize8b'><div class='fgLtBrn' style='margin:0px 10px 12px 10px;'>Remarks</div></td><td align='left' valign='top' class='fgWhite fSize8b'>" + WebData[ recNum ][ 23 ] + "</td></tr>";

		if( winIE )
			htm += "<tr><td valign=top nowrap>&nbsp;</td><td><div style='margin:6px 0px 4px 0px;'><a href='javascript:window.external.AddFavorite( \"" + document.location.href + "\", \"" + WebData[ recNum ][ 3 ] + " Private Wedding Homepage; HVM\" );' title='Click to bookmark this page' class='emailLink'>Bookmark this page</a></div></td></tr>";

		htm += "<tr><td valign=top nowrap>&nbsp;</td><td align='left' valign='top' class='fgWhite fSize8b'><br><A HREF='mailto:?subject=" + escape( "Private Wedding Homepage: " + WebData[ recNum ][ 21 ] + " " + WebData[ recNum ][ 0 ] ) + "&body=" + escape ( "The " + WebData[ recNum ][ 3 ] + " private wedding homepage is now on the Internet, point your browser to:\n" + document.location.href ) + "' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='Tell family & friends about your private wedding homepage' align='left' valign='top' class='emailLink'>Tell a Friend</A><br><br></td></tr>";

		htm += "</table></div>";


		//////////////////////////// PROGRESS REPORT ////////////////////////////
		if( pastClient ) {

			// HEADER
			htm += "<div CLASS=fgGray204 style='margin:20px 0px 2px 0px;'>&#151;&#151;&#151; <SPAN CLASS='fSize11 bold fgGray76'>PROGRESS REPORT</SPAN> &#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;&#151;</div>";

			htm += "<div style='margin:0px 0px 0px 0px;'><table border='0' cellspacing='0' cellpadding='0' class='fgWhite fSize8b'>";
			// Due Date

			htm +=  "<tr><td valign=top nowrap><div class='pwhCol1'>Due Date</div></td><td>" + WebData[ recNum ][ 12 ] + "</td></tr>";
			// Status
			htm += "<tr><td valign=top nowrap><div class='pwhCol1'>Status</div></td><td>" + getStatus( WebData[ recNum ][ 13 ] ) + "</td></tr>";
			// Ship Date
			htm += "<tr><td valign=top nowrap><div class='pwhCol1'>Ship Date</div></td><td>" + WebData[ recNum ][ 14 ] + "</td></tr>";

			var shipMethodNum = WebData[ recNum ][ 15 ];
			var trackNum = WebData[ recNum ][ 16 ];
			var ShipInfo = getShipInfo( shipMethodNum, trackNum );
			// Ship Method
			htm += "<tr><td valign=top nowrap><div class='pwhCol1'>Ship Method</div></td><td>" + ShipInfo[ 0 ] + "</td></tr>";
			// Track No
			htm += "<tr><td valign=top nowrap><div class='pwhCol1'>Tracking No</div></td><td>" + ShipInfo[ 1 ] + "</td></tr>";

			// Remarks
			if( WebData[ recNum ][ 17 ] )
				htm += "<tr><td valign=top nowrap><div class='pwhCol1'>Remarks</div></td><td>" + WebData[ recNum ][ 17 ] + "</td></tr>";

			htm += "</table></div>";
		}

		htm += "<div align='right'><img src='images/PreferencesTitle.gif'></div>";

		document.write( htm );
	}

}