<%@ Register TagPrefix="Portal" TagName="Title" Src="~/DesktopModuleTitle.ascx"%>
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="Survey.ascx.cs" Inherits="Xpdt.Portal.Survey" %>
<%@ Register TagPrefix="Portal" TagName="Divider" Src="~/ModuleDivider.ascx"%>
<TABLE width="100%">
	<TBODY>
		<TR>
			<TD class="ModuleFrame">
				<portal:title id="Title1" runat="server" EditUrl="~/DesktopModules/EditSurvey.aspx" EditText="Edit Survey"></portal:title>
				<%if(!ShowResults) { %>
				<asp:datalist id="myDataList" runat="server" ShowHeader="false" ShowFooter="false" Width="100%"
					CellPadding="4">
					<ItemTemplate>
						<span class="ItemTitle">
							<asp:Label Text='<%# GenerateQuestion(DataBinder.Eval(Container.DataItem,"Question")) %>' runat="server" ID="Label1"/>
						</span>
						<br>
						<span class="<%# GetNormalStyle( ) %>">
							<%# GenerateOptions(DataBinder.Eval(Container.DataItem,"QuestionID")) %>
						</span>
					</ItemTemplate>
				</asp:datalist>
				<%}else{%>
				<table cellSpacing="0" cellPadding="4" border="0" width="100%">
					<TBODY>
						<tr vAlign="top">
							<td align="left">
								<asp:datalist id="MyResultDataList" runat="server" Width="100%" CellPadding="2" BorderWidth="0px"
									BorderColor="Black" GridLines="Horizontal" RepeatDirection="Horizontal" RepeatLayout="Flow"
									EnableViewState="False">
									<HeaderTemplate>
										<table class="<%# GetNormalStyle( ) %>" cellpadding="1" cellspacing="0">
									</HeaderTemplate>
									<FooterTemplate>
										<%# ShowFinalQuestionFooter() %>
				</table>
				</FooterTemplate>
				<ItemTemplate>
					<%//# ShowSurveyTitle(DataBinder.Eval(Container.DataItem,"SurveyName")) %>
					<%# ShowQuestionHeaderFooter(DataBinder.Eval(Container.DataItem,"Question"), DataBinder.Eval(Container.DataItem,"TotalVotes")) %>
					<tr>
						<td align="left" class="SubTabRow" nowrap colspan="3">
							<%# DataBinder.Eval(Container.DataItem,"OptionText") %>
						</td>
						<td nowrap align="right" class="SubTabRow">
							<b>
								<%# DataBinder.Eval(Container.DataItem,"OptionPercent") %>
								%</b>
						</td>
					</tr>
					<tr height="10px">
						<td colspan="4" nowrap align="left" height="10px">
							<img border="0" height="9px" width="2px" src="images/graphBarStart.gif"><img border=0 height="9px" width='<%# DataBinder.Eval(Container.DataItem,"OptionPercent")%>' src="images/graphBar.gif" ><img border="0" height="9px" width="2px" src="images/graphBarEnd.gif">
						</td>
					</tr>
				</ItemTemplate>
				</asp:datalist></TD>
		</TR>
	</TBODY>
</TABLE>
<%}%>
<asp:linkbutton class="CommandButton" id="submitButton" runat="server" CausesValidation="False"
	Visible="False" BorderStyle="none" Text="Submit Survey" CommandArgument="Submit">Submit Survey</asp:linkbutton>&nbsp;
<asp:hyperlink class="CommandButton" id="viewResults" runat="server" Visible="False" BorderStyle="none"
	Target="_new">View Results</asp:hyperlink><br>
<PORTAL:DIVIDER id="Divider1" runat="server"></PORTAL:DIVIDER></TD></TR></TBODY></TABLE>
