/*
 * jQuery labelClickFix plugin
 *
 * Copyright (c) 2009 Stamen Georgiev / tuzemec@tuzemec.com
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 */


(function($) {

	$.fn.labelClickFix = function(){
		return this.each( function() {
			var $t = $(this), $f = $("#" + $t.attr("for") );
			$t
				.removeAttr("for")
				.click ( function(e){
					if ( $(e.target).is("a"))
						return;
					$f.click();
				})
			;
		});
	};

})(jQuery);
