var THEME_NORMAL=0;
var THEME_WINTER=1;
var THEME_MODE = THEME_NORMAL;

var LTH_PAGE__NONE =-1;
var LTH_PAGE__HOME =0;
var LTH_PAGE__MENU =1;
var LTH_PAGE__HOLIDAY =2;
var LTH_PAGE__BRIDAL =3;
var LTH_PAGE__ORDER =4;
var LTH_PAGE__CATERING =5;
var LTH_PAGE__CAMPS =6;
var LTH_PAGE__OLD_TOWN =7;
var LTH_PAGE__ABOUT =8;
var LTH_PAGE__RESERVATIONS =9;
var LTH_PAGE__BAKERY =10;
var LTH_PAGE__VALENTINES =11;
var LTH_PAGE__PRIVATE_PARTIES =12;
var LTH_PAGE__FASHION_SHOW =13;
var LTH_PAGE__NEWSLETTER =14;
var LTH_PAGE__REGENCY_BALL =15;
var LTH_PAGE__MOTHERS_DAY =16;
var LTH_PAGE__MERCHANT_ORDER =17;
var LTH_PAGE__PRINCESS_TEA =18;
var LTH_PAGE__PHOTOS =19;
var LTH_PAGE__BLOG =20;

function fnGenHeader2(which_page)
{
	if (which_page==LTH_PAGE__HOME)
	{
		var str_out = "";		
		str_out += 		"<div style=\"position:absolute; left:260px; top:90px;\">"; 
		str_out +=			"<img src='images/phase2/title_lth.png' />"
		str_out += 		"</div>";
		/*
		str_out += 		"<div style=\"position:absolute; left:37px; top:12px;\">"; 
		str_out +=			"<img src='images/phase2/tea_seatings.png' />"
		str_out += 		"</div>";

		str_out += 		"<div style=\"position:absolute; left:37px; top:155px;\">"; //left:8px; top: 140px;
		str_out += 			"<div class='style_lth_title_addr2' style='text-align: center;'>";
		str_out +=				"<img src='images/phase2/address2.png'  />"
		str_out += 			"</div>";
		str_out += 			"<div class='style_lth_title_addr' style='text-align: center; margin-top: 3px;'>";
		str_out +=	 			"<a href='reservations.html'>Online Reservations</a> - <a href='reservations.html'>Order Scones</a>"; // &nbsp;&#8226;&nbsp; 
		str_out +=	 		"</div>";
		str_out += 		"</div>";
		*/
		var left_at=0;
		str_out += 		"<div style='position:absolute; left:3px; top: 905px; font:16px 'Times New Roman';'>";
		str_out += 			"<div class=" +((which_page==LTH_PAGE__HOME)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"index.html\"; return false;'")
                                +" style='left:"+left_at+"px;'><img src='images/featured/lth_home.png' class='style_menu_item_img'/></div>";
		left_at+=190;

		str_out += 			"<div class=" +((which_page==LTH_PAGE__NEWSLETTER)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"newsletter.html\"; return false;'")
                                +" style='left:"+left_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_newsletter.png' /></div>";
		left_at+=190;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__MENU)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"menu.html\"; return false;'")
                                +" style='left:"+left_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_menu.png'></div>";
/*		left_at+=160;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__CATERING)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"catering.html\"; return false;'")
                                +" style='left:"+left_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_catering.png'></div>";
*/		left_at+=190;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__BRIDAL)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"bridal.htm\"; return false;'")
                                +" style='left:"+left_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_babybridal_teas.png'></div>";
		left_at+=190;
/*
		str_out += 			"<div class=" +((which_page==LTH_PAGE__CAMPS)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"summer_camp_2010.html\"; return false;'")
                                +" style='left:"+left_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_etiquette_camps.png'></div>";
		left_at+=185; */
		str_out += 			"<div class=" +((which_page==LTH_PAGE__PHOTOS)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"photos.html\"; return false;'")
                                +" style='left:"+left_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_photos.png'></div>";
		str_out += 		"</div>";
	}
	else
	{
		var str_out = "";		
		//<img style="position:absolute; top:0px; left:0px;z-index:200;" src="images/holly_small.png" /> 
		str_out += "<img style='position:absolute; top:0px; left:0px;z-index:200;width:105px;' src='images/holly_small.png' />";
		str_out += "<div class='style_top_links' style='z-index:100;'>";
		str_out += 		"<a class='link_top' href='http://www.quasitime.com'>Employee Login</a>"; 
		if (which_page==LTH_PAGE__OLD_TOWN)
			str_out += 	"&nbsp; <img src='images/phase2/" +((THEME_MODE == THEME_WINTER)?"sep_dot.gif":"sep_dot.gif") +"' /> &nbsp; <span class='link_top_selected'>Old Town Sherwood</span> ";
		else
			str_out += 	"&nbsp; <img src='images/phase2/" +((THEME_MODE == THEME_WINTER)?"sep_dot.gif":"sep_dot.gif") +"' /> &nbsp; <a class='link_top' href='old_town.html'>Old Town Sherwood</a> ";
		if (which_page==LTH_PAGE__ABOUT)
			str_out += 	"&nbsp; <img src='images/phase2/" +((THEME_MODE == THEME_WINTER)?"sep_dot.gif":"sep_dot.gif") +"' />&nbsp; <span class='link_top_selected'>About Us</span>";
		else
			str_out += 	"&nbsp; <img src='images/phase2/" +((THEME_MODE == THEME_WINTER)?"sep_dot.gif":"sep_dot.gif") +"' />&nbsp; <a class='link_top' href='about.html'>About Us</a>";		
		str_out += "</div>";
		str_out += "<div style=\"background: url('images/phase2/lth-header.jpg'); z-index:100; width: 900px; height:298px; border: 1px solid #a9a488; position:relative; font:16px 'Times New Roman';\">";
		str_out += 		"<div style=\"position:absolute; left:295px; top:-2px;\">"; 
		str_out +=			"<img src='images/phase2/title_lth.png' />"
		str_out += 		"</div>";
		str_out += 		"<div style=\"position:absolute; left:37px; top:12px;\">"; 
		str_out +=			"<img src='images/phase2/tea_seatings.png' />"
		str_out += 		"</div>";
		str_out += 		"<div style=\"position:absolute; left:37px; top:155px;\">"; //left:8px; top: 140px;
		str_out += 			"<div class='style_lth_title_addr2' style='text-align: center;'>";
		str_out +=				"<img src='images/phase2/address2.png'  />"
		str_out += 			"</div>";
		str_out += 			"<div class='style_lth_title_addr' style='text-align: center; margin-top: 3px;'>";
		str_out +=	 			"<a href='reservations.html'>Online Reservations</a> - <a href='reservations.html'>Order Scones</a>"; // &nbsp;&#8226;&nbsp; 
		str_out +=	 		"</div>";
		str_out += 		"</div>";
		var top_at=0;
		str_out += 		"<div style='position:absolute; right:187px; top: 3px;'>";
		str_out += 			"<div class=" +((which_page==LTH_PAGE__HOME)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"index.html\"; return false;'") +" style='top:"+top_at+"px;'><img src='images/featured/lth_home.png' class='style_menu_item_img'/></div>";
		/*
		top_at+=36;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__BLOG)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"blog.html\"; return false;'") +" style='top:"+top_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_blog.png'></div>";
		*/
		top_at+=36;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__NEWSLETTER)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"newsletter.html\"; return false;'") +" style='top:"+top_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_newsletter.png' /></div>";
		top_at+=36;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__MENU)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"menu.html\"; return false;'") +" style='top:"+top_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_menu.png'></div>";
	//	str_out += 			"<div class=" +((which_page==LTH_PAGE__ORDER)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"order.html\"; return false;'") +" style='top:"+top_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_orderscones.png'></div>";
		top_at+=36;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__CATERING)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"catering.html\"; return false;'") +" style='top:"+top_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_catering.png'></div>";
		top_at+=36;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__BRIDAL)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"bridal.htm\"; return false;'") +" style='top:"+top_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_babybridal_teas.png'></div>";
		top_at+=36;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__CAMPS)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"summer_camp_2010.html\"; return false;'") +" style='top:"+top_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_etiquette_camps.png'></div>";
		top_at+=36;
		str_out += 			"<div class=" +((which_page==LTH_PAGE__PHOTOS)?"'style_menu_selected'":"'style_menu_item' onclick='document.location=\"photos.html\"; return false;'") +" style='top:"+top_at+"px;'><img class='style_menu_item_img' src='images/featured/lth_photos.png'></div>";

		str_out += 		"</div>";
		str_out += "</div>";
	}
	document.writeln(str_out);
	
	// Snowflakes
	str_out ="";
	if (THEME_MODE == THEME_WINTER)
	{
		var i_snowflake =0;
		var snow_top = 70;
		var snow_x_offs =-50;
		str_out += "<img src='images/snowflake1.png' style='position:absolute; left: 5px;   top:-40px;' />";
		str_out += "<img src='images/snowflake0.png' style='position:absolute; left: 266px; top:-40px;' />";
		str_out += "<img src='images/snowflake3.png' style='position:absolute; left: 485px; top:-50px;' />";
		str_out += "<img src='images/snowflake2.png' style='position:absolute; left: 635px; top:230px;' />";
		for (i_snowflake=0; i_snowflake<9; i_snowflake++)
		{
			snow_x_offs = -50 - ((i_snowflake%2)*15);
			//+(i_snowflake % 7)
			//str_out += "<img src='images/snowflake"+ ((i_snowflake+2) % 4)+".png' style='position:absolute; left: -140px; top:"+(snow_top-90)+"px' />";
			str_out += "<img src='images/snowflake"+ (i_snowflake % 4)+".png' style='position:absolute; left: " +(snow_x_offs) +"px; top:"+snow_top+"px' />";
			
			str_out += "<img src='images/snowflake"+ ((i_snowflake+2) % 4)+".png' style='position:absolute; right: " +(snow_x_offs) +"px; top:"+(snow_top-20)+"px' />";
			//str_out += "<img src='images/snowflake"+ ((i_snowflake) % 4)+".png' style='position:absolute; right: -140px; top:"+(snow_top-90)+"px' />";
			snow_top += 180;
		}
	}
	document.writeln(str_out);
}

function fnGenFooter()
{
	var str_bg ="background: url('images/phase2/footer.png') repeat-x;";
	switch (THEME_MODE)
	{
		case THEME_WINTER:
			str_bg ="background: #6396c4; color: #fff;";
			break;
	}
	var str_out = "";		
	str_out += 	"<table class=\"style_table_clear\" style=\"" +str_bg +"; margin-top:10px; font: 12px Tahoma;\">";
	str_out += 		"<tr>";
	str_out += 			"<td style=\"padding: 9px 8px 2px 23px;\">";
	str_out += 				"Powered by <span class='style_link_light' onclick='document.location=\"http://www.quasitime.com\"'><b>Quasitime</b></span> &nbsp; - &nbsp; <span class='style_link_light' onclick='document.location=\"http://www.quasitime.com\"'><span style='font-size:10px;'>Make the most of your time</span></span>";
	str_out += 			"</td>";
	str_out += 			"</td>";
	str_out += 			"<td style=\"text-align:right; padding: 15px 9px 8px;\">";
	str_out += 				"<table class='style_table_clear' style='font: 12px Tahoma;' ><tr><td valign='middle' style='text-align:right;'>Follow us on</td><td valign='middle' style='width:90px;'><a class='invisible_link' href='http://www.facebook.com/pages/Sherwood-OR/Lavender-Tea-House/99334671795' target='_new' ><img src='images/phase2/facebook.jpg' /></a></td></tr></table>";
	str_out += 			"</td>";
	str_out += 		"</tr>";
	str_out += 	"</table>";
	str_out += 	"<div style=\"text-align:center; padding: 5px 9px 0px; font-style: normal; font: 10px Tahoma;\">";
	str_out +=		"Copyright 2005-2011 Lavender Tea House. All rights reserved.";
	str_out +=	"</div>"
	document.writeln(str_out);
}

function fnGenTopLinks(which_page)
{
	var str_out = "";	
	str_out += "<div class='style_page_top_links'>";
	str_out += 		"<a class='link_top' href='http://www.quasitime.com'>Employee Login</a>";
	if (which_page==LTH_PAGE__OLD_TOWN)
		str_out += 	"&nbsp; <img src='images/phase2/sep_dot.gif' />&nbsp; <span class='link_top_selected'>Old Town Sherwood</span>";
	else
		str_out += 	"&nbsp; <img src='images/phase2/sep_dot.gif' />&nbsp; <a class='link_top' href='old_town.html'>Old Town Sherwood</a>";
	if (which_page==LTH_PAGE__ABOUT)
		str_out += 	"&nbsp; <img src='images/phase2/sep_dot.gif' />&nbsp; <span class='link_top_selected'>About Us</span>";
	else
		str_out += 	"&nbsp; <img src='images/phase2/sep_dot.gif' />&nbsp; <a class='link_top' href='about.html'>About Us</a>";
	str_out += "</div>";
	document.writeln(str_out);
}

var NUM_FUTURE_RSRV_MONTHS=6;

function fnConfigureMonthSelect()
{
	var str_out="";
	var jsdate = new Date();
	jsdate.setDate(1);
	str_out += "<select id='select_month' onchange='fnConfigureDaySelect2();'>";
	var i=0;
	for (i=0; i<NUM_FUTURE_RSRV_MONTHS; i++)
	{
		var n_month =jsdate.getMonth()+1;
		str_out +="<option value='" +jsdate.getFullYear() +"-" +n_month +"' " +(!i?"selected":"") +">" +fnMonth2StrVerbose(n_month);
		jsdate.setMonth(jsdate.getMonth()+1);
	}
	str_out += "</select>";
	fnSetInnerhtml("span_select_month",str_out)
	
	fnConfigureDaySelect2();
}

function fnConfigureDaySelect2()
{
	var str_temp = "";
	str_temp += "<select id='select_day' onchange='fnConfigureTimeSelect2();'>";
	var date1 = fnGetElemValue("select_month");
	var jsdate = fnSQLDate2JSDate(date1 +"-01");
	//str_temp += "<option value='" +fnJSDate2SQLDate(jsdate) +"' selected>1";
	var n_month=jsdate.getMonth();
	var first=1;
	while (jsdate.getMonth()==n_month)
	{
		// No Mondays
		// No 5/08/11
		if ( 	(jsdate.getDay()==1)	
			||  ( n_month==4 && jsdate.getDate()==8 && jsdate.getFullYear()==2011 ))
		{
			var do_nothing=1;
		}
		else
		{
			str_temp += "<option value='" +fnJSDate2SQLDate(jsdate) +"' " +(first?"selected":"") +">" +jsdate.getDate();
			first=0;
		}
		jsdate.setDate(jsdate.getDate()+1);
	}
	str_temp += "</select>";
	fnSetInnerhtml("span_select_day", str_temp);
	fnConfigureTimeSelect2();
}

function fnConfigureTimeSelect2()
{
	var str_temp = "";
	str_temp += "<select id='select_time'>";

	var date1 = fnGetElemValue("select_day");
	var js_date = fnSQLDate2JSDate(date1);

	if (js_date.getDay()==0)
	{
		str_temp += "<option value='-1' selected>Select a time";
		str_temp += "<option value='1230'>12:30 pm";
	}
	else if (js_date.getDay()!==1)
	{
		str_temp += "<option value='-1' selected>Select a time";
		str_temp += "<option value='1000'>10:00 am";
		str_temp += "<option value='1230'>12:30 pm";
		str_temp += "<option value='1500'>3:00 pm";
	}
	str_temp += "</select>";
	fnSetInnerhtml("span_select_time", str_temp);
	fnSetSelectedIndex("select_time",0);
}



