/*

	# ------------------------------------------------------------------------------------------------- #
	#																				#
	# DocumentControl.class.js															#
	#																				#
	# MySpinalCord.com																	#
	# Copyright 2010 Thommy Morgan														#
	# All Rights Reserved																#
	#																				#
	# ------------------------------------------------------------------------------------------------- #
	
		
*/


/*
# ----------------------------------------------------------------------------- #
# BrowserType Univserability Macros								 	#
# ----------------------------------------------------------------------------- #*/


enumerate([
	'BrowserTypeUnknown', 		// 0;
	'BrowserTypeIE', 			// 1;
	'BrowserTypeOpera', 		// 2;
	'BrowserTypeSafari', 		// 3;
	'BrowserTypeFirefox',		// 4;
	'BrowserTypeChrome', 		// 5;
]);


/*
# ----------------------------------------------------------------------------- #
# Define DocumentControl Object									 	#
# ----------------------------------------------------------------------------- #*/

var DC = new Object();


DC.browserType = navigator.appVersion;
if(DC.browserType.contains("msie")) {
	DC.browserType = BrowserTypeIE;
} else
if(DC.browserType.contains("opera")) {
	DC.browserType = BrowserTypeOpera;
} else
if(DC.browserType.contains("safari")) {
	DC.browserType = BrowserTypeSafari;
} else
if(DC.browserType.contains("firefox")) {
	DC.browserType = BrowserTypeFirefox;	
}
if(DC.browserType.contains("Chrome")) {
	DC.browserType = BrowserTypeChrome;
}


/*
# ----------------------------------------------------------------------------- #
# DocumentControl class functions									 	#
# ----------------------------------------------------------------------------- #*/


DC.animCheck = function() {
	if(DC.anim == null) {
		DC.anim = new DC.Layer();
		DC.anim.setStyle("position", "absolute");
		DC.anim.setStyle("left", "0px");
		DC.anim.setStyle("top", "0px");
		DC.anim.setStyle("margin", "0px");
		DC.anim.setStyle("float", "left");
		DC.anim.setStyle("zIndex", "100");
		DC.anim.setID("animationLayer");
		document.body.insertBefore(DC.anim, document.body.firstChild);
	}
	return EXISTS;
}


DC.Object = function() {
	this.delegate = null;
}


DC.Object.prototype.setDelegate = function(del) {
	this.delegate = del;
}


DC.Object.prototype.createNullDelegate = function() {
	this.delegate = {};	
}


DC.Object.prototype.clearDelegate = function() {
	this.delegate = null;	
}


DC.Object.prototype.checkDelegate = function() {
	return (this.delegate != null);
}


DC.Object.prototype.checkAndCreate = function() {
	if(!this.checkDelegate()) this.delegate = {};
}
