// Javascript pseudo-enums for NetCampus

if (typeof(_fileVersions) == 'undefined')
	eval('var _fileVersions = new Array()');
_fileVersions.push('Enums 6.6.0.0');

// The pseudo-enums below matches the enums in Components\CommonDataObject\Enum.cs
var ConceptType = new Object();
ConceptType.Undefined = -1;
ConceptType.Forum = 1;
ConceptType.WebCourse = 7;
ConceptType.WebTest = 8;
ConceptType.WebSurvey = 9;
ConceptType.Document = 12;
ConceptType.Hyperlink = 22;
ConceptType.SecondaryForum = 23;
ConceptType.Folder = 25;
ConceptType.Seminar = 26;
ConceptType.Occasion = 27;
ConceptType.SeminarWithoutOccasion = 28;
ConceptType.Block = 105;
ConceptType.Session = 106;
ConceptType.Room = 118;
ConceptType.CourseMaterialFolder = 119;
ConceptType.CourseMaterialFolderTeacherOnly = 120;
ConceptType.CourseMaterialFolderMyBriefcase = 121;
ConceptType.CourseMaterialFolderShared = 122;

var CourseProgress = new Object();
CourseProgress.Undefined = -1;
CourseProgress.Finished = 201;
CourseProgress.Failed = 202;
CourseProgress.Started = 203;
CourseProgress.NotStarted = 205;
	
// Keyboard ascii codes
var KeyCode = new Object();
KeyCode.Enter = 13;

// Predefined dialog sizes
var DialogSize = new Object();
DialogSize.Tiny = 1;
DialogSize.Small = 2;
DialogSize.SmallTall = 3;
DialogSize.SmallWide = 4;
DialogSize.Medium = 5;
DialogSize.MediumTall = 6;
DialogSize.MediumWide = 7;
DialogSize.Large = 8;
DialogSize.LargeTall = 9;
DialogSize.LargeWide = 10;
DialogSize.Custom = 9999;

// Dialog buttons
var DialogButton = new Object();
DialogButton.Ok = 1;
DialogButton.Cancel = 2;
DialogButton.Yes = 4;
DialogButton.No = 8;
DialogButton.Retry = 16;
DialogButton.Ignore = 32;
DialogButton.OkCancel = DialogButton.Ok | DialogButton.Cancel;
DialogButton.YesNo = DialogButton.Yes | DialogButton.No;
DialogButton.RetryCancelIgnore = DialogButton.Retry | DialogButton.Cancel | DialogButton.Ignore;

// Dialog origins
var DialogOrigin = new Object();
DialogOrigin.PageDialog = 1;

// RadWindow types
var WindowType = new Object();
WindowType.FixedDialog = 1;
WindowType.DynamicDialog = 2;
WindowType.Alert = 3;
WindowType.Confirmation = 4;

// Window dock enum
var Dock = new Object();
Dock.Bottom = 1;
Dock.Right = 2;
Dock.Left = 4;
Dock.Top = 8;
Dock.Center = 16;

// Enum helper methods

function GetDialogSize(dialogSize, customWidth, customHeight)
{
	var size = null;
	var defaultWidth = 500;
	var defaultHeight = 500;

	switch(dialogSize)
	{
		case DialogSize.Tiny:
			size = {Width:310, Height:144}; 
			break;

		case DialogSize.Small:
			size = {Width:360, Height:240};
			break;

		case DialogSize.SmallTall:
			size = {Width:360, Height:240};
			break;

		case DialogSize.SmallWide:
			size = {Width:600, Height:240};
			break;

		case DialogSize.Medium:
			size = {Width:500, Height:400};
			break;

		case DialogSize.MediumTall:
			size = {Width:500, Height:590};
			break;

		case DialogSize.MediumWide:
		    size = { Width: 600, Height: 400 };
		    break;

		case DialogSize.MediumWideTall:
		    size = { Width: 600, Height: 590 };
		    break;			

		case DialogSize.Large:
			size = {Width:800, Height:590};
			break;
			
		case DialogSize.LargeTall:
			size = {Width:800, Height:620};
			break;			

		case DialogSize.LargeWide:
			size = {Width:900, Height:590};
			break;

		case DialogSize.Custom:
			size = 
				{
					Width:(customWidth != null ? customWidth : defaultWidth), 
					Height:(customHeight != null ? customHeight : defaultHeight)
				};
			break;
			
		/*default:
			alert('Unknown DialogSize: ' + dialogSize + ' (see Script/Enums.js)\n\nUsing default size');
			size = {Width:defaultWidth, Height:defaultHeight};
			break;*/
	}
	
	return size;
}

function GetWindowBaseName(windowType)
{
	var windowBaseName;

	switch(windowType)
	{
		case WindowType.FixedDialog:
			windowBaseName = 'FixedDialogWindow';
			break;

		case WindowType.DynamicDialog:
			windowBaseName = 'DynamicDialogWindow';
			break;

		case WindowType.Alert:
			windowBaseName = 'AlertWindow';
			break;

		case WindowType.Confirmation:
			windowBaseName = 'ConfirmationWindow';
			break;

		default:
			throw 'Unknown windowType: ' + windowType;
	}
	
	return windowBaseName;
}

