// Load all the scripts in the script library
document.write("<script type=\"text/javascript\" src=\"../ScriptLibrary/FileUpload.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../../ScriptLibrary/FileUpload.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../ScriptLibrary/Browser.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../../ScriptLibrary/Browser.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../ScriptLibrary/Utility.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../../ScriptLibrary/Utility.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../ScriptLibrary/UserControls.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../../ScriptLibrary/UserControls.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../Shared/PageSet.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../Scripts/JScripts.js\"></script>");
document.write("<script type=\"text/javascript\" src=\"../Dialogs/RegionSelector.js\"></script>");



// Setup global variables
var UserBrowser;					// Declare browser object globally as it will be used on every page for browser detection/stylesheet loading

// Executes the load process for the user interface
function Load(location)
{
	// Set reference to new browser object
	UserBrowser = new Browser();

	// Set the location if not supplied
	if (location == null || location =="")
		location = "../";
		
	// Load the relevant style sheet based on the browser and platform
	switch (UserBrowser.Type)
	{
		case (BrowserTypes.InternetExplorer) :
		{
			// If macintosh, load the firefox stylesheet
			if (UserBrowser.Platform == Platforms.Macintosh)
			{
				document.write("<LINK href=\"" + location + "UserInterface/Stylesheets/Version2.Firefox.css\" type=\"text/css\" rel=\"stylesheet\">");
				document.write("<LINK href=\"" + location + location + "UserInterface/Stylesheets/Version2.Firefox.css\" type=\"text/css\" rel=\"stylesheet\">");
				break;			
			}
			// Otherwise load the internet explorer stylesheet
			else
			{
				document.write("<LINK href=\"" + location + "UserInterface/Stylesheets/Version2.InternetExplorer.css\" type=\"text/css\" rel=\"stylesheet\">");
				document.write("<LINK href=\"" + location + location + "UserInterface/Stylesheets/Version2.InternetExplorer.css\" type=\"text/css\" rel=\"stylesheet\">");
				break;
			}
		}
		// Load the default style sheet
		default :
		{
			document.write("<LINK href=\"" + location + "UserInterface/Stylesheets/Version2.Firefox.css\" type=\"text/css\" rel=\"stylesheet\">");
			break;
		}
	}
}


