<div class="BodyContainer">

%%GLOBAL_Show_Tab%%

<form action="index.php?ToDo=viewStatsUsers" name="frmStats" id="frmStats" method="post">
	<script type="text/javascript" src="includes/amcharts/swfobject.js"></script>

	<input id="currentTab" name="currentTab" value="%%GLOBAL_CurrentTab%%" type="hidden">
	<table class="OuterPanel" id="outerpanel" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td class="Heading1" colspan="5">%%GLOBAL_StatsTitle%%</td></tr>
		<tr>
			<td class="Intro" colSpan="5">
				<div>%%GLOBAL_StatsIntro%%</div></td>
		</tr>

		<tr>
			<td>
				<ul id="tabnav">
					<li><a href="#" class="active" id="tab0" onClick="ShowTab(0)">%%LNG_StatsUsersSummary%%</a></li>
					<li><a href="#" id="tab1" onClick="ShowTab(1);document.getElementById('currentTab').value = 1;">%%LNG_StatsUsersArticles%%</a></li>
					<li><a href="#" id="tab2" onClick="ShowTab(2);document.getElementById('currentTab').value = 2;">%%LNG_StatsUsersAuthorsPopularity%%</a></li>
					<li><a href="#" id="tab3" onClick="ShowTab(3);document.getElementById('currentTab').value = 3;">%%LNG_StatsUsersComments%%</a></li>
				</ul>
			</td>
		</tr>

		<tr>
			<td>
				<div id="div0" style="display: none;">
					<p>%%LNG_StatsUserSummaryInfo%%</p>

					<table width="100%" border="0">
						<tr>
							<td rowspan="3" width="45%" valign="top">
								<table border="0" cellpadding="0" cellspacing="0"  width="100%" class="text">
									<tr class="Heading3">
										<td colspan="2" nowrap align="left">
											User Statistics
										</td>
									</tr>
									<tr class="GridRow">
										<td width="40%">%%LNG_Total%%:</td>
										<td>%%GLOBAL_TotalUsers%%</td>
									</tr>
									<tr class="GridRow">
										<td>%%LNG_Active%%:</td>
										<td>%%GLOBAL_ActiveUsers%%</td>
									</tr>
									<tr class="GridRow">
										<td>%%LNG_Inactive%%:</td>
										<td>%%GLOBAL_InactiveUsers%%</td>
									</tr>
									<tr class="GridRow">
										<td>%%LNG_MostPopularAuthor%%:</td>
										<td>%%GLOBAL_MostPopularAuthor%%</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td align="center"><p><strong>%%LNG_StatsChartActiveUsers%%</strong></p></td>
						</tr>
						<tr>
							<td valign="top" width="55%">
								<script>PrintChart("%%GLOBAL_chartUsers%%");</script>
							</td>
						</tr>
					</table>
				</div>

				<div id="div1" style="display: none">
					<p>%%LNG_StatsUsersArticlesInfo%%</p>
					<div style="padding:5px 0px 5px 10px" class="Text FloatLeft">
						<table border=0 cellspacing=0 cellpadding=0>
							<tr>
								<td class=Text width=90 bgcolor=#EEEEEE style="padding-top:3pt" nowrap>&nbsp;<img src="images/dateicon.gif" width="20" height="20" align="absMiddle">&nbsp;%%LNG_DateRange%%: </td>
								<td width=90 bgcolor="#EEEEEE">
									<select name="Calendar[DateType]" id="Calendar" class="CalendarSelect" onChange="doCustomDate(this, 1)">
										<option value="Today">%%LNG_Today%%</option>
										<option value="Yesterday">%%LNG_Yesterday%%</option>
										<option value="Last7Days">%%LNG_Last7Days%%</option>
										<option value="Last30Days">%%LNG_Last30Days%%</option>
										<option value="ThisMonth">%%LNG_ThisMonth%%</option>
										<option value="LastMonth">%%LNG_LastMonth%%</option>
										<option value="AllTime" SELECTED>%%LNG_AllTime%%</option>
										<option value="Custom">%%LNG_Custom%%</option>
									</select>
								</td>
								<td width=50 bgcolor="#EEEEEE" style="padding-top:5pt"><input type=submit value="%%LNG_Go%%" class="Text" style="margin-bottom:5px; margin-left:5px;"></td>
								<td bgcolor="#EEEEEE" nowrap style="padding-top:5pt">
									<span id=customDate1 style="display:none">&nbsp;
									<select name="Calendar[From][Day]" class="CalendarSelectSmall" style="margin-bottom:3px">
										%%GLOBAL_ArticlePerUserFromDays%%
									</select>
									<select name="Calendar[From][Mth]" class="CalendarSelectSmall" style="margin-bottom:3px">
										%%GLOBAL_ArticlePerUserFromMonths%%
									</select>
									<select name="Calendar[From][Yr]" class="CalendarSelectSmall" style="margin-bottom:3px">
										%%GLOBAL_ArticlePerUserFromYears%%
									</select>
									<span class=body>%%LNG_To1%%</span>
									<select name="Calendar[To][Day]" class="CalendarSelectSmall" style="margin-bottom:3px">
										%%GLOBAL_ArticlePerUserToDays%%
									</select>
									<select name="Calendar[To][Mth]" class="CalendarSelectSmall" style="margin-bottom:3px">
										%%GLOBAL_ArticlePerUserToMonths%%
									</select>
									<select name="Calendar[To][Yr]" class="CalendarSelectSmall" style="margin-bottom:3px">
										%%GLOBAL_ArticlePerUserToYears%%
									</select>
									</span>&nbsp;
								</td>
								<td nowrap class=body id="showDate1" style="display:none; padding-top: 6pt;">&nbsp;&nbsp;</td>
								<td nowrap >&nbsp;</td>
							</tr>
						</table>
						<table border=0 cellspacing=0 cellpadding=0 width="100%">
							<tr>
								<!--<td valign="top" class="text" width="25px">
									<br />
									<div class="MidHeading" style="width: 185px;">
										<img align="absmiddle" src="images/questions.gif"/>
										 %%LNG_StatArticlesPostedSummary%%
									</div>
									<ul class="Text" style="width:185px;">
										<li>%%LNG_StatTotalArticlesPosted%%: %%GLOBAL_TotalArticles%%</li>
										<li>%%LNG_StatTotalUser%%: %%GLOBAL_TotalAuthors%%</li>
									</ul>
								</td>	-->
								<td valign="top" class="text"width="2500">
									<center style="margin-bottom:10px;margin-top:20px;">
										<b>%%GLOBAL_GraphTitle%%</b>
									</center>
									<div id="flashcontent1" style="width: 100%; clear: both;">
									</div>
									%%GLOBAL_ArticlePerUserDisplay%%
								</td>							
							</tr>
						</table>
					</div>
				</div>

				<div id="div2" style="display: none">
					<p>%%LNG_StatsAuthorPopInfo%%</p>

					<div id="REMOTE_MostPopularAuthorsFull"></div>

					<script>
						REMOTE_admin_table(
							'REMOTE_MostPopularAuthorsFull',
							'remote/remote_admin_table.php',
							'MostPopularAuthorsFull',
							'd',
							'score',
							1
						);
					</script>
				</div>

				<div id="div3" style="display: none">
					<p>%%LNG_StatsUserTopCommentersInfo%%</p>

					<div id="REMOTE_TopCommenters"></div>

					<script>
						REMOTE_admin_table(
							'REMOTE_TopCommenters',
							'remote/remote_admin_table.php',
							'TopCommenters',
							'd',
							'comment_count',
							1
						);
					</script>
				</div>
			</td>
		</tr>
	</table>
</form>

<script>

	$(document).ready(function() {

		// Which date range is selected?
		var current_date = '%%GLOBAL_CurrentDate%%';
		var Calendar = document.getElementById('Calendar');

		for(i = 0; i < Calendar.options.length; i++) {
			if(Calendar.options[i].value == current_date) {
				Calendar.options[i].selected = true;
				break;
			}
		}

		// Is it custom? If so, show the custom date ranges
		if(current_date == 'Custom') {
			doCustomDate(document.getElementById('Calendar'), 1);
		}
	});

	ShowTab(%%GLOBAL_CurrentTab%%);

</script>

</div>