(function($) {
	$.fn.divButton = function () {
		this.each(function() {
			var myImg	= $(this).find('img');
			var off		= myImg.attr('src');
			if ($(this).attr('up') != undefined) {
				$(this).mouseup(function() {
					myImg.attr('src', myImg.attr('up'));
				});
			}
			if ($(this).attr('down') != undefined) {
				$(this).mousedown(function() {
					myImg.attr('src', myImg.attr('down'));
				});
			}
			if ($(this).attr('over') != undefined) {
				$(this).hover(
				  function() {
					  myImg.attr('src', myImg.attr('over'));
				  },
				  function() {
					  myImg.attr('src', off);
				});
			}
		})
	},
	$.fn.useButtonCursors = function() {
		this.each(function() {
			$(this).hover(function() {
				$(this).css( { 'cursor': 'pointer' } );
			},
			function() {
				$(this).css( { 'cursor': 'arrow' } );
			});
		});
		return this;
	},
	$.fn.fadeButton = function ( options ) {
		var defaults = {
			opacity: 0.8
		}
		var options = $.extend(defaults, options);
		$(this).useButtonCursors();
		$(this).hover(
			function () {
				$(this).stop().animate({opacity: options.opacity}, 100);
			}, 
			function () {
				$(this).stop().animate({opacity: 1.0}, 100);
			}
		);
		$(this).click(function() {
			$(window).location = $(this).attr('link');
			$(window.location).attr('href', $(this).attr('link'));
		});
	}
})(jQuery);
