/*------------------------------------------------
/ Design for Webmaster.spb.ru
/ Develop by : Petrov Nikolay
/ Date : mar, 2009
------------------------------------------------*/

$(function(){
/* контуры (СТРОЕНИЯ) */
	$(".complexMapTowerHint").hover(
		function () {
			$(this).addClass('notOut');
		}, 
		function () {
			$(this).removeClass('notOut');
		}
	);

	$(".imBox area").hover(
		function () {
			$(this).parent().parent().addClass('hover');
			var tower = $(this).parent().parent().parent().attr("id");
			$('#hint' + tower ).removeClass('out');
			// .css({top: e.pageY -800}
		}, 
		function () {
			$(this).parent().parent().removeClass('hover');
			var tower = $(this).parent().parent().parent().attr("id");
			$('#hint' + tower ).addClass('out');
			setTimeout(function(){
			}, 800);
		}
	);
	$(".imBox area").click(function(){
		//return false;
	});
/* контуры (END) */
	
	/* всплывающие подсказки на карте комплекса */
	$('.complexMapHint .inner2').hover(
		// over
		function () {
			$(this).parent().parent().removeClass('out');
		},
		// out
		function () {
			$(this).parent().parent().addClass('out');
		}
	);

	$('.complexMapHint .inner2').hover(
		// over
		function () {
			$(this).parent().parent().removeClass('out');
		},
		// out
		function () {
			$(this).parent().parent().addClass('out');
		}
	);

	$('.complexDig').hover(
		// over
		function () {
			$(this).addClass('hoverDig');
			$('#complexMapHint' + $(this).attr("rel") ).removeClass('out');
		},
		// out
		function () {
			/*
			$(this).removeClass('hoverDig');
			var rel = $(this).attr("rel");
			setTimeout(function(){
				$('#complexMapHint' + rel ).addClass('out');
			}, 500);
			*/
		}
	);

	$('.complexMapNoteText a').click(function(){
		//return false;	
	});

	$('.complexMapNoteText a').hover(
		//hvover
		function () {
			$('#complexMapHint' + $(this).attr("rel")).removeClass('out').addClass('out2');
		}, 
		//out
		function () {
			$('#complexMapHint' + $(this).attr("rel")).addClass('out').removeClass('out2');
		}
	);
/* всплывающие подсказки на карте комплекса (END) */

	/* всплывающие подсказки на карте */
	$('.aboutMapLink ').hover(function(){
		$('#' + $(this).attr("rel") ).removeClass('out');
	}, function(e){
		$('#' + $(this).attr("rel") ).addClass('out');
	});
	
	/* развернуть дополнительные новости (130_О проекте_Ход строительства) */
	$('.contactsMore a').click(function(){
		$(this).toggleClass("active");
		$(this).parent().next().slideToggle();
		return false;
	});

	/* 200_квартиры вкладки */
	$('.apartTab a').click(function(){
		$('.apartTab').removeClass('active');
		$(this).parent().addClass('active');
		$('.apartTabContent').css("display", "none");
		$('#apartTabContent' + $(this).attr("rel") ).css("display", "block");
		return false;
	});

	/* галлерея картинок в новостях */
	$('.newsPhotoSmall a').zoomimage({
		caption:false,
		controls:false
	});

	/* развернуть дополнительные новости (130_О проекте_Ход строительства) */
	$('#newsMoreLink').click(function(){
		$(this).toggleClass("active");
		$('.newsMoreContent').slideToggle();
		return false;
	});

	/* подсвечивание ссылок меню при наведении */
	$('.menuTextLink').hover(function(){
		$(this).parents(".menu1Item").addClass('hover');
	}, function(){
		$(this).parents(".menu1Item").removeClass('hover');
	});

	/* всплывающая большая фотка */
	$('.showBigFormat').hover(function(){
		$(this).next().removeClass("out");
	},function(){
		$(this).next().addClass("out");
	});

	/* исчезновение текста в инпутах */
	$('input[type="text"].hideText, textarea.hideText').inputValue1();

	/* дефолтные подписи к картинкам */
	//$('.defaultImage').defImg();

	/* дефолтная таблица */
	//$('.default table tr td:last-child').addClass('lastTd');
}); //  onLoad
