/**
 * .disableTextSelect - Disable Text Select Plugin
 *
 * Version: 1.0
 * Updated: 2007-08-11
 *
 * Used to stop users from selecting text
 *
 * Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/disabletextselect/)
 *
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 **/

/**
 * Requirements:
 * - jQuery (John Resig, http://www.jquery.com/)
 **/
var can_select=false;
(function($) {
	if ($.browser.mozilla) {
		$.fn.disableTextSelect = function() {
			return this.each(function() {
				$(this).css({
					'MozUserSelect' : 'none'
				});
			});
		};
	} else if ($.browser.msie) {
		$.fn.disableTextSelect = function() {
			return this.each(function() {
				$(this).bind('selectstart', function() {
				   if (!can_select)
				   {
						document.selection.empty();
				   }
				});
			});
		};
	} else {
		$.fn.disableTextSelect = function() {
			return this.each(function() {
				$(this).mousedown(function() {
					
					return false;
				});
			});
		};
	}
	
})(jQuery);







(function($) {
	if ($.browser.mozilla) {
		$.fn.enableTextSelect = function() {
			return this.each(function() {
				$(this).css({
					'MozUserSelect' : 'TriState'
				});
			});
		};
	} else if ($.browser.msie) {
		$.fn.enableTextSelect = function() {
			return this.each(function() {
				$(this).unbind('selectstart');
			});
		};
	} else {
		$.fn.enableTextSelect = function() {
			return this.each(function() {
				$(this).unbind('mousedown');
			});
		};
	}
})(jQuery);
