$(document).ready(function() {
$("#header > p").html("Бизнес центрыАренда на метроАренда на улицеКонтактыЗаказать обратный звонок");
window.scrollTo(0,100);
jQuery.fn.extend({
exists: function() { return this.length }
});
$.getScript("/JS/jquery.lazyload.js").done(function(script, textStatus) {
$("body > ul > li > div > span > img").lazyload({
placeholder : "/img/pre-loading.gif",
effect : "fadeIn"
});
if($("#header").attr("class"))
{
$("body > ul > li.contact > div > span > u").each(function() {
$(this).before("Открыть презентацию офиса")
})
}
})
$("#business-center-photos").css("left", $(window).innerWidth() / 2 - $("#business-center-photos").width() / 2 );
var abc_id_hover;
var show_abc = 0;
var search_pano;
$("#business-center-photos > div").width($("#business-center-photos > div > img").length * 136);
$("body > div:last-child").after("
");
$("#header > ul li:last-child").css("border-width", "0px");
$("#header > span").after("");
$("#header").after("");
$.get("/get_content.asp?get_abc=1", function(data) {
$("#header > div").html(data);
$.get("/get_content.asp?get_all_bc=1", function(data) {
$("#abc > div").html(data);
$("#abc > div").hover(function() {
$(abc_id_hover).addClass("active");
show_abc = 1;
},
function() {
show_abc = 0;
//$(abc_id_hover).removeClass("active");
})
$("#header > div").hover(function() {
show_abc = 1;
},
function() {
show_abc = 0;
setInterval(function() {
if(show_abc == 0)
{
$("#header > div > span").removeClass("active");
$("#abc").hide();
}
}, 500);
})
$("#header > div > span").hover(function() {
show_abc = 1;
$("#abc").css("opacity", "0.5");
$(abc_id_hover).removeClass("active");
$(this).addClass("active");
abc_id_hover = $(this);
$("#abc > div").css("top", 87);
$("#abc > div").css("left", $(this).offset().left);
$("#abc").show();
$("#abc > div > div > a").hide();
$("#abc > div > div > a[letter='" + $("#header > div > span.active").html() + "']").show();
$("#abc").css("opacity", "1");
if($("#abc > div > div > a:visible").length > 15)
{
$(".tmp_scroll").height(400);
$(".tmp_scroll").css("overflow-y", "scroll");
}
else
{
$(".tmp_scroll").css("overflow-y", "none");
}
},
function() {
//show_abc = 0;
})
})
})
$("#business-center").width($("#panorama").width());
//$("#business-center").css("top", $("#panorama").offset().top);
$.getScript("/JS/jquery.prettyPhoto.js", function() {
$.getScript("/JS/jquery-ui-1.10.3.custom.min.js", function() {
$.getScript("/JS/spin_min.js", function() {
//$.getScript("http://www.google.com/jsapi").done(function(script, textStatus) {
//google.load("maps","3", {"other_params":"sensor=false","callback": function() {
//=============================================================
//============================$("#offices-for-rent").after("");
if($("#bc-on-map").exists()) {
ymaps.ready(function() {
var bconmap = new ymaps.Map ("bc-on-map", {
center: [55.646690, 37.546507],
zoom: 14
},
{
minZoom: 11,
maxZoom: 15
}
);
var myPlacemark = new ymaps.Placemark([55.646690, 37.546507]);
bconmap.geoObjects.add(myPlacemark);
bconmap.controls
.add('zoomControl', { right: 20, top: 20 })
$("#route-street").autocomplete({
source:function(request, response) {
$.ajax({
url: "/get_content.asp?get_list_street=1",
type: "get",
dataType: "json",
data: { term: request.term },
success: function(responseData){
var array = responseData.map(function(element) {
return {value: element['street'], id: element['id_street']};
});
response(array);
}
})
},
select: function(event, ui) {
$("#route-street").attr("search", ui.item.id)
},
change: function( event, ui ) {
if ( !ui.item ) {
$("#route-street").val("");
}
}
});
$("#route-calculate").click(function() {
if($("#route-street").val() == "")
{
}
else
{
if($("#route-home").val() == "")
{
}
else
{
ymaps.route([[55.646690, 37.546507], "Россия, Москва, " + $("#route-street").val() + ", дом " + $("#route-home").val()], {mapStateAutoApply: true}
).then(
function (route) {
bconmap.geoObjects.add(route);
},
function (error) {
alert('Возникла ошибка: ' + error.message);
}
);
}
}
})
});
}
$("#dialog").dialog({
autoOpen: false,
resizable: false,
modal: true,
closeOnEscape: true,
title: "Заявка на обратный звонок",
width: "auto",
open: function() {
$('.ui-dialog').css('z-index', 90000012);
$('.ui-widget-overlay').css('z-index', 90000003);
$('.ui-widget-overlay').css('opacity', 0.2);
$('.ui-widget-overlay').css('background', '#2b2c2f');
$('.ui-widget-header').css("font-size", "18px");
$('.ui-widget-header').css("font-weight", "bold");
$('.ui-widget-header').css("font-family", "Roboto Condensed");
$(".ui-dialog").css("box-shadow","#4D4D4D 0px 0px 50px");
$(this).closest('.ui-dialog').find('.ui-dialog-titlebar-close').show();
}
});
$("#dialog1").dialog({
autoOpen: false,
resizable: false,
modal: true,
closeOnEscape: true,
title: "Заявка на обратный звонок",
width: "auto",
open: function() {
$('.ui-dialog').css('z-index', 90000012);
$('.ui-widget-overlay').css('z-index', 90000003);
$('.ui-widget-overlay').css('opacity', 0.2);
$('.ui-widget-overlay').css('background', '#2b2c2f');
$('.ui-widget-header').css("font-size", "18px");
$('.ui-widget-header').css("font-weight", "bold");
$('.ui-widget-header').css("font-family", "Roboto Condensed");
$(".ui-dialog").css("box-shadow","#4D4D4D 0px 0px 50px");
$(".ui-dialog").css("box-shadow","#4D4D4D 0px 0px 50px");
$('.ui-widget-overlay').addClass('custom-overlay');
$(this).closest('.ui-dialog').find('.ui-dialog-titlebar-close').show();
},
close: function() {
$('.ui-widget-overlay').removeClass('custom-overlay');
}
});
function open_dialog_zakaz()
{
if($("#offices-for-rent ul li.active").length > 0)
{
$.get("/get_content.asp?zakaz_call_back=" + $("#offices-for-rent ul li.active").find("img").attr("src").substring($("#offices-for-rent ul li.active").find("img").attr("src").indexOf("./photo/") + 8, $("#offices-for-rent ul li.active").find("img").attr("src").indexOf(".jpg")), function(data) {
$("#dialog_content1").html(data);
$("#dialog1").dialog("open");
})
}
else
{
$.get("/get_content.asp?zakaz_call_back=1", function(data) {
$("#dialog_content1").html(data);
$("#dialog1").dialog("open");
})
}
}
$(".contact div img").click(function() {
//$("#dialog").dialog("open");
open_dialog_zakaz();
})
$("#header > ul.contact > li > img").click(function() {
//$("#dialog").dialog("open");
open_dialog_zakaz();
})
$("#header p span").click(function() {
open_dialog_zakaz();
})
$("#business-center-photos div img").prettyPhoto({animation_speed:'normal', social_tools:false, deeplinking: false, slideshow: 8000, autoplay_slideshow: true});
$("body > ul > li > div span div a").prettyPhoto({animation_speed:'normal', social_tools:false, deeplinking: false, slideshow: 8000, autoplay_slideshow: true});
$("body > ul > li > div > span").click(function() {
$(this).find("div a:nth-child(1)").click();
})
function show_marker_baloon(id, setcenter, by_map)
{
var balloon = null;
$.get("/get_content.asp?by_map=" + by_map + "&get_marker_content=" + id, function(data) {
var map1 = data.substring(data.indexOf('map1=') + 6, data.indexOf('"', data.indexOf('map1=') + 6));
var map2 = data.substring(data.indexOf('map2=') + 6, data.indexOf('"', data.indexOf('map2=') + 6));
myMap.setCenter([map1, map2], 15);
balloon = myMap.balloon.open([map1, map2], data);
//myMap.setCenter([54.704815, 20.466380], 10);
myMap.setCenter([55.64869, 37.546507]);
})
}
ymaps.ready(function() {
$.getJSON("/json_map.asp?catalog_metro=kalujskaya", function(json){
if (json.status == 'OK') {
myGeoObjects = [];
var start_search = 0;
var minLat, maxLat, minLong, maxLong;
$.each(json.markers, function(index, marker) {
if (start_search == 0)
{
minLat = marker.lon;
maxLat = marker.lon;
minLong = marker.lat;
maxLong = marker.lat;
start_search = 1;
}
var myPlacemark = new ymaps.Placemark([marker.lon, marker.lat], {
iconContent: marker.pl + " кв.м.",
id: marker.id
},
{
preset: marker.class_bc
});
myPlacemark.events.add("click", function(e) {
show_marker_baloon(myPlacemark.properties.get("id"), 0, 0);
})
//myMap.geoObjects.add(myPlacemark);
myGeoObjects.push(myPlacemark);
minLat = Math.min(minLat, marker.lon);
maxLat = Math.max(maxLat, marker.lon);
minLong = Math.min(minLong, marker.lat);
maxLong = Math.max(maxLong, marker.lat);
})
clusterer = new ymaps.Clusterer({
maxZoom: 15
});
clusterer.add(myGeoObjects);
position = ymaps.util.bounds.getCenterAndZoom(
[[minLat, minLong], [maxLat, maxLong]],
[$("#panorama").width(), $("#panorama").height() - 200],
ymaps.projection.wgs84Mercator,
{ precizeZoom: false }
)
myMap = new ymaps.Map("panorama", position, {
minZoom: 11,
maxZoom: 16
});
//myMap.setCenter(position.center, position.zoom, {
// checkZoomRange: true
//});
myMap.controls
.add('zoomControl', { right: 20, top: 90 })
myMap.geoObjects.add(clusterer);
}
else
{
myMap = new ymaps.Map("panorama",
{
center: [55.76, 37.64],
zoom: 15
},
{
minZoom: 11,
maxZoom: 15
}
);
myMap.controls
.add('zoomControl', { right: 20, top: 90 })
//alert('Произошла ошибка!');
}
myMap.container.fitToViewport();
show_marker_baloon(5468, 1, 1);
//$("#business-center-photos").css("position", "absolute");
//$("#business-center-photos").css("marginTop", "-100px");
//$("#business-center-photos").css("left", $(window).innerWidth() / 2 - $("#business-center-photos").width() / 2 );
})
});
//=============================================================
//}})
//})
})
})
})
$(window).load(function() {
$("#business-center").width($("#panorama").width());
$("#business-center").css("top", $("#panorama").offset().top);
$("#panorama").outerHeight($("#panorama").outerHeight() - 55);
$("#panorama > iframe").outerWidth($("#panorama").outerWidth());
$("#panorama > iframe").outerHeight($("#panorama").outerHeight());
})
})
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-47883307-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();