<div id="calendar_month">
	<div class="month_row header">
		<table class="table">
			<tr>
				<th>Sun</th>
				<th>Mon</th>
				<th>Tue</th>
				<th>Wed</th>
				<th>Thu</th>
				<th>Fri</th>
				<th>Sat</th>
			</tr>
		</table>
	</div>
	
	<% i = 0 %>
	<% day_count_for_title = 0 %>
	<% day_count_for_space = 0 %>
	<% while i < 6 %>
		<div class="month_row">
			<table class="table month_table">
				<tr>
					<% x = 0 %>
					<% while x < 7 %>
						<% if day_count_for_space < @pre_disabled_days %> 
							<td class="disable"></td>
						<% elsif day_count_for_space >= @post_disabled_days %>
							<td class="disable"></td>
						<% elsif day_count_for_space == @today-1 %>
							<td class="today"></td>
						<% else %>
							<td></td>
						<% end %>
						<% day_count_for_space += 1 %>
						<% x += 1 %>
					<% end %>
				</tr>
			</table>
			<table class="table month_date" row="<%= i+1 %>">
				<tr>
					<% x = 0 %>
					<% while x < 7 %>
						<% if day_count_for_title < @pre_disabled_days %> 
							<td class="day_title disable"  no="<%= day_count_for_title+1 %>"><%= @dateset[day_count_for_title] %></td>
						<% elsif day_count_for_title >= @post_disabled_days %>
							<td class="day_title disable"  no="<%= day_count_for_title+1 %>"><%= @dateset[day_count_for_title] %></td>
						<% else %>
							<td class="day_title click_event" ref="day-btn" link="<%= new_panel_calendar_back_end_event_path %>" date="<%= @dateset[day_count_for_title] %>" position="<%= x+1 %>" no="<%= day_count_for_title+1 %>"><%= @dateset[day_count_for_title] %></td>
						<% end %>
						<% day_count_for_title += 1 %>
						<% x += 1 %>
					<% end %>
				</tr>
			</table>
		</div>
		<% i += 1 %>
	<% end %>
</div>
