(function($)
{
	$.makeRoundBox = {defaults:{ theme: "pink" }}
	$.fn.extend({
		makeRoundBox: function(config){
			var theme = (config.theme) ? config.theme : $.makeRoundBox.defaults.theme;
			return this.each(function() {
				var theBox = $(this);
				if(theBox.hasClass("blue") | theBox.hasClass("orange") | theBox.hasClass("light-pink") | theBox.hasClass("purple") | theBox.hasClass("bright-blue")) theBox.addClass(theme);
				theBox
					.addClass("roundbox")
					.addClass(theme)
					.wrapInner("<div class='content'>")
					.prepend("<div class='header'>")
					.append("<div class='footer'>").find("div.header")
					.append("<div class='west'>").find("div.west")
					.append("<div class='east'>").find("div.east")
					.html(theBox.attr("title")).wrapInner("<h3>").wrapInner("<div>")
					.parent().parent().parent().find("div.content")
					.wrapInner("<div class='content-wrapper'>").wrapInner("<div class='east'>").wrapInner("<div class='west'>")
					.parent().find("div.footer").append("<div>")
					.wrapInner("<div class='east'>").wrapInner("<div class='west'>")
					;
				theBox.removeAttr("rel").removeAttr("title");
			});
		}
	});

	$.makeHomeBox = {defaults:{ theme: "pink" }}
	$.fn.extend({
		makeHomeBox: function(config){
			var theme = (config.theme) ? config.theme : $.makeRoundBox.defaults.theme;
			return this.each(function() {
				var theBox = $(this);
				if(theBox.hasClass("blue") | theBox.hasClass("orange") | theBox.hasClass("light-pink") | theBox.hasClass("purple") | theBox.hasClass("bright-blue")) theBox.addClass(theme);
				theBox
					.addClass("homebox")
					.addClass(theme)
					.wrapInner("<div class='content'>")
					.prepend("<div class='header'>")
					.append("<div class='footer'>").find("div.header")
					.append("<div class='west'>").find("div.west")
					.append("<div class='east'>").find("div.east")
					.html(theBox.attr("title")).wrapInner("<h2>").wrapInner("<div>")
					.parent().parent().parent().find("div.content")
					.wrapInner("<div class='content-wrapper'>").wrapInner("<div class='east'>").wrapInner("<div class='west'>")
					.parent().find("div.footer").append("<div>")
					.wrapInner("<div class='east'>").wrapInner("<div class='west'>")
					;
				theBox.removeAttr("rel").removeAttr("title");
			});
		}
	});

})(jQuery);
