//------------------------------------------------------------------------------
//  Common Functions
//------------------------------------------------------------------------------
// Image Operation
(function($){
	$.fn.imgChange = function(options){
		var element = $(this);
		var conf = $.extend({
			animate: "",
			animateOpacity: 0.5,
			animateSpeed: 800,
			hoverImage: "_on"
		}, options);
		element.each(function(){
			var thisSrc = this.src;
			if(thisSrc.indexOf("_off.") > 1){
				var hoverSrc = thisSrc.replace("_off",conf.hoverImage);
			}
			$(this).hover(function(){
				$(this).attr("src",hoverSrc);
				if(conf.animate){
					$(this).stop().animate({opacity: conf.animateOpacity}, 0).animate({opacity: 1}, conf.animateSpeed);
				}
			},function(){
				$(this).attr("src",thisSrc);
			});
		});
		return this;
	}
})(jQuery);
$(function(){
	$("a img").imgChange({animate: "yes"});
	$("input.inputBt").imgChange({animate: "yes"});
	$("input.submitBt").imgChange({animate: "yes"});
});




