 /* Declare a namespace for the site */
window.Capstone = window.Capstone || {};
Capstone.Commercial = Capstone.Commercial || {};

/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function() {

	/**
		Internal Shorthand reference
	*/
	var $self = this,

		/**
			Primitives
		*/
		TRUE = true,
		FALSE = false,
		NULL = null,
		UNDEFINED,

		/**
			An internal flag to ensure we don't initialize this object more than once.
		*/
		initialized = FALSE;

	/**
	 * The initialize method
	 * Initializes other common scripts and sets up some global constants.
	 */
	$self.initialize = function(){

		if (initialized) {
			return;
		}

		$self.externalLink.initialize();

		initialized = TRUE;

	};

	$self.externalLink = function() {

		/**
			An internal flag to ensure we don't initialize this object more than once.
		*/

			var $scope,
				$ext,

			vars = {
				scopeID			:	"body",
				extClass		:	"external"
			},

			setup = function() {

				$ext.attr("target", "_blank");

			};

		return {

			initialize : function(){

				$scope			= $(vars.scopeID);

				if ($scope.length === 0) {
					return;
				}

				$ext	= $scope.find("." + vars.extClass);

				setup();

			}

		};

	}();

	return $self;

}).call(Capstone.Commercial);

/**
	Fire up the global initialization.
*/
$(document).ready(Capstone.Commercial.initialize);

