$HP_host = 'http://meblejarocin.com/ru';
$(function(){
	$('input:text, textarea, button')
		.focus(function(){$(this).addClass('focus');})
		.blur(function(){$(this).removeClass('focus');});
	$('button')
		.mouseover(function(){$(this).addClass('focus');})
		.mouseout(function(){$(this).removeClass('focus');});
	$('#article ul.gallery:not(".entries") li a').lightBox({overlayOpacity:0.6, imageLoading: $HP_host + '/pub/uploadimages/lightbox-ico-loading.gif', imageBtnPrev: $HP_host + '/pub/uploadimages/lightbox-btn-prev.png', imageBtnNext: $HP_host + '/pub/uploadimages/lightbox-btn-next.png',imageBtnClose: $HP_host + '/pub/uploadimages/lightbox-btn-close.png', imageBlank: 'images/lightbox-blank.gif', txtImage: 'Фотография', txtOf: 'из'}).find('span').corner('10px');
	
	$('#article #see-also ul:last li:first a[href*=".jpg"], #article #see-also ul:last li:first a[href*=".png"], #article #see-also ul:last li:first a[href*=".gif"]').lightBox({overlayOpacity:0.6, imageLoading: $HP_host + '/pub/uploadimages/lightbox-ico-loading.gif', imageBtnPrev: $HP_host + '/pub/uploadimages/lightbox-btn-prev.png', imageBtnNext: $HP_host + '/pub/uploadimages/lightbox-btn-next.png',imageBtnClose: $HP_host + '/pub/uploadimages/lightbox-btn-close.png', imageBlank: 'images/lightbox-blank.gif', txtImage: 'Photo', txtOf: 'of'});
	
	$('#article #see-also ul:last li:last a[href*=".jpg"], #article #see-also ul:last li:last a[href*=".png"], #article #see-also ul:last li:last a[href*=".gif"]').lightBox({overlayOpacity:0.6, imageLoading: $HP_host + '/pub/uploadimages/lightbox-ico-loading.gif', imageBtnPrev: $HP_host + '/pub/uploadimages/lightbox-btn-prev.png', imageBtnNext: $HP_host + '/pub/uploadimages/lightbox-btn-next.png',imageBtnClose: $HP_host + '/pub/uploadimages/lightbox-btn-close.png', imageBlank: 'images/lightbox-blank.gif', txtImage: 'Photo', txtOf: 'of'});
	
	$('#dane-podstawowe tbody tr:odd td, #cena tbody tr:odd td').addClass('alt');
	$('#wykonczenie tbody tr td:even').addClass('alt');
	$('table tbody tr td:not(":first-child")').css({'text-align' : 'center'});
	
	$('#main-nav > #it-2')
		.mouseover(function(){$(this).addClass('hover');})
		.focus(function(){$(this).addClass('hover');})
		.mouseout(function(){$(this).blur();})
		.blur(function(){$(this).removeClass('hover');})
		.find('a:first').click(function(){return false;});

	if ($('h2.meble-hotelowe, h2.meble-restauracyjne').size())
		$('#main-nav > #it-2 > a').addClass('active');
		
	var vHeight = $('#news .content').height();
	var nHeight = $('#promo .content').height();
	if (Math.abs(vHeight - nHeight) < 25)
		$('#news .content, #promo .content').css({height: Math.max(vHeight, nHeight)});
});