<%@ Page language="c#" Codebehind="upTemplate.aspx.cs" AutoEventWireup="false" Inherits="Mediachase.UI.Web.Modules.upTemplate" %>
<%@ register TagPrefix="mc" namespace="Mediachase.UI.Web.Modules" Assembly="Mediachase.UI.Web" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 

<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name=vs_defaultClientScript content="JavaScript">
    <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
    <script src="../Scripts/browser.js"></script>
	<script src="../Scripts/buttons.js"></script>	
	<link href="../layouts/styles/windows.css" type="text/css" rel="stylesheet" >
	<link href='<%=Mediachase.UI.Web.Util.CommonHelper.GetAbsolutePath("/Themes/" + Mediachase.UI.Web.Util.CommonHelper.GetTheme() + "/theme.css")%>' rel="stylesheet">
	<script>
		function framePrint()
		{
			parent.right.focus();
			parent.right.print();
		}
		if ((browseris.mac) && !browseris.ie5up)
		{
			var macstyle = "../layouts/styles/mac.css";
			document.write("<link rel='stylesheet' Type='text/css' href='" + macstyle + "'>");
		}
	
		Is24Hours = false;
		TimeOffset = 0;
	
		function showTheHours(theHour) 
		{
			if (Is24Hours || (theHour > 0 && theHour < 13)) {
				return (theHour)
			}
			if (theHour == 0) {
				return (12)
			}
			return (theHour-12) 
		}
		
		function showZeroFilled(inValue) {
			if (inValue > 9) {
				return ":" + inValue
			}
			return ":0" + inValue
		}
		
		function showAmPm(theHour) {
			if (Is24Hours) {
				return ("")
			}
		
			if (theHour < 12) {
				return (" AM")
			}
			return (" PM")
		}
		
		function showTheTime() {
			now = new Date();			
			cHours = now.getUTCHours();
			cMinutes = now.getUTCMinutes();
			
			MinutesOffset = cHours*60 + cMinutes - TimeOffset;
			Hours = Math.floor(MinutesOffset / 60);
			Minutes = MinutesOffset - Hours * 60;
			
			if (Hours > 23) Hours = Hours - 24;
			if (Hours < 0 ) Hours = 24 + Hours;
			
			spn = document.getElementById('timeSpan');
			
			spn.innerHTML = showTheHours(Hours) + showZeroFilled(Minutes) + showAmPm(Hours);
			setTimeout("showTheTime()",3000);
		}
		
		function OpenWindow(query,w,h,scroll)
		{
			var l = (screen.width - w) / 2;
			var t = (screen.height - h) / 2;
			
			winprops = 'resizable=1, height='+h+',width='+w+',top='+t+',left='+l;
			if (scroll) winprops+=',scrollbars=1';
			var f = window.open(query, "_blank", winprops);
		}
		function NewElement(str)
		{
			window.top.right.location.href=str;
		}
		function GlobalSearch()
		{
			var obj = document.getElementById('txtSearch');
			if(obj!=null && obj.value.length>0)
			{
				window.document.Form1.target="right";
				window.document.Form1.submit();
				obj.value="";
				window.document.Form1.target="";
			}
		}
		function ToHelpPage()
		{
			window.top.right.location.href = "../Home/help.aspx";
		}
		function disableEnterKey(e) 
		{ 
			var _key = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
			try{
				if (_key == 13)
				{
					return false;
				}
				else
					return true;
			}
			catch (ex) {
				return true;
			}
		}
		function MoveFrame()
		{
			var req = window.XMLHttpRequest? 
				new XMLHttpRequest() : 
				new ActiveXObject("Microsoft.XMLHTTP");
			req.onreadystatechange = function() 
			{
				if (req.readyState != 4 ) return ;
				if (req.readyState == 4)
				{
					if (req.status == 200)
					{
						if(req.responseText.toString()=='1')
							window.top.HideLeft();
						else
							window.top.ShowLeft();
					}
					else
						alert("There was a problem retrieving the XML data:\n" + req.statusText);
				}
			}
			var dt = new Date();
			var sID = dt.getMinutes() + "_" + dt.getSeconds() + "_" + dt.getMilliseconds();
			req.open("GET", "XmlForTreeView.aspx?MoveFrame=1&sID="+sID, true);
			req.send(null);
		}

	function ExpandCollapse()
	{
		var img = document.getElementById("imgExpandCollapse");
		var fset = top.document.getElementById("fs1");
		if (fset == null)
			return;
		if (fset.rows == "89,*")
		{
			fset.rows = "25,*";
			img.src = "../layouts/images/scrolldown_hover_white.gif";
		}
		else
		{
			fset.rows = "89,*";
			img.src = "../layouts/images/scrollup_hover_white.gif";
		}
	}
	
	function ExpandCollapse2()
	{
		var img = document.getElementById("imgExpandCollapse2");
		var span = document.getElementById("HiddenItems");
		if (span == null)
			return;
		if (span.style.display == "none")
		{
			span.style.display = "inline";
			img.src = "../layouts/images/scrollright_hover_white.gif";
		}
		else
		{
			span.style.display = "none";
			img.src = "../layouts/images/scrollleft_hover_white.gif";
		}
	}

	</SCRIPT>
	<style type=text/css>
		.imgClass2{border:0px; width:20px; height:20px; align:absmiddle; }
		.relClass{LEFT: 0px; POSITION: relative; TOP: 0px}
	</style>
  </head>
  <body MS_POSITIONING="FlowLayout">
	<form id="Form1" method="post" runat="server">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-bottom:2px solid #FFD275;>
		<tr id="topTR">
			<td valign="top">
				<table cellspacing="0" cellpadding="0" width="100%" border="0" class="ibn-bannerframe">
					<tr>
						<td>
							<table width="100%" cellSpacing="0" cellPadding="3">
								<tr>
									<td valign="center" nowrap width="22" style="padding-left:2">
										<img src="../layouts/images/ibn_logo.gif" width="16" height="16" align="baseline" hspace="3"></td>
									<td class="ibn-banner" valign="center" nowrap width="99%" style="color:#FFFFFF">
										<a href="../Workspace/default.aspx?Btab=Workspace" target="right"><asp:label id="lblSiteName" runat="server" Font-Bold="True"></asp:label></a>
									</td>
								</tr>
							</table>
							
						</td>
						<td style="padding-left:5px" class="text" align="right">
							<span class="relClass" style="display:none">
								<a href="javascript:MoveFrame()">
									<img id="imgMoveFrame" runat=server class="imgClass" title='Move Frame' src="../Layouts/Images/BLANK.GIF"/></a>&nbsp;
							</span>
							
							<a href="javascript:ExpandCollapse2()" title="<%=LocRM.GetString("HideShow")%>"><img src="../layouts/images/scrollleft_hover_white.gif" border="0" id="imgExpandCollapse2" align="bottom" style="margin-left:5px"></a>
							<span id="HiddenItems" style="display:none">
								<span class="relClass" runat="server" id="spanProject">&nbsp;
									<a href="javascript:NewElement('../Projects/ProjectEdit.aspx')"><img class="imgClass2" title='<%=LocRM.GetString("tNewPrj")%>' src="../Layouts/Images/icons/projectnew.gif"/></a>
								</span>
								<span class="relClass">&nbsp;
									<a id="listLink" runat=server href="javascript:NewElement('../Lists/ListEdit.aspx')">
										<img class="imgClass2" title='<%=LocRM.GetString("tNewList")%>' src="../Layouts/Images/icons/listsnew.gif"/></a>
								</span>
								<span class="relClass" id="spanUser" runat=server>&nbsp;
									<a href="javascript:NewElement('../Directory/MultipleUserEdit.aspx')"><img class="imgClass2" title='<%=LocRM.GetString("NewUserWizard")%>' src="../Layouts/Images/icons/usernewgif.gif"/></a>
								</span>
								<span class="relClass">&nbsp;
									<a href="javascript:NewElement('../TimeTracking/AddTimesheet.aspx')">
										<img class="imgClass2" title='<%=LocRM.GetString("tNewTimeSheet")%>' src="../Layouts/Images/icons/timesheetnew.gif"/></a>
								</span>
								<span class="relClass" id=spanRep runat=server>&nbsp;
									<a href="javascript:OpenWindow('../Reports/XMLReport.aspx?Mode=Both',750,466,true);">
										<img class="imgClass2" title='<%=LocRM.GetString("tNewReport")%>' src="../Layouts/Images/icons/reportnew2.gif"/></a>
								</span>
								<span class="relClass">&nbsp;
									<a href="javascript:NewElement('../Documents/DocumentEdit.aspx')">
										<img class="imgClass2" title='<%=LocRM.GetString("tNewDocument")%>' src="../Layouts/Images/icons/documentnew.gif"/></a>
								</span>
							</span>

							<span class="relClass">&nbsp;
								<a href="javascript:NewElement('../Incidents/IncidentEdit.aspx')">
									<img class="imgClass2" title='<%=LocRM.GetString("NewIssueWizard")%>' src="../Layouts/Images/icons/incidentnew.gif"/></a>
							</span>
							<span class="relClass">&nbsp;
								<a href="javascript:NewElement('../ToDo/ToDoEdit.aspx')">
									<img class="imgClass2" title='<%=LocRM.GetString("NewToDoWizard")%>' src="../Layouts/Images/icons/tasknew.gif"/></a>
							</span>
							<span class="relClass">&nbsp;
								<a href="javascript:NewElement('../Events/EventEdit.aspx')">
									<img class="imgClass2" title='<%=LocRM.GetString("NewEventWizard")%>' src="../Layouts/Images/icons/eventnew.gif"/></a>
							</span>
							<span class="relClass">&nbsp;
								<a href="javascript:OpenWindow('../FileStorage/FileUpload.aspx?ContainerName=FileLibrary', 470, 450, false);">
									<img class="imgClass2" title='<%=LocRM.GetString("NewFileWizard")%>' src="../Layouts/Images/icons/commonnew.gif"/></a>
							</span>
							
							<span class="relClass" style="padding-left:30">&nbsp;
								<a href="javascript:framePrint()"><img class="imgClass2" src="../layouts/images/print.gif" border="0" id="btnPrint" title="<%=LocRM.GetString("Print") %>"/></a>
							</span>
							<span class="relClass">&nbsp;
								<a href="javascript:ToHelpPage();"><img class="imgClass2" src="../layouts/images/help.gif" border="0" id="btnHelp" title="<%=LocRM.GetString("Help")%>" /></a>
							</span>
							<span class="relClass">&nbsp;
								<a href="../Logoff.aspx"><img class="imgClass2" src="../layouts/images/exit.gif" border="0" title="<%=LocRM.GetString("tLogOut")%>"/></a>
							</span>
						</td>
						<td width="25px" align="center" valign="center">
							<a href="javascript:ExpandCollapse()" title="<%=LocRM.GetString("HideShow")%>"><img src="../layouts/images/scrollup_hover_white.gif" border="0" id="imgExpandCollapse" align="bottom" style="margin-left:5px"></a>
						</td>
<!--						<td align=right width="230px">
							<table border="0" cellpadding="0" cellspacing="0" style="padding-right:5px">
								<tr>
									<td class="text" style="color:#f3f3f3;padding-left:7px;">
										<%=LocRM.GetString("Search") %>:
										<input onkeypress="return disableEnterKey(event);" type=text id="txtSearch" class="text" runat=server style="width:90px;"/>
										<a href='javascript:GlobalSearch();'><img Width="16" Height="16" border="0" src="../layouts/images/search.gif" Align="AbsMiddle"/></a>
									</td>
								</tr>
							</table>
						</td>
-->
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table style="BACKGROUND-IMAGE: url(../Layouts/images/up_bg.gif); BACKGROUND-REPEAT: repeat-y; BACKGROUND-COLOR: #B4CAF4" cellspacing="0" cellpadding="0" width="100%" border="0" >
					<tr>
						<td class="ibn-titleareaframe" colspan="3">
							<table cellspacing="0" cellpadding="0" width="100%" border="0">
								<tr>
									<td style="PADDING-BOTTOM: 0px">
										<table style="PADDING-LEFT: 2px; PADDING-TOP: 0px;" cellspacing="0" cellpadding="0" border="0" width="100%">
											<tr>
												<td style="PADDING-TOP: 4px" nowrap align="middle" width="132" height="50">
													<img src="../Common/CompanyLogo.aspx" width="100" height="50">
												</td>
												<td width="12">
													<img height="1" src="../layouts/images/blank.gif" width="7">
												</td>
												<td style="PADDING-TOP: 2px" nowrap>
													<table cellspacing="0" cellpadding="0" border="0">
														<tr>
															<td class="ibn-pagetitle" id="onetidPageTitle"></td>
														</tr>
													</table>
												</td>
												<td valign="bottom" align="right" style="PADDING-RIGHT:5px; PADDING-BOTTOM:3px"><br>
													<asp:label runat="server" id="lblUser" cssclass="ibn-propertysheet"></asp:label><br>
													<span id="timeSpan" class="ibn-propertysheet"></span>
													<asp:Label ID="lblTime" Runat=server cssclass="ibn-propertysheet"></asp:Label>
												</td>
											</tr>
										</table>
										<table height="4px" cellspacing="0" cellpadding="0" width="100%" border="0">
											<tr>
												<td height="3px"><img height="1px" src="../layouts/images/blank.gif" width="1px"></td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	<input type=hidden id="TimeOffSet" runat=server name="TimeOffSet" value="0"/>
	<input type=hidden id="Is24Hours" runat=server name="Is24Hours" value="0"/>
	<script>
		<!--
			TimeOffset = document.getElementById('TimeOffSet').value;
			if(document.getElementById('Is24Hours').value=='0')
				Is24Hours = false;
			else
				Is24Hours = true;
			showTheTime();
		//-->
		</script></form>
  </body>
</html>
