<!--#include virtual="/includes/resifunctions.asp" -->
<!--#include virtual="/includes/datefunctions.asp" -->

<%
Session("Entity_ID") = "7476"
	Set Conn = Server.CreateObject("ADODB.Connection")
	Conn.Open "DRIVER={SQL Server};SERVER=WEBSRV01;UID=web;pwd=w3bs1t3;DATABASE=AVANTE"



Dim SQL1, SQLAttr, SQLPrice, p, j, ArrivalDate, StartDay, EndDay, DepartDate, Weeks, TotalDays, DayCount, Amenity_ID
Dim Conn, RS1, Entity_ID, AvailRooms, No_Rooms, tmpArray, Upper, itinArray
	
No_Rooms = True
AvailRooms = 0

SQL1 = "Select * from Entity E inner join Entity_Detail ED on E.Entity_ID = ED.Entity_ID where E.Entity_ID = '7413' or E.Entity_ID = '7476' "
Set RS1=Conn.Execute(SQL1)
Set RSAmenity = Server.CreateObject("ADODB.Recordset")
SQLAmenity = "Select AP.[Amenity_ID], AP.[Group_ID], II.[Item_ID], AP.[Name], AP.[Description], ATT.[Att_Desc] "
SQLAmenity = SQLAmenity & "from Entity E "
SQLAmenity = SQLAmenity & "Inner Join (Group_Entity_Map GEM "
SQLAmenity = SQLAmenity & "Inner Join ([Group] G "
SQLAmenity = SQLAmenity & "Inner Join (Attribute_Type ATT "
SQLAmenity = SQLAmenity & "Inner Join (Inventory_Item II "
SQLAmenity = SQLAmenity & "Inner Join Amenity_Package AP "
SQLAmenity = SQLAmenity & "On II.Amenity_ID = AP.Amenity_ID) "
SQLAmenity = SQLAmenity & "On ATT.Att_ID = II.Att_ID) "
SQLAmenity = SQLAmenity & "On AP.Group_ID = G.Group_ID) "
SQLAmenity = SQLAmenity & "On GEM.Group_ID = G.Group_ID) "
SQLAmenity = SQLAmenity & "On E.Entity_ID = GEM.Entity_ID "
SQLAmenity = SQLAmenity & "Where E.Entity_ID='7476' Or E.Entity_ID='7413' "
SQLAmenity = SQLAmenity & "Order By E.Entity_ID , ATT.Att_Desc_Detail"
RSAmenity.Open SQLAmenity, Conn
Set RSAttr = Server.CreateObject("ADODB.Recordset")

'Response.Write "Stay:" & Session("Stay")

If Request("Stay") = "" And (IsNull(Session("Stay")) Or Session("Stay") = "") Then
Session("Stay") = "1"
ElseIf Not Request("Stay") = "" Then
Session("Stay") = Request("Stay")
End If

If Request("RoomCount") = "" And Session("RoomCount") = "" Then
Session("RoomCount") = "1"
ElseIf Not Request("RoomCount") = "" Then
Session("RoomCount") = Request("RoomCount")
End If

If Request("AdultCount") = "" And Session("AdultCount") = "" Then
Session("AdultCount") = "1"
ElseIf Not Request("AdultCount") = "" Then
Session("AdultCount") = Request("AdultCount")
End If

If Request("ChildCount") = "" And Session("ChildCount") = "" Then
Session("ChildCount") = "0"
ElseIf Not Request("ChildCount") = "" Then
Session("ChildCount") = Request("ChildCount")
End If

If Not Session("AdultCount") = "" And Not Session("ChildCount") = "" Then
Session("GuestCount") = CStr(Int(Session("AdultCount")) + Int(Session("ChildCount")))
End If


' DATE STUFF
If Not Request("ArrivalYear") = "" And Not Request("ArrivalMonth") = "" And Not Request("ArrivalDay") = "" Then		
Session("ArrivalYear") = Request("ArrivalYear")
Session("ArrivalMonth") = Request("ArrivalMonth")
Session("ArrivalDay") = Request("ArrivalDay")
ArrivalDate = CDate(Session("ArrivalMonth") & "/" & Session("ArrivalDay") & "/" & Session("ArrivalYear"))
End If

If Not Request("DepartYear") = "" And Not Request("DepartMonth") = "" And Not Request("DepartDay") = "" Then
Session("DepartYear") = Request("DepartYear")
Session("DepartMonth") = Request("DepartMonth")
Session("DepartDay") = Request("DepartDay")
DepartDate = CDate(Session("DepartMonth") & "/" & Session("DepartDay") & "/" & Session("DepartYear"))
End If

If Not ArrivalDate = "" Then
Session("ArrivalDate") = ArrivalDate
Else
ArrivalDate = Session("ArrivalDate")
End If

If DepartDate = "" And Not ArrivalDate = "" Then
DepartDate = DateAdd("d", Session("Stay"), Session("ArrivalDate"))
End If

If Not DepartDate = "" Then
Session("DepartDate") = DepartDate
Else
DepartDate = Session("DepartDate")
End If

' END OF DATE STUFF

If Not Request("Back") = "" Then
Back = Int("-" & Request("Back"))
Session("ArrivalDate") = DateAdd("d", Back, Session("ArrivalDate"))
Session("ArrivalYear") = Year(Session("ArrivalDate"))
Session("ArrivalMonth") = Month(Session("ArrivalDate"))
Session("ArrivalDay") = Day(Session("ArrivalDate"))
Session("DepartDate") = DateAdd("d", Back, Session("DepartDate"))
Session("DepartYear") = Year(Session("DepartDate"))
Session("DepartMonth") = Month(Session("DepartDate"))
Session("DepartDay") = Day(Session("DepartDate"))
Elseif Not Request("Forward") = "" Then
Forward = Int(Request("Forward"))
Session("ArrivalDate") = DateAdd("d", Forward, Session("ArrivalDate"))
Session("ArrivalYear") = Year(Session("ArrivalDate"))
Session("ArrivalMonth") = Month(Session("ArrivalDate"))
Session("ArrivalDay") = Day(Session("ArrivalDate"))
Session("DepartDate") = DateAdd("d", Forward, Session("DepartDate"))
Session("DepartYear") = Year(Session("DepartDate"))
Session("DepartMonth") = Month(Session("DepartDate"))
Session("DepartDay") = Day(Session("DepartDate"))
End If

If Not RSAmenity.EOF Then
If Session("ArrivalDate") = "" Then Set RSAmenity = Nothing
End If

Session("Image_Width") = "300"
Session("Image_Height") = "200"

If (Int(Session("Stay")) + (Weekday(Session("ArrivalDate"), 1)-1)) > 7 Then 
Weeks = ((Int(Session("Stay")) + (Weekday(Session("ArrivalDate"), 1)-1)) / 7)
Else
Weeks = 1
End If

If Weeks > Fix(Weeks) Then Weeks = Fix(Weeks) + 1
 	%>
 	
<html>
	<head>
		<title>Untitled Document</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<script language="javascript" src="/js/menu-script.js"></script>
		<script language="javascript">
<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

 function subform() {
 
 var string
 var empty = true
 var aInput = document.body.getElementsByTagName("INPUT");
 for(i=0;i<aInput.length;i++){
 	string = aInput[i].id.substring(0, 4);
 
 	if (string=='AID_'&&aInput[i].value!=''&&aInput[i].value!='0'){		
 		empty = false
 		}
 		}
 		if (empty) {
 			alert('Must Select At Least On Unit');
 		} else {
 			form2.submit();
 		}
 }
 
  function subform1() {

 		if (document.form1.Stay.value=='') {
 			alert('Must Select Length of Stay');
 		} else {
 			form1.submit();
 		}
 }
//-->
		</script>
		<link rel="stylesheet" href="/Style-sheets/tropical-1.css" type="text/css"> 
		<link rel="stylesheet" href="/Style-sheets/arrivares.css" type="text/css">
 <link rel="stylesheet" href="/Style-sheets/standard-input-form.css" type="text/css">
 <link rel="stylesheet" href="/Style-sheets/page-formatting.css" type="text/css"><link rel="stylesheet" href="/Style-sheets/headline.css" type="text/css">
	
<link rel="stylesheet" href="/Style-sheets/page-formatting.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/standard-input-form.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/input-form-small.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/OrderPlannerLink.css" type="text/css">
</head>
	
<body bgcolor="#000000" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/menu/resort-amentites-dim.gif','images/menu/cottages-dim.gif','images/menu/attractions-dim.gif','images/menu/events-dim.gif','images/menu/contact-us-dim.gif','images/menu/reservations-dim.gif','images/menu/home-dim.gif','/images/booking-button-dim.gif')">

<table width="650" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#7BB8B9" class="main-table-space">
  <tr>
				<td colspan="2">
					<img src="/images/header-composite.jpg" width="650" height="76">
				</td>
			</tr>
			<tr>
				
    <td width="120" height="228" valign="top"> 
      <table width="120" border="0" cellspacing="0" cellpadding="0" height="100%">
        <tr>
							
          <td background="/images/menu-121.gif" valign="top" width="634"> 
            <!--#include virtual="/includes/menu.asp" -->
          </td>
						</tr>
						<tr>
							
          <td background="/images/menu/menu-121-palm.gif" height="122" width="119">&nbsp; 
          </td>
						</tr>
					</table>
				</td>
				
    <td width="538" height="336" valign="top" align="center"> 
      <table width="525" border="0" cellspacing="0" cellpadding="0" bgcolor="#DCECED">
        <tr> 
          <td width="542" align="left" valign="top" class="tableSpace" height="7"> 
            <img src="/images/conerUL.gif" width="14" height="15"> </td>
          <td width="15" valign="top" align="right" class="tableSpace" height="7"> 
            <img src="/images/conerUR.gif" width="15" height="14"> </td>
        </tr>
        <tr> 
          <td valign="top" height="114" colspan="2"> 
            <form action="reservations.asp" method="POST" id="form1" name="form1">
              <table border="0" cellpadding="0" cellspacing="0" width="250" align="center">
                <!-- fwtable fwsrc="top-search-hdr.png" fwbase="top-search-hdr.gif" -->
                <tr valign="top"> 
                  <!-- row 2 -->
                  <td width="250" height="15"><img src="/images/search-tables/top-search.gif" width="250" height="15"></td>
                </tr>
                <tr valign="top"> 
                  <td bgcolor="#7BB8B9" width="250" valign="top"> 
                    <table width="250" border="0" cellspacing="0" cellpadding="0" bgcolor="#7BB8B9">
                      <tr> 
                        <td colspan="4" align="right" class="2p-rule"></td>
                      </tr>
                      <tr> 
                        <td width="93" align="right"><img src="/images/arrival.gif" width="51" height="13"> 
                        </td>
                        <td width="51" class="input-form-small"> 
                          <%  							  
														'Set Current Date Parameters 								
														CurDate = DateAdd("d", 1, Date())							
														%>
                          <select name="ArrivalMonth" class="input-box-blue">
                            <%=GetMonthDD(Session("ArrivalDate"), CurDate, True, False, False)%>	
                          </select>
                        </td>
                        <td class="input-form-small" width="47"> 
                          <select name="ArrivalDay" class="input-box-blue">
                            <%=GetDayDD(Session("ArrivalDate"), CurDate, True)%>	
                          </select>
                        </td>
                        <td class="input-form-small" width="59"> 
                          <select name="ArrivalYear" class="input-box-blue">
                            <%=GetYearDD(Session("ArrivalDate"), CurDate, True)%> 
                          </select>
                        </td>
                      </tr>
                      <tr> 
                        <td colspan="4" height="2" class="2p-rule"></td>
                      </tr>
                      <tr> 
                        <td width="93" align="right"><img src="/images/length-stay.gif" width="86" height="13"> 
                        </td>
                        <td colspan="2" class="input-form-small"> 
                          <select name="Stay" class="input-box-blue">
                            <option value selected> Select</option>
                            <option value="1"> 1 Night</option>
                            <option value="2"> 2 Nights</option>
                            <option value="3"> 3 Nights</option>
                            <option value="4"> 4 Nights</option>
                            <option value="5"> 5 Nights</option>
                            <option value="6"> 6 Nights</option>
                            <option value="7"> 7 Nights</option>
                            <option value="8"> 8 Nights</option>
                            <option value="9"> 9 Nights</option>
                            <option value="10"> 10 Nights</option>
                            <option value="11"> 11 Nights</option>
                            <option value="12"> 12 Nights</option>
                          </select>
                        </td>
                        <td width="59" class="input-form-small">&nbsp; </td>
                      </tr>
                      <tr> 
                        <td colspan="4" align="right" height="2" class="2p-rule"></td>
                      </tr>
                      <tr> 
                        <td width="93" align="right"><img src="/images/adult-guests.gif" width="81" height="11"> 
                        </td>
                        <td colspan="3" class="input-form-small"> 
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr> 
                              <td width="32%"> 
                                <select name="AdultCount" class="input-box-blue">
                                <option value="0">0</option>
								<option value="1" selected>1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
                                </select>
                              </td>
                              <td width="29%"><img src="/images/children-guests.gif" width="60" height="11"> 
                              </td>
                              <td width="39%"> 
                                <select name="ChildCount" class="input-box-blue">
                                <option value="0" selected>0</option>
								<option value="1">1</option>
								<option value="2">2</option>
								<option value="3">3</option>
								<option value="4">4</option>
								<option value="5">5</option>
								<option value="6">6</option>
                                </select>
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr> 
                        <td colspan="4" align="right" class="2p-rule"></td>
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr valign="top"> 
                  <td width="250" valign="top"><img name="m_bottom" src="/images/search-tables/bottom.gif" width="250" height="35" border="0" usemap="#m_bottom" onClick="subform1();" style="{cursor:hand}"></td>
                </tr>
              </table>
            </form>
          </td>
        </tr>
        <tr> 
          <td width="542" class="galley-textCenter" align="center">To make your 
            Reservation, Enter your quanity and<br>
            click &quot;Continue with Reservation&quot; at the end of the page. 
        <tr align="right"> 
          <td width="542" valign="top" class="row-space-sm" height="437" align="center"> 
            <form action="transaction.asp" method="POST" id="form2" name="form2">

            <!-- start -->
            <%

If Request.QueryString("MaxHit") = "1" Then %>
            <table width="475" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td colspan="3" width="520" class="galley-text"> The Number Of 
                  Adults Exceeds The Max Occupancy For The Selected Rooms. Please 
                  Select More Rooms. </td>
              </tr>
            </table>
            <%End If
Dim layercnt
layercnt = 1

If IsDate(Session("ArrivalDate")) Then
If Not RSAmenity.EOF Then

RSAmenity.MoveFirst()
Do While Not RSAmenity.EOF
If (Int(RoomQtyCheck(7413, Session("ArrivalDate"), Session("DepartDate"), RSAmenity("Amenity_ID"))) > 0) Then
'SQLAttr = "Select AMT.Name, APM.Variable, APM.Amenity_Type_ID from Amenity_Package AP inner join (Amenity_Package_Map APM inner join Amenity_Type AMT on APM.Amenity_Type_ID = AMT.Amenity_Type_ID) "
'SQLAttr = SQLAttr & "on AP.Amenity_ID = APM.Amenity_ID where AP.Amenity_ID = '" & RSAmenity("Amenity_ID") & "' And "
'SQLAttr = SQLAttr & "APM.Amenity_Type_ID = '68' And APM.Variable >= '" & Session("GuestCount") / Session("RoomCount") & "'"
'Set RSAttr = Conn.Execute(SQLAttr)
'Response.Write "There<br>"
'If Not RSAttr.EOF And Not Trim(Session("RoomCount")) = "" Then
'Response.Write "Everywhere<br>"
If RoomAvailability(RSAmenity("Item_ID"), Session("ArrivalDate"), Session("DepartDate")) = True Then
'Response.Write "Where?<br>"
No_Rooms = False
SQLAttr = "Select AMT.Name, APM.Variable, APM.Amenity_Type_ID from Amenity_Package AP inner join (Amenity_Package_Map APM inner join Amenity_Type AMT on APM.Amenity_Type_ID = AMT.Amenity_Type_ID) "
SQLAttr = SQLAttr & "on AP.Amenity_ID = APM.Amenity_ID where AP.Amenity_ID = '" & RSAmenity("Amenity_ID") & "'"
Set RSAttr = Conn.Execute(SQLAttr)
%>
            <table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td colspan="2"> 
                  <table width="500" border="0" cellspacing="0" cellpadding="0">
                    <tr bgcolor="#2A2F88"> 
                      <td width="527" bgcolor="#7BB8B9"><b class="sub-head"><%=RSAmenity("Att_Desc") & " - " & RSAmenity("Name")%></b><br>
                        </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td width="357" class="profile-body"> 
                <%=RSAmenity("Description")%>
                 
                </td>
                <td class="form-captions" width="143" valign="middle" align="center"> 
                <br>
<span class="imageclip"><%= Get_image_by_lodging_item(rsamenity("item_id"), 32, False)%></span>
                <%= Get_image_height_width_by_lodging_item(rsamenity("item_id"), 33)%> 
                  <a href="javascript:;" onMouseOver="roomzoom<%=layercnt%> = window.open('/room-zoom.asp?item_id=<%=rsamenity("item_id")%>&amp;title=<%=RSAmenity("Att_Desc") & " - " & RSAmenity("Name")%>','roomzoom<%=layercnt%>','width=<%=Session("Image_Width")%>,height=<%=Session("Image_Height")%>,top=400,left=400')" onMouseOut="roomzoom<%=layercnt%>.close();"><img src="/images/room-zoom-bar.gif" width="100" height="10" border="0"></a> 
                  <!--<a href="javascript:;" onMouseOver="roomzoom<%=layercnt%> = openFrameless('<%=Session("Image_Width") +4%>', '<%=Session("Image_Height") +4%>', '400', '400', '/room-zoom.asp?item_id=<%=rsamenity("item_id")%>', 'Test')" onMouseOut="roomzoom<%=layercnt%>.close();"><img src="/images/room-zoom-bar.gif" width="100" height="10" border="0"></a></td>-->
                  <br>
              <tr> 
                <td colspan="2" valign="bottom" height="29" align="left"> 
                  <table border="0" cellspacing="0" cellpadding="0" width="427">
                    <tr> 
                      <!-- p = 0 to weeks - 1 -->
                      <td height="45" align="center" width="110"> 
                        <table border="0" cellspacing="0" cellpadding="0" height="48" width="78">
                          <tr align="center" valign="bottom"> 
                            <td class="form-captions" height="26">Enter Number<br>
                              Desired</td>
                          </tr>
                          <tr> 
                            <td align="center" class="form-captions" valign="top" height="11" width="78">
                              <input type="text" name="AID_<%=RSAmenity("Item_ID")%>" id="AID_<%=RSAmenity("Item_ID")%>" size="1" class="formObjects-9pt">
                            </td>
                          </tr>
                        </table>
                      </td>
                      <td height="45" align="right" width="363"> 
                        <table border="0" cellspacing="0" cellpadding="1">
                          <tr> 
                            <td bgcolor="#FFFF99" rowspan="2" align="right"><a href="?Back=1"><img src="/images/left-arrow.gif" border="0"></a></td>
                            <td bgcolor="#FFFF99"></td>
                            <td bgcolor="#FFFF99" rowspan="2"><a href="?Forward=1"><img src="/images/right-arrow.gif" border="0"></a></td>
                          </tr>
                          <tr> 
                            <td align="center" valign="top" height="36" bgcolor="#FFFF99"> 
                              <table width="260" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFF99">
                                <tr align="left"> 
                                  <%
j = 0
For p = 0 to Weeks - 1
If Weeks > 0 And p > 0 Then
Response.Write "</tr><tr>"
End If
%>
                                  <%
For i = 0 to 6
If p = 0 Then
If Not i >= Weekday(Session("ArrivalDate"), 1)-1 Then
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p = 0 ... if not i >= Weekday ... -->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
ElseIf j > Int(Session("Stay"))-1 Then
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p = 0 ... elseif j > int... -->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
Else
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p = 0 ... else -->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>-s.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"><%=Month(DateAdd("d", j, Session("ArrivalDate"))) & "/" & Day(DateAdd("d", j, Session("ArrivalDate")))%></td>
                                      </tr>
                                      <tr align="center"> 
                                        <%
Set RSItem = Server.Createobject("ADODB.Recordset")
SQLItem = "[Avante].[dbo].[Get_Inventory_Details_Entity] '7413', '" & DateAdd("d", j, Session("ArrivalDate")) & "', '" & RSAmenity("Amenity_ID") & "'"
RSItem.Open SQLItem, Conn
%>
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF">$ 
                                          <%If Not RSItem.EOF Then Response.Write(RSItem("Cost_Web_SNGL"))%>
                                        </td>
                                        <%
RSItem.Close()
%>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
j = j + 1
End If
End If
If p > 0 Then
If Not j > Int(Session("Stay"))-1 Then
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p > 0 then ... if not j > int(daycount)...-->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>-s.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"><%=Month(DateAdd("d", j, Session("ArrivalDate"))) & "/" & Day(DateAdd("d", j, Session("ArrivalDate")))%></td>
                                      </tr>
                                      <tr align="center"> 
                                        <%
Set RSItem = Server.Createobject("ADODB.Recordset")
SQLItem = "[Avante].[dbo].[Get_Inventory_Details_Entity] '7413', '" & DateAdd("d", j, Session("ArrivalDate")) & "', '" & RSAmenity("Amenity_ID") & "'"
RSItem.Open SQLItem, Conn
%>
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF">$ 
                                          <%If Not RSItem.EOF Then Response.Write(RSItem("Cost_Web_SNGL"))%>
                                        </td>
                                        <%
RSItem.Close()
%>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
j = j + 1
Else
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p > 0 then ... else 'j<%=j%>' 'p<%=p%>' '<%=Session("Stay")%>'-->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
End If
End If
Next
Next
%>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr> 
                            <td colspan="3" align="center"> </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <br>
            <%Else
Set RSAttr = Nothing
End If
'End If
End If
RSAmenity.MoveNext()
layercnt = layercnt + 1
Loop
%>
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td colspan="2"> <br>
                  <span class="headline-bold">Vacation Cottages</span><br>
                  <img src="/images/rule.gif" width="490" height="7"> 
                  </td>
                  </tr>
                  </table>
                  <%
RSAmenity.MoveFirst()
Do While Not RSAmenity.EOF
If (Int(RoomQtyCheck(7476, Session("ArrivalDate"), Session("DepartDate"), RSAmenity("Amenity_ID"))) > 0) Then
'SQLAttr = "Select AMT.Name, APM.Variable, APM.Amenity_Type_ID from Amenity_Package AP inner join (Amenity_Package_Map APM inner join Amenity_Type AMT on APM.Amenity_Type_ID = AMT.Amenity_Type_ID) "
'SQLAttr = SQLAttr & "on AP.Amenity_ID = APM.Amenity_ID where AP.Amenity_ID = '" & RSAmenity("Amenity_ID") & "' And "
'SQLAttr = SQLAttr & "APM.Amenity_Type_ID = '68' And APM.Variable >= '" & Session("GuestCount") / Session("RoomCount") & "'"
'Set RSAttr = Conn.Execute(SQLAttr)

'If Not RSAttr.EOF And Not Trim(Session("RoomCount")) = "" Then
If RoomAvailability(RSAmenity("Item_ID"), Session("ArrivalDate"), Session("DepartDate")) = True Then
No_Rooms = False
SQLAttr = "Select AMT.Name, APM.Variable, APM.Amenity_Type_ID from Amenity_Package AP inner join (Amenity_Package_Map APM inner join Amenity_Type AMT on APM.Amenity_Type_ID = AMT.Amenity_Type_ID) "
SQLAttr = SQLAttr & "on AP.Amenity_ID = APM.Amenity_ID where AP.Amenity_ID = '" & RSAmenity("Amenity_ID") & "'"
Set RSAttr = Conn.Execute(SQLAttr)
%>
            <table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td colspan="2"> 
                  <table width="500" border="0" cellspacing="0" cellpadding="0">
                    <tr bgcolor="#2A2F88"> 
                      <td width="527" bgcolor="#7BB8B9"><b class="sub-head"><%=RSAmenity("Att_Desc") & " - " & RSAmenity("Name")%></b><br>
                        <span class="bodysmall"> Nightly Rate based on:&nbsp; 
                        <%
If Not RSAttr.EOF Then
RSAttr.MoveFirst()
Do While Not RSAttr.EOF
If RSAttr("Amenity_Type_ID") = "67" Then
Response.Write RSAttr("Variable")
End If
RSAttr.MoveNext()
Loop
RSAttr.MoveFirst()
End If
%>
                        &nbsp;Adult(s)&nbsp;-&nbsp; Max. Occupancy:&nbsp; 
                        <%
If Not RSAttr.EOF Then
RSAttr.MoveFirst()
Do While Not RSAttr.EOF
If RSAttr("Amenity_Type_ID") = "68" Then
Response.Write RSAttr("Variable")
Response.Write ("<input type=""hidden"" name=""max_occ" & RSAmenity("Item_ID") & """ value=""" & RSAttr("Variable") & """>")
End If
RSAttr.MoveNext()
Loop
RSAttr.MoveFirst()
End If
%>
                        </span> </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td width="357" class="profile-body"> 
                  <%If Not RSAttr.EOF Then
Dim i
i = 0

Do While Not RSAttr.EOF
If Not (RSAttr("Amenity_Type_ID") = "67" or RSAttr("Amenity_Type_ID") = "68" or RSAttr("Amenity_Type_ID") = "66") Then
If i > 0 And Not (Last_Entry = "67" or Last_Entry = "68" or Last_Entry = "66") Then
Response.Write ", " & RSAttr("Name")
Else
Response.Write RSAttr("Name")
End If
End If
Last_Entry = RSAttr("Amenity_Type_ID")
RSAttr.MoveNext()
i = i + 1
Loop

If i > 0 Then Response.Write (".")
End If
Set RSAttr = Nothing
%>
                </td>
                <td class="form-captions" width="143" valign="middle" align="center"> 
                  <br>
<span class="imageclip"><%= Get_image_by_lodging_item(rsamenity("item_id"), 32, False)%></span>
                  <%= Get_image_height_width_by_lodging_item(rsamenity("item_id"), 33)%> 
                  <a href="javascript:;" onMouseOver="roomzoom<%=layercnt%> = window.open('/room-zoom.asp?item_id=<%=rsamenity("item_id")%>&amp;title=<%=RSAmenity("Att_Desc") & " - " & RSAmenity("Name")%>','roomzoom<%=layercnt%>','width=<%=Session("Image_Width")%>,height=<%=Session("Image_Height")%>,top=400,left=400')" onMouseOut="roomzoom<%=layercnt%>.close();"><img src="/images/room-zoom-bar.gif" width="100" height="10" border="0"></a> 
                  <!--<a href="javascript:;" onMouseOver="roomzoom<%=layercnt%> = openFrameless('<%=Session("Image_Width") +4%>', '<%=Session("Image_Height") +4%>', '400', '400', '/room-zoom.asp?item_id=<%=rsamenity("item_id")%>', 'Test')" onMouseOut="roomzoom<%=layercnt%>.close();"><img src="/images/room-zoom-bar.gif" width="100" height="10" border="0"></a></td>-->
                  <br>
              <tr> 
                <td colspan="2" valign="bottom" height="29" align="left"> 
                  <table border="0" cellspacing="0" cellpadding="0" width="427">
                    <tr> 
                      <!-- p = 0 to weeks - 1 -->
                      <td height="45" align="center" width="110"> 
                        <table border="0" cellspacing="0" cellpadding="0" height="48" width="78">
                          <tr align="center" valign="bottom"> 
                            <td class="form-captions" height="26">Enter Number<br>
                              Desired</td>
                          </tr>
                          <tr> 
                            <td align="center" class="form-captions" valign="top" height="11" width="78">
                              <input type="text" name="AID_<%=RSAmenity("Item_ID")%>" id="AID_<%=RSAmenity("Item_ID")%>" size="1" class="formObjects-9pt">
                            </td>
                          </tr>
                        </table>
                      </td>
                      <td height="45" align="right" width="363"> 
                        <table border="0" cellspacing="0" cellpadding="1">
                          <tr> 
                            <td bgcolor="#FFFF99" rowspan="2" align="right"><a href="?Entity_ID=<%=Session("Entity_ID")%>&amp;Back=1"><img src="/images/left-arrow.gif" border="0"></a></td>
                            <td bgcolor="#FFFF99"></td>
                            <td bgcolor="#FFFF99" rowspan="2"><a href="?Entity_ID=<%=Session("Entity_ID")%>&amp;Forward=1"><img src="/images/right-arrow.gif" border="0"></a></td>
                          </tr>
                          <tr> 
                            <td align="center" valign="top" height="36" bgcolor="#FFFF99"> 
                              <table width="260" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFF99">
                                <tr align="left"> 
                                  <%
j = 0
For p = 0 to Weeks - 1
If Weeks > 0 And p > 0 Then
Response.Write "</tr><tr>"
End If
%>
                                  <%
For i = 0 to 6
If p = 0 Then
If Not i >= Weekday(Session("ArrivalDate"), 1)-1 Then
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p = 0 ... if not i >= Weekday ... -->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
ElseIf j > Int(Session("Stay"))-1 Then
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p = 0 ... elseif j > int... -->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
Else
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p = 0 ... else -->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>-s.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"><%=Month(DateAdd("d", j, Session("ArrivalDate"))) & "/" & Day(DateAdd("d", j, Session("ArrivalDate")))%></td>
                                      </tr>
                                      <tr align="center"> 
                                        <%
Set RSItem = Server.Createobject("ADODB.Recordset")
SQLItem = "[Avante].[dbo].[Get_Inventory_Details_Entity] '" & Session("Entity_ID") & "', '" & DateAdd("d", j, Session("ArrivalDate")) & "', '" & RSAmenity("Amenity_ID") & "'"
RSItem.Open SQLItem, Conn
%>
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF">$ 
                                          <%If Not RSItem.EOF Then Response.Write(RSItem("Cost_Web_SNGL"))%>
                                        </td>
                                        <%
RSItem.Close()
%>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
j = j + 1
End If
End If
If p > 0 Then
If Not j > Int(Session("Stay"))-1 Then
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p > 0 then ... if not j > int(daycount)...-->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>-s.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"><%=Month(DateAdd("d", j, Session("ArrivalDate"))) & "/" & Day(DateAdd("d", j, Session("ArrivalDate")))%></td>
                                      </tr>
                                      <tr align="center"> 
                                        <%
Set RSItem = Server.Createobject("ADODB.Recordset")
SQLItem = "[Avante].[dbo].[Get_Inventory_Details_Entity] '" & Session("Entity_ID") & "', '" & DateAdd("d", j, Session("ArrivalDate")) & "', '" & RSAmenity("Amenity_ID") & "'"
RSItem.Open SQLItem, Conn
%>
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF">$ 
                                          <%If Not RSItem.EOF Then Response.Write(RSItem("Cost_Web_SNGL"))%>
                                        </td>
                                        <%
RSItem.Close()
%>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
j = j + 1
Else
%>
                                  <td valign="top" width="52"> 
                                    <!-- if p > 0 then ... else 'j<%=j%>' 'p<%=p%>' '<%=Session("Stay")%>'-->
                                    <table width="50" height="11" border="0" cellspacing="1" cellpadding="0" align="center">
                                      <tr> 
                                        <td class="row-space-sm" height="4"><img src="/images/calender/<%=WeekdayName(i + 1, False, 1)%>.gif" width="50" height="11"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                      <tr align="center"> 
                                        <td class="sm-hdln" height="11" bgcolor="#FFFFFF"></td>
                                      </tr>
                                    </table>
                                  </td>
                                  <%
End If
End If
Next
Next
%>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr> 
                            <td colspan="3" align="center"> </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <br>
            <%Else
Set RSAttr = Nothing
End If
'End If
End If
RSAmenity.MoveNext()
layercnt = layercnt + 1
Loop

End If
End If
%>
            <!-- end -->
            <div align="right"><img src="/images/booking-button.gif" width="125" height="50" name="Image1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','/images/booking-button-dim.gif',1)" onclick="form2.submit();" style="{cursor:hand}"></div>
            <% If No_Rooms = True And Not Session("ArrivalDate") = "" Then %>
            <div align="center"><font size="3"><br>
              <span class="galley-text-bold"><br>
              </span><span class="galley-text">There are no Cottages available 
              for your search criteria. </span><br>
              <br>
              </font></div>
            <% End If %>
            <% If Not isDate(Session("ArrivalDate")) Then %>
            <div align="center"><font size="3"><br>
              <span class="galley-text"> Please select an arrival date for your 
              stay.</span></font></div>
            <% End If %>
          </td>
        </tr>
        <tr> 
          <td width="542" align="left" valign="bottom" class="tableSpace" height="6"> 
            <img src="/images/conerLL.gif" width="15" height="14"></td>
          <td width="15" align="right" valign="bottom" class="tableSpace" height="3"><img src="/images/conerLR.gif" width="15" height="15"></td>
        </tr>
      </table>
      </form>
    </td>
			</tr>
			<tr><td colspan="2" height="22"><img src="/images/footer-650.jpg" width="650" height="33"></td></tr>
		</table>
<!--#include virtual="/includes/footer.asp" -->
	 <map name="m_bottom"> 
                      <area shape="rect" coords="61,3,195,35">
                    </map></body>
</html>
