// asp code Generated by Basic Processor
// Original Page Name: C:\gmTestBed\FMStocks\src\FMSWeb\ASP\t_head.asp

namespace FMSWeb
{
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using VBNET=Microsoft.VisualBasic;
using gmRTL.Core;

public class _t_head
{
   public string g_AccountID = "";
   public string g_strError = "";
   public bool g_bUseMenu = false;
   public void Author_Markup()
   {
      if (!HttpContext.Current.Response.IsClientConnected)
      {
         HttpContext.Current.Response.End();
      }
      g_bUseMenu = true;
      VerifyLogin();
      HttpContext.Current.Response.Write("<script src='jscripts.js' language='JavaScript'></script>" + "\n");
      HttpContext.Current.Response.Write("<meta http-equiv='Expires' content='Tue, 04 Dec 1993 21:29:02 GMT'>" + "\n");
      HttpContext.Current.Response.Write("<link rel='stylesheet' href='styles.css'>" + "\n");
   }
   //  Helper functions
   public object VerifyLogin()
   {
      if (!HttpContext.Current.Response.IsClientConnected)
      {
         HttpContext.Current.Response.End();
      }
      // check to see if they are logged in or are at the login page
      if ((HttpContext.Current.Request.Cookies["Account"] != null) && !String.IsNullOrEmpty(HttpContext.Current.Request.Cookies["Account"].Value))
      {
         g_AccountID = HttpContext.Current.Request.Cookies["Account"].Value;
      }
      else
      {
         g_AccountID = "0";
      }
      if (g_AccountID.ToInt() == 0)
      {
         string strASP = "";     //  Current ASP page
         strASP = HttpContext.Current.Request.ServerVariables["Script_Name"].LCase();
         //  Allow access to default.asp or any page that starts with an underscore
         //  without requiring a login. Don't mess with this code.
         if (strASP.InStr("default.aspx",1,StringComparison.CurrentCulture) == 0 && strASP.InStr("/_",1,StringComparison.CurrentCulture) == 0)
         {
            HttpContext.Current.Response.Redirect("logout.aspx");
            HttpContext.Current.Response.End();
         }
      }
      return null;
   }
   public object BuildErrorMessage()
   {
      g_strError = g_strError + "<p><b>Actual Error Message:<br></b>" + gmRTL.Core.GlobalException.Instance.Description + "</p>";
      g_strError = g_strError + "<p><b>Source/Call Stack:<br></b>" + gmRTL.Core.GlobalException.Instance.Source + "</p>";
      g_strError = g_strError + "<br><br><br>";
      return null;
   }
   public object rw(string s)
   {
      HttpContext.Current.Response.Write(s);
      return null;
   }
   public object rwbr(string s)
   {
      HttpContext.Current.Response.Write(s + "<br>");
      return null;
   }
   public object rwp(string s)
   {
      HttpContext.Current.Response.Write("<p>" + s + "</p>");
      return null;
   }
   public object nbsp(int n)
   {
      int i = 0;
      string str = "";
      for(i = 0; i <= n; i += 1)
      {
         str = str + "&nbsp;";
      }
      HttpContext.Current.Response.Write(str);
      return null;
   }
}
}
