$(function() {
	// add cool letter
	if (!window.IE6) {
		$('.text_val_bl.font_first_letter').typefaceFirstLetter( {
			'family' : 'Marianna',
			'addClass' : 'font_f_letter'
		});
	}

	// fix read more button
	$('span.dot').each(function() {
		var elements = $(this).parent().textNotEmpty();
		if (elements.length > 0) {
			var last = $(this).parent().textNotEmpty().last();
			last.append(this);
		}
	});

	$('a[target=_blank]').click(function(e) {
		e.stopPropagation();
		var link = $(this);
		newPopup(link.attr('href'));
		return false;
	});
	
	// click effect
	$('a[target!=_blank]').click(function() {

		var link = $(this);
		link.blur();

		var href = link.attr('href');

		// check anchor link
			if (!/#/.test(href)) {
				// ignore IE < 8
				if (!(window.IELT8 || window.IE6)) {

					$(this).animate( {
						opacity : 0.5
					}, 1000, function() {
						location.href = href;
					});

					// body effect
					$('body').animate( {
						opacity : 0.6
					}, 1500);

					return false;
				}

			}

		});

	// top menu effect on load
	$('.main_menu a').css( {
		opacity : 0.5
	}).animate( {
		opacity : 1
	}, 1500);

	// bottom menu effect on load
	$('.service_menu a').css( {
		opacity : 0
	}).animate( {
		opacity : 1
	}, 3000);

	// fix showing some blocks

	if (window.IELT8) {
		$('#main-aromaconcept, .sv_list li').each(function() {
			var f = function() {
				$(this).hide().show();
			}.scope(this).delay(300);

			f();
		});
	}

});
