function Tabs(element) {
	var self = this;
	this.root = element;
	
	this.construct = function() {
		self.init_tabs();
		self.bind_tabs();
	}
	
	this.init_tabs = function() {
		//Hide Content
		self.root.children('li').children('a').each(function(i) {
			if (i == 0) {
				var id = $(this).attr('href');
				$(id).addClass("active");
			} else {
				var id = $(this).attr('href');
				$(id).addClass("hidden");
			}
		});
	}
	
	this.bind_tabs = function() {
		self.root.children('li').children('a').bind('click', function(e) {
			e.preventDefault();
			self.set_container($(this));
			self.set_tab($(this));
		});
	}
	
	this.set_container = function(element) {
		var current = self.root.siblings(".active");
		current.removeClass("active");
		current.addClass("hidden");
		
		var id = element.attr('href');
		$(id).removeClass("hidden");
		$(id).addClass("active");
	}
	
	this.set_tab = function(element) {
		self.root.children('li').removeClass('active');
		element.parent('li').addClass('active');
	}
	
	self.construct();
}
