jQuery(document).ready(function() {
	modify_form_description ();
	
	// показываем подсказки
	jQuery('.ff-input input').live('focus mouseover click', function() {
		$('.fft-wrap', $(this).parent().parent().parent()).hide();
		$('.fft-wrap', $(this).parent().parent()).show();
	});
	$('.ff-input select').live('focus mouseover click', function() {
		$('.fft-wrap', $(this).parent().parent().parent()).hide();
		$('.fft-wrap', $(this).parent().parent()).show();
	});
	$('.form-field label').live('focus mouseover click', function() {
		$('.fft-wrap', $(this).parent().parent()).hide();
		$('.fft-wrap', $(this).parent()).show();
	});
	$('.ff-input textarea').live('focus mouseover click', function() {
		$('.fft-wrap', $(this).parent().parent().parent()).hide();
		$('.fft-wrap', $(this).parent().parent()).show();
	});
	$('.form-field .megaselectlist').live('focus mouseover click', function() {
		$('.fft-wrap', $(this).parent().parent()).hide();
		$('.fft-wrap', $(this).parent()).show();
	});
	
	// Показать все в списке категорий
	$('.clc-show-all a').bind('click', function() {
	
		$('li.taxbt_child.hidden', $(this).parent().parent()).show();
		$(this).hide();
		
		return false;
	});
	
});

// преобразуем подсказки в формах
function modify_form_description () {
	jQuery('.ff-tip').each(function() {
		var inner = jQuery(this).html();
		jQuery(this).html('<div class="fft-wrap"><div class="fft-in"><img class="fft-l-arrow" src="/misc/images/null.gif" /><div class="fft-content">' + inner + '</div></div></div>');
	});
}
