/**
 * LaPrème Class
 *
 * @copyright LaPrème Nijmegen
 * @author Leon van der Veen
 * @param object Code
 * @param array Dependencies
 */
var lpClass = function(code, dep)
{
	// Dependencies?
	if (jQuery.isArray(dep))
	{
		for (key in dep)
		{
			if (!dep[key])
			{
				throw 'Dependencies not ok';
			}
		}
	}
	
	// Make class
	var class_ = function()
	{
		this.options = {};
		this.initialize.apply(this, arguments);
		return this;
	};
	
	// Set properties and functions
	var code_ = {
		/**
		 * Default options
		 *
		 * @var object
		 */
		'defaulltOptions': {},
		
		/**
		 * Default constructor
		 */
		'initialize': function() {},
		
		/**
		 * Set options
		 *
		 * @param object Options
		 * @return This
		 */
		'setOptions': function(options)
		{
			jQuery.extend(this.options, this.defaultOptions, options);
			return this;
		}
	};
	var code__ = {};
	jQuery.extend(true, code__, code_, code);
	class_.prototype = code__;
	return class_;
	
	/*
	// Default code
	var code_ = {
		/**
		 * Default options
		 *
		 * @var object
		 *\/
		'options': {},
		
		/**
		 * Default constructor
		 *\/
		'initialize': function() {},
		
		/**
		 * Set options
		 *
		 * @param object Options
		 * @return This
		 *\/
		'setOptions': function(options)
		{
			jQuery.extend(this.options, options);
			return this;
		}
	};
	$.extend(code_, code);
	
	// Return new class
	return function()
	{
		// Make instance
		var instance = {};
		for (key in code_)
		{
			instance[key] = code_[key];
		}
		
		// Call constructor
		instance.initialize.apply(instance, arguments);
		
		return instance;
	};*/
};

