function planparty(theForm) {
	var redbottles = 0;
	var redcases = 0;
	var whitebottles = 0;
	var whitecases = 0;
	var noncases = 0;
	var totaldrinkers = 0;
	totaldrinkers = (theForm.reddrinkers.value * 1) + (theForm.whitedrinkers.value * 1);
	redbottles = Math.round((theForm.hours.value * 60 / 45) * theForm.guests.value * theForm.reddrinkers.value / 5 / 100 * 10) / 10;
	redcases = Math.round(redbottles / 12 * 100) / 100;
	whitebottles = Math.round((theForm.hours.value * 60 / 45) * theForm.guests.value * theForm.whitedrinkers.value / 5 / 100 * 10) / 10;
	whitecases = Math.round(whitebottles / 12 * 100) / 100;
	if (totaldrinkers != 100){
		alert('Percentages of red and white wine drinkers is not equal to 100%, please correct.');
		return true;
	}
	var generator=window.open('','party_planned','height=550,width=650,scrollbars=yes,resize=yes,status=yes');
	generator.document.write('<HTML>');
	generator.document.write('<HEAD>');
	generator.document.write('<TITLE>Joseph Phelps: Party Planner</TITLE>');
	generator.document.write('<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">');
	generator.document.write('<meta name="Description" content=" Joseph Phelps Vineyards. Excellence from the ground up.">');
	generator.document.write('<meta name="Keywords" content="Joseph Phelps Vineyards, Phelps Preferred Wine Club, Wine Spectator Wine of the Year, Insignia, Tom Shelton, Backus Vineyard Cabernet Sauvignon, Los Carneros Chardonnay, Ovation Chardonnay, Eisrebe, Johannisberg Riesling, Le Mistral, Napa Valley Merlot, Red Pastiche, White Pastiche, Sauvignon Blanc, Syrah, Viognier, Rhone-Style Wines, Vin du Mistral, Grenache Rose, Zinfandel, Saint Helena, St. Helena, Freestone, Alexander Valley, award winning">');
	generator.document.write('<LINK REL=STYLESHEET HREF="http://www.jpvwines.com/ui_basic.css" TYPE="text/css" MEDIA=SCREEN>');
	generator.document.write('<STYLE TYPE="text/css" MEDIA="all">');
	generator.document.write('@import url(http://www.jpvwines.com/ui_sophisticated.css);');
	generator.document.write('</STYLE>');
	generator.document.write('</HEAD>');
	generator.document.write('<BODY BGCOLOR=#333333 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>');
	generator.document.write('<TABLE WIDTH=540 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>');
	generator.document.write('	<TR>');
	generator.document.write('		<TD COLSPAN=6 align="left" bgcolor="#000000">');
	generator.document.write('			  <IMG SRC="http://www.jpvwines.com/images/logo.gif" WIDTH=210 HEIGHT=55 BORDER=0 ALT=""></TD>');
	generator.document.write('		<TD>');
	generator.document.write('			<IMG SRC="http://www.jpvwines.com/images/spacer.gif" WIDTH=1 HEIGHT=35 ALT=""></TD>');
	generator.document.write('	</TR>');
	generator.document.write('	<TR>');
	generator.document.write('		<TD COLSPAN=6>');
	generator.document.write('			<IMG SRC="http://www.jpvwines.com/images/heading_excellence.gif" WIDTH=540 HEIGHT=35 ALT=""></TD>');
	generator.document.write('		<TD>');
	generator.document.write('			<IMG SRC="http://www.jpvwines.com/images/spacer.gif" WIDTH=1 HEIGHT=35 ALT=""></TD>');
	generator.document.write('	</TR>');
	generator.document.write('	<TR>');
	generator.document.write('		<TD COLSPAN=6>');
	generator.document.write('			<IMG SRC="http://www.jpvwines.com/images/title_partyplanner.gif" WIDTH=540 HEIGHT=40 ALT=""></TD>');
	generator.document.write('		<TD>');
	generator.document.write('			<IMG SRC="http://www.jpvwines.com/images/spacer.gif" WIDTH=1 HEIGHT=40 ALT=""></TD>');
	generator.document.write('	</TR>');
	generator.document.write('	<TR>');
	generator.document.write('		<TD COLSPAN=6 ROWSPAN=2 valign="top" bgcolor="#FFFFCC">');
	generator.document.write('		  <table width="100%" border="0" cellspacing="0" cellpadding="20">');
	generator.document.write('            <tr>');
	generator.document.write('              <td>');
	generator.document.write('                        <span class="subhead">You selected the following criteria: </span><br>');
	generator.document.write('                        ' + theForm.guests.value + ' Guests<br>');
	generator.document.write('                        ' + theForm.hours.value + ' Hours<br>');
	generator.document.write('                        ' + theForm.reddrinkers.value + ' % Red Wine Drinkers<br>');
	generator.document.write('                        ' + theForm.whitedrinkers.value + ' % White Wine Drinkers<br>');
	generator.document.write('                        <span class="subhead">Your Results: </span><BR>');
	generator.document.write('                        <strong>Red Wine</strong><br>');
	generator.document.write('                        Number of Bottles Needed: ' + redbottles + '<br>');
	generator.document.write('                        Number of Cases Needed: ' + redcases + '<br><br>');
	generator.document.write('                        <strong>White Wine</strong><br>');
	generator.document.write('                        Number of Bottles Needed: ' + whitebottles + '<br>');
	generator.document.write('                        Number of Cases Needed: ' + whitecases + '<br><br>');
	generator.document.write('                        </p>');
	generator.document.write('                        <p>Please visit our <a href="#" onclick="opener.location=\'http://www2.ibgcheckout.com/phelps/catalog/index.jsp\';">online store</a> to shop for your favorite wines.</p>');
	generator.document.write('              </td>');
	generator.document.write('            </tr>');
	generator.document.write('          </table>');
	generator.document.write('		</TD>');
	generator.document.write('		<TD>');
	generator.document.write('			<IMG SRC="http://www.jpvwines.com/images/spacer.gif" WIDTH=1 HEIGHT=30 ALT=""></TD>');
	generator.document.write('	</TR>');
	generator.document.write('	<TR>');
	generator.document.write('		<TD>');
	generator.document.write('			<IMG SRC="http://www.jpvwines.com/images/spacer.gif" WIDTH=1 HEIGHT=20 ALT=""></TD>');
	generator.document.write('	</TR>');
	generator.document.write('</TABLE>');
	generator.document.write('</BODY>');
	generator.document.write('</HTML>');
	generator.document.close();
	return true;
}