(function($) {
	$.fn.BluForm = function(settings) {
		var config = { placeholder: "", element: "input", className: "text" };
		var privates = {
			exit: function() { return false; }
		};
		if (settings && typeof(settings) == 'object' ) $.extend(config, settings);
		this.each(function() {
			var element = config.element; var className = config.className; var target = element+"."+className;
			if(!config.placeholder.length) { config.placeholder = jQuery(this).find(target).val(); }
			jQuery(this).find(target).attr("rel",config.placeholder);
			jQuery(this).find(target).focus( function() { if( jQuery(this).val() == jQuery(this).attr("rel") ) { jQuery(this).val(""); } });
			jQuery(this).find(target).blur( function() { if( !jQuery(this).val().length ) { jQuery(this).val(jQuery(this).attr("rel")); } });
		});
		return this;
	};
})(jQuery);

(function($) {
	$.fn.ImageSize = function(settings) {
		var config = { type: "square", width: "90", height: "90", overlay: "div" };
		var privates = {
			validTypes: new Array("none","square","width","height"),
			unitFind: /px$|em$|pt$|%$/,
			unitReplace: "",
			adjustedWidth: function(el,w,o) { 
				var r = el.children(o).css('borderRightWidth').replace(privates.unitFind,privates.unitReplace); 
				var l = el.children(o).css('borderLeftWidth').replace(privates.unitFind,privates.unitReplace); 
				return(parseInt(w)+(parseInt(r)+parseInt(l))/2); 
			},
			adjustedHeight: function(el,h,o) { 
				var t = el.children(o).css('borderTopWidth').replace(privates.unitFind,privates.unitReplace); 
				var b = el.children(o).css('borderBottomWidth').replace(privates.unitFind,privates.unitReplace); 
				return(parseInt(h)+(parseInt(t)+parseInt(b))/2); 
			}
		};
		if (settings && typeof(settings) == 'object' ) $.extend(config, settings);
		this.each(function() {
			switch(config.type.toLowerCase()) {
				case privates.validTypes[1]:
					jQuery(this).attr("style","width: "+privates.adjustedWidth(jQuery(this),config.width,config.overlay)+"px; height: "+privates.adjustedHeight(jQuery(this),config.height,config.overlay)+"px;");
					jQuery(this).find("a").attr("style","width: "+config.width+"px; height: "+config.height+"px;");
					break;
					
				case privates.validTypes[2]:
					break;
					
				case privates.validTypes[3]:
					break;
				
				case privates.validTypes[0]:
				default:
					break;
			}
		});
		return this;
	};
})(jQuery);
