/** http://kobzarev.com/programming/bulletproof-user-select.html
 *  
 *  РАБОТАЕТ БЕЗОТКАЗНО, НО И КОНТЕКСТНОЕ МЕНЮ ЗАПРЕЩАЕТ, А ЭТО УЖЕ ДОСТАВЛЯЕТ НЕУДОБСТВА
 * 
 *	<script type="text/javascript" src="/js/{$Yii->params.version}/jquery.disable_selection.js"></script>
 *
 *	<script type="text/javascript">
 *		jQuery(function(){
 *			jQuery('body *').disableSelection();
 *		});
 *	</script>
 */

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