( function ( $ ) {
	$.lc = new Array();
	$.translate = function(string, not_return_alias){
		if($.lc[string] != undefined){
			return $.lc[string];
		}
		if(not_return_alias != undefined && not_return_alias){
			return '';
		}
		return string;
	};
})(jQuery);

jQuery.fn.hint = function(alias){
	$(this).each(function(){
		if(alias == undefined){
			var text = $(this).attr('title');
		}
		else{
			var text = alias;
		}
		if($(this).hasClass('force')){
			var title = text;
		}
		else{
			var title = $.translate(text, false);
		}
		$(this).attr('title', title);
	});
	$(this).tooltip({
			track: true,
			delay: 0
		});
	return this;
};

$(document).ready(function(){
	$('.hint').each(function(){
		$(this).hint();
	});
	//временное решение
	$('.translate_error').each(function(){
		$(this).html( $.translate($(this).html()) ).show();
	});

});