/* --------------------------------------------------
	LOAD FUNCTION
-------------------------------------------------- */
(function($){
$(function(){
	$('#contents :text,#contents textarea').focusClass('focusInput');
});
})($jq['base']);

/*
 * jquery.formUtil
 * Copyright (c) 2008 Naoki Ueno
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * Date: 6/17/2008
 *
 * @id jQuery.fn.focusReflesh
 *
 * @return {jQuery} Returns the same jQuery object, for chaining.
 *
 * @example jQuery(':text').focusReflesh();
 *
 * @example jQuery(':text').focusReflesh('Please input a keyword', { color : '#555555', 'font-size' : '90%' });
 *
 * @example jQuery(':text').focusClass('focusClass');
 *
 */

(function($){
$.fn.extend({
	focusReflesh : function(str, css) {
		return this.each(function() {
			str = $.extend('', str);
			css = $.extend({}, css);
			var input = $(this);
			var availVal = input.val();
			if(str.length) {
				availVal = str;
				input.val(availVal);
			}
			input.css(css).focus(function(e) {
				if(this.value == availVal) { $(this).val('').removeAttr('style'); }
			}).blur(function(e) {
				if(!this.value) { $(this).css(css).val(availVal); }
			});
		});
	},
	focusClass : function(className) {
		return this.each(function() {
			className = className || 'focusClass';
			$(this).focus(function(e) {
				$(this).addClass(className);
			}).blur(function(e) {
				$(this).removeClass(className);
			});
		});
	}
});
})($jq['base']);
