

$(document).ready(function(){
/*-------------------------------------------------------------------------
 * Clear form. Something like reset() for jQuery
 */
	$.fn.clearForm = function() {
	  return this.each(function() {
	 var type = this.type, tag = this.tagName.toLowerCase();
	 if (tag == 'form')
	   return $(':input',this).clearForm();
	 if (type == 'text' || type == 'password' || tag == 'textarea')
	   this.value = '';
	 else if (type == 'checkbox' || type == 'radio')
	   this.checked = false;
	 else if (tag == 'select')
	   this.selectedIndex = -1;
	  });
	};
/*-------------------------------------------------------------------------
 * Remove the blur on each <a /> and <input type="submit" />
 */
	$('a').live('click', function(e) {
		$(this).blur();
	});
	$("input[type='submit']").click(function () {
		$(this).blur();
	});
/*-------------------------------------------------------------------------
 * Change the target of each link with the .blank class
 */
	$('.blank').live('click', function(event) {
		$(this).blur();
		$(this).attr("target","blank");
		window.open($(this).attr("href"));
		return false;
	});

});


jQuery.fn.extend({ 
	disableSelection : function() { 
		this.each(function() { 
			this.onselectstart = function() { return false; }; 
			this.unselectable = "on"; 
			jQuery(this).css({'-moz-user-select':'none', '-webkit-user-select':'none', '-o-user-select':'none'}); 
		}); 
	} 
});


var spyesx = {
	console :{
		on 			: function(){if(typeof console == 'object' && console.firebug){return true;} else { return false; }},
		log 		: function(cmd){if(spyesx.console.on()){console.log(cmd);}},
		debug 		: function(cmd){if(spyesx.console.on()){console.debug(cmd);}},
		info 		: function(cmd){if(spyesx.console.on()){console.info(cmd);}},
		warn 		: function(cmd){if(spyesx.console.on()){console.warn(cmd);}},
		error 		: function(cmd){if(spyesx.console.on()){console.error(cmd);}},
		trace 		: function(cmd){if(spyesx.console.on()){console.trace();}},
		group 		: function(title){if(spyesx.console.on()){console.group(title);}},
		groupEnd 	: function(cmd){if(spyesx.console.on()){console.groupEnd();}},
		dir 		: function(obj){if(spyesx.console.on()){console.dir(obj);}},
		dirxml 		: function(element){if(spyesx.console.on()){console.dirxml(element);}},
		trace 		: function(cmd){if(spyesx.console.on()){console.trace();}}
	}
};

/* CLASS > Here, I don't need to use $(document).ready() by JQuery
 * -------------------------------------------------------------------------
 * CLASS : Regex
 */
	function Regex()
	{
		this.email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
		this.url = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
		
		this.check = function($regex, $value)
		{
			var $conditionIf = eval("this."+$regex+".test('"+$value+"')");
			if(!$conditionIf){return false;}
			else{return true;}
		}
	}

