Pages = {};

$(document).ready(function() {
	Pages.All();
	
	$('.brand').mouseover(function() {
//			$(this).animate({"margin-left": "950px", "opacity": 0}, "slow")
	})
	
});


Pages.All = function(){
	//параграфы открывает-закрывает
	(function(){
		$(".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(){
		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(){
		$("a.imgZoom").fancybox({
			'zoomOpacity' : true,
			'overlayShow' : false,
			'zoomSpeedIn' : 150,
			'zoomSpeedOut' : 150
		}); 
	})();
	
	
	
	//подсвечивает точки на карте
	(function(){
		$('.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');
			}
		});
	})();
	
	
	
	//ховер на пункте меню - выпрыгивает фотка
	(function(){
		var delay = 500,
			executionTimer;
			
			
		$('#catList li.secondLev div.name, #catList li.secondLev a').hover(function(){
			var self = $(this);
			
			executionTimer = setTimeout(function(){
				var lastChild = self.parent()[0].lastChild;
				if(lastChild.nodeType == 8){
					self.parent().append('<img class="hidden preview rc5" src="'+lastChild.data+'"/>');
				}
				self.siblings('img').fadeIn('fast');
			}, delay);
		},function(){
			clearTimeout(executionTimer); 
			$(this).siblings('img').fadeOut('fast');
		});
	})();
	
	
	
};













