Globals.Location  = new Object();
Globals.Location.ASHX  = new Object();
Globals.FirstTime = true; 
Globals.MainMenu = null;
Globals.BaseClientIncludePath = "./scripts/custom/";
Globals.Location.ASHX.Security 	= "ServerData/SecurityHandler.ashx";
Globals.Location.ASHX.File 		= "ServerData/FileHandler.ashx";
Globals.Location.ASHX.User 		= "ServerData/UserHandler.ashx";
Globals.Location.ASHX.Content	= "ServerData/ContentEditor.ashx";
Globals.Location.ASHX.PayPal	= "ServerData/PayPalHandler.ashx";
Globals.Location.ASHX.FormEmail	= "ServerData/SendEmailFromForm.ashx";
Globals.Location.ASHX.NewsLetter = "ServerData/NewsLetter.ashx";

Globals.GoogleAnalyticsID = "UA-4057695-1";

Globals.AppLayout = new Layout("main","scripts/custom/layout/template.html", true);
Globals.AppLayout.SetupCSS = function()
{
	Globals.AddCSS("scripts/custom/layout/css/Global.css");     	
	Globals.AddCSS("scripts/custom/layout/css/rte.css"); 				      
	Globals.AddCSS("scripts/custom/layout/css/UIControls.css"); 				
	Globals.AddCSS("scripts/custom/layout/css/grid.css"); 						
	Globals.AddCSS("scripts/custom/layout/css/TabMenu.css"); 					
	Globals.AddCSS("scripts/custom/layout/css/SiteStyles.css"); 					
	
    if(Globals.IsPreIE7())
    {
		Globals.AddCSS("scripts/custom/layout/css/IE6Below.css");	
    }
    else
    {
		Globals.AddCSS("scripts/custom/layout/css/NonIE6Below.css");	
    }					
}; 

Globals.SetupMainMenu = function()
{
	var index = -1; 
	if(Globals.MainMenu != null)
	{
    	index = Globals.MainMenu.SelectedIndex; 
	}
	
	Globals.MainMenu = new UIControls.TabMenu("MainToolbarId","ToolBar");
	Globals.MainMenu.AddItem("Home","GoToPage(Page.HomeBase);");
	Globals.MainMenu.AddItem("Customer Spotlight","GoToPage(Page.ContentPage,\"CustomerSpotlight\");Globals.MainMenu.SelectMenuItem(Page.CustomerSpotlight, true);\n");
	Globals.MainMenu.AddItem("Industry Trends","GoToPage(Page.ContentPage,\"IndustryTrends\");Globals.MainMenu.SelectMenuItem(Page.IndustryTrends, true);\n");
	Globals.MainMenu.AddItem("Ask an Expert","GoToPage(Page.ContentPage,\"AskAnExpert\");Globals.MainMenu.SelectMenuItem(Page.AskAnExpert, true);\n");
	Globals.MainMenu.AddItem("Tip of the Month","GoToPage(Page.ContentPage,\"TipOfTheMonth\");Globals.MainMenu.SelectMenuItem(Page.TipOfTheMonth, true);\n");
	Globals.MainMenu.AddItem("Lighter Side","GoToPage(Page.ContentPage,\"LighterSide\");Globals.MainMenu.SelectMenuItem(Page.LighterSide, true);\n");
	Globals.MainMenu.AddItem("Subscribe","GoToPage(Page.Subscribe);Globals.MainMenu.SelectMenuItem(Page.Subscribe, true);\n");
	Globals.MainMenu.AddItem("Forward","GoToPage(Page.Forward);Globals.MainMenu.SelectMenuItem(Page.Forward, true);\n");
	
	/*
	if(UserRoles.HasRights(UserRoles.ADMIN))
	{
		//Globals.MainMenu.AddItem("Site Administration","GoToPage(Page.ContentPage,\"Admin\");\nAdminPage.Load();");
	}
	*/
	
	Globals.MainMenu.Render(index);	

};

Globals.OneTimeInit = function()
{
	Layouts.AddURL("HomeBase", Globals.BaseClientIncludePath + "layout/templates/home_base.html", "HomeContent"); 	
	Layouts.AddDataBridgeURL("ArticleContent", Globals.BaseClientIncludePath + "layout/templates/databridge/ArticleContent.html"); 	
	Layouts.AddDataBridgeURL("HomeContent", Globals.BaseClientIncludePath + "layout/templates/databridge/HomeContent.html"); 
		
	//Also loads layouts associated with pages.
	Layouts.LoadAllAsync(); 
	Globals.GetURLParameters(); //Setup URL parameters the first time.	
};


//Any code that needs to be initialized after the layout is loaded
Globals.InitConfig = function()
{ 
	Globals.SetupMainMenu(); 
	
	if(Globals.FirstTime)
	{
		Globals.FirstTime = false; 
		Globals.OneTimeInit(); 
	}	
};

UserRoles.ADMIN 			= 0; 
UserRoles.VIEW_ALL_USERS 	= 1; 
UserRoles.MODIFY_ALL_USERS 	= 2; 
UserRoles.VIEW_ALL_SUBS 	= 3; 
UserRoles.MODIFY_ALL_SUBS 	= 4; 
UserRoles.EDIT_PAGE_CONTENT	= 5; 