$(document).ready(function() {
	showCounter();
	zoomImage();
	toggleParagraph();
	hlAddrPoint();
});


function showCounter()
{
	try{document.getElementById('footerCounter').innerHTML = '<a href="http://www.liveinternet.ru/click" '+'target=_blank><img src="http://counter.yadro.ru/hit?t18.5;r'+escape(document.referrer)+((typeof(screen)=='undefined')?'':';s'+screen.width+'*'+screen.height+'*'+(screen.colorDepth?screen.colorDepth:screen.pixelDepth))+';'+Math.random()+'" alt="liveinternet.ru: iieacaii ?enei oeoia ca 24 ?ana, iinaoeoaeae ca 24 ?ana e ca naaiai\y" '+'border=0 width=88 height=31></a>';}
	catch(e){};
}


function toggleParagraph(){
	$(".pOut.min .pContent").hide(); 

	//Switch the "Open" and "Close" state per click
	$(".pOut.min h3").toggle(function(){
		$(this).addClass("active");
		}, function () {
		$(this).removeClass("active");
	});

	//Slide up and down on click
	$(".pOut.min h3").click(function(){
		$(this).next(".pOut.min .pContent").slideToggle("fast");
	});

};


function zoomImage(){
	$("a.imgZoom").fancybox({
		'zoomOpacity' : true,
		'overlayShow' : false,
		'zoomSpeedIn' : 150,
		'zoomSpeedOut' : 150
	}); 
}


function hlAddrPoint(){
	$('.innH').mouseover(function(e) {
		var overed = $(e.target);
		//точка на карте
		if(overed.hasClass('addrPoint')){
			overed.addClass('hl');
			//overed.prev().addClass('hl');
			var overedLeft = overed.position().left;
			overed.prev().find('.inn').clone().appendTo(overed).addClass('surface').css('marginLeft',-overedLeft+'px').fadeIn('fast');
		}
		//адрес
		else{
			overed.parents('dt').addClass('hl');
			overed.parents('dt').next().addClass('hl');
		}
	})
	.mouseout(function(e) {
		var outed = $(e.target);
		//точка на карте
		if(outed.hasClass('addrPoint')){
			outed.removeClass('hl');
			//outed.prev().removeClass('hl');
			outed.find('.surface').fadeOut('fast', function(){$(this).remove()});
		}
		//адрес
		else{
			outed.parents('dt').removeClass('hl');
			outed.parents('dt').next().removeClass('hl');
		}
	});
}
