﻿$(document).ready(function(){

$(document).pngFix();
	
	$('#menu-top a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    && location.hostname == this.hostname) {
      var $target = $(this.hash);
      $target = $target.length && $target
      || $('[name=' + this.hash.slice(1) +']');
      if ($target.length) {
        var targetOffset = $target.offset().top;
        $('html,body')
        .animate({scrollTop: targetOffset}, 1000);
       return false;
      }
    }
  });
	

$(".menu a").click(function(){
		var ysl = $(this).attr('class');  
$(".chapter").css('background-color', '#fff');
$(".chapter").not("#footer1 .chapter").css('border-top', '1px dashed #fff');
$(".chapter").not("#footer1 .chapter").css('border-bottom', '1px dashed #fff');
$(".elevator-top").css('display', 'none');
	$("#"+ysl+" .elevator-top").animate({ opacity: "show"  }, 500);
	
$("#"+ysl+"").css('background-color', '#fffff4');
$("#"+ysl+"").css('border-top', '1px dashed #e6e8ea');
$("#"+ysl+"").css('border-bottom', '1px dashed #e6e8ea');
});

$(".elevator-top").click(function(){
$(".chapter").css('background-color', '#fff');
$(".chapter").not("#footer1 .chapter").css('border-top', '1px dashed #fff');
$(".chapter").not("#footer1 .chapter").css('border-bottom', '1px dashed #fff');
$(".elevator-top").css('display', 'none');
});


$("#footer1").hover(function(){
$(this).find(".icon-chapter").css('background-image', 'url(/templates/template7/images/footer_icon_on.png)');
}, function() {
$(this).find(".icon-chapter").css('background-image', 'url(/templates/template7/images/footer_icon.png)');
});


        window.onload = function () {
            var map = new YMaps.Map(document.getElementById("YMapsID"));
            map.setCenter(new YMaps.GeoPoint(92.764057,55.995023), 16);
			map.addControl(new YMaps.ToolBar());
							map.addControl(new YMaps.Zoom());
							map.addControl(new YMaps.ScaleLine());

			var s = new YMaps.Style();
			s.balloonContentStyle = new YMaps.BalloonContentStyle("tibiscon#mapt");
			s.iconStyle = new YMaps.IconStyle();
			s.iconStyle.href = "templates/template7/images/akademgorodok24.png";
			s.iconStyle.size = new YMaps.Point(151, 46);
			s.iconStyle.offset = new YMaps.Point(-101, -41);
			s.iconStyle.shadow = new YMaps.IconShadowStyle();
			s.iconStyle.shadow.href = "templates/template7/images/balloon_sh.png";
			s.iconStyle.shadow.size = new YMaps.Point(15, 6);
			s.iconStyle.shadow.offset = new YMaps.Point(-34, -5);

			
			var placemark = new YMaps.Placemark(new YMaps.GeoPoint(92.762457,55.996023), {style: s} );
			
			var t = new YMaps.Template('<h3>$[description]</h3><p class="map">$[textbox]</p>');
			YMaps.Templates.add("tibiscon#mapt", t);
			placemark.description = '"Бюро ИТ"';
			placemark.textbox = 'г. Красноярск, улица Академгородок, дом 24. кв.94';
			map.addOverlay(placemark); 

        };

});




