$(function(){ Fancybox_Init(); if( $( 'body' ).find( ".acord" ) ) { $('.acord-slide:first').addClass('active'); window.acord = new rpAccordion({selector: '.acord'}); } /*$(".details img[alt]").each(function(){ var img = $(this); if (img.attr("alt") != ''){ img.addClass("has-title"); $(""+img.attr("alt")+"
").insertAfter(img); }; });*/ $(".details img[alt]").each(function(){ var img = $(this); if (img.attr("alt") != ''){ var fig = $("").insertAfter(img); var i = new Image(); i.onload = function(){ fig.css({"max-width": i.width + "px"} ); } i.src = img.attr('src'); img.remove(); }; }); promoInit(); pmapInit(); $( ".menu_expand" ).click(function() { $(this).toggleClass("expanded"); $( ".logo" ).toggleClass("hidden"); $( ".langs" ).toggleClass("expanded"); $( ".top-menu" ).toggleClass("nobg"); }); if( $("#mainslider").length ){ $("#mainslider").owlCarousel({ navigation : true, items : 4, loop:true, autoPlay:true, autoPlayTimeout:100, }); } }); function pmapInit(){ if( $('#pmap').length == 0 ){ return; } $('#pmap').append(""); var plan3 = new plan(); } function promoInit(){ if( !$('body').hasClass('index') ){ return; } preloadImages([ '/tpl/default/img/layer1.jpg', '/tpl/default/img/layer2.png', '/tpl/default/img/layer3.png', '/tpl/default/img/house_linear.png', '/tpl/default/img/house.png'], function( done ){ $(".promo-loading").text( done + "%" ); if( done < 100 ){ return; } $(".promo-loading").fadeOut( 1000 ); $(".parallax, .promo-slogan").fadeIn( 1000 ); $('.parallax-layer').parallax( { mouseport: $('#layout'), decay: 0 }, { xparallax: '30px', yparallax: '10px'}, { xparallax: '45px', yparallax: '20px'}, { xparallax: '70px', yparallax: '30px'} ); setTimeout(function(){ $(".promo-house1").show(4000,function(){ $(".promo-house2").fadeIn(4000); }); }, 3500); setTimeout(function(){ $(".promo-number1").animate({top: '104px'}, 1000,function(){ $(".promo-number2").animate({top: '104px'}, 1000, function(){ $(".promo-number3").animate({top: '104px'}, 1000); }); }); }, 2000); }); } function rpAccordion( opt ){ var self = this; this.opt = opt; self.timer = null; self.animating = false; self.hover_delay = opt.hover_delay || 50; self.anim_duration = opt.anim_duration || 1000; this.init = function(){ self.opt.horizon = $(window).width() <= "768" ? true : false; self.opt.duration = self.opt.node || 500; self.opt.node = $(self.opt.selector); self.opt.slides = self.opt.node.find(".acord-slide"); self.opt.w_total = self.opt.node.width(); self.opt.h_total = self.opt.node.height(); if( !self.opt.horizon ){ self.opt.w_title = self.opt.node.find(".acord-title:first").width() + 1; self.opt.w_slide = self.opt.w_total - (self.opt.w_title * (self.opt.slides.length - 1) ); self.opt.node.find(".acord-slide.active").width( self.opt.w_slide ).siblings().width( self.opt.w_title ); } else{ self.opt.h_title = self.opt.node.find(".acord-title:first").height() + 1; self.opt.h_slide = self.opt.h_total - (self.opt.h_title * (self.opt.slides.length - 1) ); self.opt.node.find(".acord-slide.active").height( self.opt.h_slide ).siblings().height( self.opt.h_title ); } if( !self.opt.horizon ){ self.opt.node.find(".acord-slide").bind( "mouseover mousemove", self.slideHover ); } else { self.opt.node.find(".acord-slide").bind( "click", self.titleClick ); } $(window).resize( self.resize ); self.resize(); } this.resize = function(){ self.opt.horizon = $(window).width() <= "768" ? true : false; self.opt.slides = self.opt.node.find(".acord-slide"); self.opt.w_total = self.opt.node.width(); self.opt.h_total = self.opt.node.height(); if( !self.opt.horizon ){ self.opt.node.removeClass('vertical').addClass('horisontal'); self.opt.w_title = self.opt.node.find(".acord-title:first").width() + 1; self.opt.w_slide = self.opt.w_total - (self.opt.w_title * (self.opt.slides.length - 1) ); self.opt.node.find(".acord-slide.active").width( self.opt.w_slide ).siblings().width( self.opt.w_title ); self.opt.node.find(".acord-slide").height( self.opt.h_total ); } else{ self.opt.node.removeClass('horisontal').addClass('vertical'); self.opt.h_title = self.opt.node.find(".acord-title:first").height() + 1; self.opt.h_slide = self.opt.h_total - (self.opt.h_title * (self.opt.slides.length - 1) ); self.opt.node.find(".acord-slide.active").height( self.opt.h_slide ).siblings().height( self.opt.h_title ); self.opt.node.find(".acord-slide").width( self.opt.w_total ); } if( !self.opt.horizon ){ self.opt.node.find(".acord-slide").bind( "mouseover mousemove", self.slideHover ); } else { self.opt.node.find(".aactivate").bind( "click", self.titleClick ); } } this.slideHover = function(){ var i = $(this).index(); clearTimeout( self.timer ); self.timer = setTimeout( function(){ self.activate( i ); }, self.hover_delay ); } this.titleClick = function(e){ if( $(this).hasClass('aactivate') ){ e.preventDefault(); var i = $(this).parent().index(); self.activate( i ); } } this.activate = function( i ){ if( self.animating ){ return; } self.animating = true; setTimeout( function(){ self.animating = false; } , self.anim_duration ); var oldSlide = self.opt.node.find(".acord-slide.active"), newSlide = self.opt.node.find(".acord-slide:eq(" + i + ")"); if( newSlide.hasClass('active') ){ return; } oldSlide.removeClass('active'); newSlide.addClass('active'); if( !self.opt.horizon ){ oldSlide.width( self.opt.w_title ); newSlide.width( self.opt.w_slide ); } else{ oldSlide.height( self.opt.h_title ); newSlide.height( self.opt.h_slide ); } } this.init(); } function plan( opt ){ var self = this; self.idCanvas = "canvas_1"; self.w = 939; self.h = 547; self.image = '/tpl/default/img/map3_ru.png'; self.baseUrl = ""; self.borders_color = "rgba(127,127,127,0.5)"; self.hightlight_borders = "rgba(127,127,127,0.5)"; self.default_bg = "rgba(29,164,134,0.7)"; self.hightlight_bg = "rgba(0,88,71,0.7)"; self.hightlight_duration = 150; self.langs = { ru: { reg0: "Бурятия", reg1: "Забайкальский\n край", reg2: "Иркутская\n область", reg3: "Казахстан", reg4: "Камчатский\n край", reg5: "Магаданская\n область", reg6: "Оренбургская\n область", reg7: "Пермский\n край", reg8: "Республика\n Тыва", reg9: "Чукотский\n автономный\n округ", reg10: "Якутия", reg11: "Московская\n область", reg12: "Мурманская\n область", reg13: "Вологодская\n область", reg14: "Волгоградская\n область", reg15: "Челябинская\n область", reg16: "Республика\n Башкортостан", reg17: "Красноярский\n край", reg18: "Армения", reg19: "Амурская\n область", reg20: "Хабаровский\n край", reg21: "Сахалинская\n область", projects: "проектов" }, en: { reg0: "Republic of\n Buryatia", reg1: "Trans-Baikal\n territory", reg2: "Irkutsk\n region", reg3: "Republic of\n Kazakhstan", reg4: "Kamchatka\n region", reg5: "Magadan\n region", reg6: "Orenburg\n region", reg7: "Perm\n region", reg8: "Republic\n of Tyva", reg9: "Chukotka\n Autonomous\n Region", reg10: "Republic\n of Sakha\n (Yakutia)", reg11: "Moscow\n region", reg12: "Murmansk\n region", reg13: "Vologda\n region", reg14: "Volgograd\n region", reg15: "Chelyabinsk\n region", reg16: "Republic of\n Bashkortostan", reg17: "Krasnoyarsk\n region", reg18: "Armenia", reg19: "Amur\n region", reg20: "Khabarovsk\n region", reg21: "Sakhalin", projects: "projects" } } self.objects = [ {n: 0, title: "Бурятия", url: "/projects/buryatia/", center: [603,413], points: [[581,404],[580,396],[583,392],[581,384],[585,383],[586,379],[592,380],[597,375],[604,376],[606,379],[618,375],[619,371],[625,368],[626,371],[623,374],[627,380],[630,388],[638,393],[639,398],[633,400],[630,406],[622,413],[625,421],[623,427],[617,430],[611,433],[603,444],[598,443],[593,447],[586,448],[587,450],[583,455],[587,460],[581,463],[581,468],[577,467],[576,464],[566,464],[563,461],[553,467],[548,468],[538,464],[535,454],[511,447],[508,442],[511,440],[510,434],[516,433],[520,431],[525,436],[535,444],[540,443],[544,452],[549,453],[551,456],[556,454],[557,450],[566,446],[567,439],[571,439],[576,434],[583,429],[585,423],[584,419],[589,416],[587,406],[588,394],[587,393]]}, {n: 1, title: "Забайкальский\n край", url: "/projects/zabaykalsky_krai/", center: [647,426], points: [[581,467],[582,462],[587,461],[583,456],[587,451],[586,447],[593,447],[599,443],[603,443],[611,433],[615,433],[619,428],[624,426],[626,422],[625,419],[622,416],[622,412],[630,406],[632,401],[639,399],[639,393],[634,389],[631,388],[625,374],[626,371],[635,373],[639,369],[639,363],[634,359],[633,353],[637,351],[643,351],[651,366],[658,370],[655,373],[659,376],[665,374],[667,377],[671,377],[670,383],[675,387],[673,389],[679,401],[672,405],[669,413],[674,414],[677,421],[673,426],[670,440],[673,446],[667,450],[665,457],[648,454],[645,457],[642,455],[634,455],[625,462],[625,466],[620,466],[607,474],[586,473],[584,468]]}, {n: 2, title: "Иркутская\n область", url: "/projects/irkutskaya_oblast/", center: [538,399], points: [[512,432],[505,433],[487,417],[487,413],[494,413],[497,399],[499,394],[503,394],[504,389],[499,381],[504,373],[514,373],[518,369],[522,378],[524,377],[525,370],[536,360],[536,355],[541,354],[543,359],[548,362],[553,354],[549,349],[552,343],[552,339],[548,338],[546,334],[548,331],[546,325],[554,320],[556,313],[552,306],[554,301],[554,293],[562,291],[564,289],[566,292],[564,294],[564,297],[566,298],[570,297],[572,302],[572,309],[576,313],[575,320],[576,325],[582,327],[578,335],[578,348],[581,352],[587,350],[594,349],[596,345],[599,348],[605,341],[608,334],[611,328],[618,327],[626,331],[627,336],[634,334],[639,342],[642,349],[636,350],[633,352],[633,358],[637,362],[638,369],[634,372],[627,372],[626,368],[623,370],[619,370],[618,375],[606,379],[603,376],[599,376],[598,374],[596,378],[590,380],[587,378],[584,382],[579,383],[579,388],[583,390],[580,394],[579,399],[581,405],[578,416],[566,437],[560,443],[555,447],[551,447],[550,449],[556,451],[555,453],[550,456],[549,453],[543,452],[542,447],[539,444],[530,441],[528,438],[524,436],[520,430]]}, {n: 3, title: "Казахстан", url: "/projects/kazakhstan/", center: [224,420], points: [[112,366],[115,366],[118,347],[114,344],[117,342],[114,336],[123,333],[124,329],[135,325],[137,328],[135,333],[138,336],[142,335],[145,329],[150,330],[154,328],[166,327],[167,335],[168,336],[174,334],[174,339],[178,342],[180,350],[179,357],[185,356],[187,360],[190,363],[194,362],[199,363],[200,368],[205,368],[207,368],[209,371],[209,376],[212,380],[219,381],[226,385],[232,379],[227,368],[235,366],[236,362],[242,361],[244,363],[247,361],[244,354],[245,351],[249,350],[251,353],[261,354],[275,359],[278,358],[295,361],[301,360],[307,360],[308,364],[313,366],[315,367],[316,371],[313,376],[312,380],[319,383],[320,386],[325,387],[328,389],[324,392],[324,395],[332,396],[338,392],[350,391],[347,395],[354,406],[362,443],[366,443],[369,438],[372,439],[372,443],[382,448],[388,445],[392,447],[393,452],[394,457],[400,462],[399,465],[404,466],[406,469],[411,467],[413,471],[413,476],[411,478],[404,478],[402,483],[401,492],[399,494],[392,496],[391,494],[385,494],[379,489],[368,506],[370,510],[368,513],[361,509],[345,510],[345,511],[349,513],[347,521],[347,534],[343,534],[343,537],[340,537],[339,545],[337,540],[332,540],[332,536],[322,531],[314,527],[300,523],[298,524],[288,514],[282,514],[279,522],[266,512],[258,511],[254,516],[249,516],[245,517],[236,517],[226,523],[226,526],[222,523],[224,518],[222,515],[212,511],[215,500],[211,499],[217,490],[214,486],[214,481],[212,474],[207,474],[196,466],[187,464],[185,449],[174,424],[151,418],[123,457],[119,455],[119,440],[115,433],[99,431],[103,428],[108,425],[109,422],[104,417],[104,412],[101,411],[104,409],[107,396],[104,392],[107,391],[111,395],[114,398],[113,391],[116,393],[120,390],[132,400],[131,395],[141,390],[140,387],[143,386],[144,382],[139,380],[136,380],[134,373]]}, {n: 4, title: "Камчатский\n край", url: "/projects/kamchatka_krai/", center: [866,204], points: [[870,104],[874,106],[880,105],[882,128],[887,139],[877,140],[873,144],[873,160],[867,154],[870,167],[865,167],[864,174],[875,194],[878,195],[878,191],[884,191],[886,196],[891,200],[894,198],[900,204],[897,206],[895,204],[893,205],[899,217],[908,219],[909,223],[904,227],[904,235],[913,244],[910,247],[910,255],[915,259],[918,282],[875,254],[861,238],[861,229],[855,223],[857,220],[856,216],[859,214],[855,194],[854,180],[851,177],[854,164],[851,163],[850,159],[842,155],[842,150],[845,145],[838,147],[836,153],[845,163],[841,166],[837,163],[835,157],[828,156],[826,150],[821,148],[814,139],[814,135],[819,133],[820,128],[824,128],[825,124],[832,123],[835,118],[842,119],[845,117],[848,125],[850,125],[854,122],[865,122]]}, {n: 5, title: "Магаданская\n область", url: "/projects/magadanskaya_oblast/", center: [794,201], points: [[794,252],[805,247],[805,238],[811,237],[816,232],[821,232],[816,237],[820,240],[827,233],[826,225],[831,224],[835,219],[831,216],[828,219],[824,217],[824,200],[821,193],[822,186],[828,177],[831,177],[832,174],[838,181],[843,181],[842,165],[838,163],[836,159],[833,156],[828,156],[826,149],[821,148],[815,139],[811,143],[805,143],[800,147],[795,146],[790,148],[786,143],[782,143],[784,148],[779,154],[769,161],[772,165],[771,168],[773,174],[777,180],[777,188],[772,191],[765,192],[760,198],[762,203],[755,208],[754,212],[765,236],[770,233],[780,236],[782,241],[779,249],[781,251],[785,248],[792,248]]}, {n: 6, title: "Оренбургская\n область", url: "/projects/orenburgskaya_oblast/", center: [191,345], points: [[168,326],[173,326],[178,322],[185,321],[188,316],[194,314],[196,308],[199,318],[200,334],[203,337],[200,341],[201,344],[206,344],[207,346],[203,348],[205,351],[203,355],[205,357],[209,358],[216,362],[220,359],[227,359],[230,364],[226,366],[232,379],[228,384],[222,384],[219,380],[214,380],[210,376],[210,370],[206,367],[201,368],[199,363],[190,363],[186,356],[181,357],[180,354],[181,349],[178,341],[174,339],[175,334],[168,335],[167,329]]}, {n: 7, title: "Пермский\n край", url: "/projects/perm/", center: [250,278], points: [[222,291],[226,291],[229,287],[228,283],[233,280],[235,272],[239,269],[238,263],[245,260],[246,256],[241,249],[243,243],[249,244],[259,253],[264,254],[273,253],[281,259],[287,261],[272,277],[265,281],[269,287],[266,289],[264,296],[258,298],[256,302],[252,299],[248,305],[243,305],[238,310],[234,310],[234,306],[231,305],[231,301],[225,301],[225,297],[222,296]]}, {n: 8, title: "Республика\n Тыва", url: "/projects/tyva/", center: [475,455], points: [[494,425],[493,428],[479,430],[478,434],[474,435],[474,438],[471,440],[471,442],[466,447],[453,446],[447,440],[444,441],[441,446],[434,446],[433,451],[439,460],[436,463],[435,469],[456,460],[464,461],[475,464],[476,469],[494,473],[498,475],[504,471],[507,465],[502,460],[503,453],[506,452],[506,449],[509,449],[510,446],[507,441],[510,438],[511,433],[507,434]]}, {n: 9, title: "Чукотский\n автономный\n округ", url: "/projects/chukotka/", center: [794,134], points: [[861,0],[848,9],[847,16],[844,21],[852,24],[847,26],[834,22],[792,47],[786,58],[786,61],[782,62],[776,68],[781,73],[785,72],[790,75],[790,81],[784,82],[781,84],[773,78],[773,90],[765,96],[761,102],[775,111],[775,118],[765,131],[771,137],[779,138],[782,143],[786,143],[789,148],[795,146],[800,147],[805,144],[810,143],[814,138],[814,134],[819,132],[820,127],[824,126],[825,123],[832,122],[834,118],[845,117],[847,124],[855,122],[864,122],[870,103],[875,105],[879,104],[877,87],[873,84],[885,77],[882,71],[862,71],[860,74],[854,73],[854,77],[849,77],[850,71],[853,71],[857,68],[856,55],[852,55],[852,52],[845,53],[844,51],[843,45],[848,48],[850,47],[853,49],[856,47],[856,40],[860,36],[866,37],[876,29],[873,25],[879,27],[878,21],[873,21],[871,18],[865,17],[867,14],[863,10],[867,8]]}, {n:10, title: "Якутия", url: "/projects/yakutia/", center: [635,244], points: [[762,101],[775,112],[775,120],[765,129],[767,135],[770,137],[779,137],[783,149],[770,161],[773,165],[770,169],[773,173],[773,176],[777,180],[776,187],[773,191],[766,192],[760,198],[762,203],[755,209],[755,216],[765,235],[763,240],[758,241],[755,245],[748,245],[741,243],[738,247],[743,255],[740,269],[744,272],[747,281],[743,284],[742,292],[736,293],[735,294],[734,298],[722,303],[722,317],[720,320],[725,325],[722,331],[729,337],[729,339],[726,344],[729,349],[719,355],[720,358],[717,359],[710,360],[700,365],[695,362],[686,366],[682,362],[674,361],[671,365],[668,361],[666,363],[661,361],[650,367],[635,335],[627,336],[627,331],[615,327],[610,328],[600,348],[595,345],[593,349],[586,349],[583,353],[579,349],[579,337],[583,326],[578,326],[575,320],[576,315],[577,313],[572,310],[573,303],[570,297],[567,299],[564,298],[564,295],[567,293],[562,286],[559,289],[555,286],[548,287],[547,283],[553,276],[553,273],[551,271],[547,263],[550,259],[547,257],[549,253],[550,232],[544,224],[553,216],[557,218],[559,212],[561,207],[562,204],[568,199],[564,194],[564,188],[557,177],[558,174],[555,171],[556,168],[563,163],[566,168],[570,162],[584,161],[584,164],[590,168],[603,163],[604,151],[611,153],[618,151],[622,152],[630,163],[626,167],[638,177],[644,177],[645,163],[654,165],[657,157],[665,159],[667,158],[665,155],[667,153],[672,151],[670,148],[669,144],[667,145],[664,141],[668,137],[665,134],[681,126],[686,125],[681,131],[683,133],[685,130],[688,130],[689,137],[693,133],[690,124],[695,120],[704,119],[701,124],[703,126],[704,124],[706,125],[709,123],[715,122],[719,124],[722,123],[724,116],[732,108],[739,103],[746,103],[752,109]]}, //{n:11, title: "Московская\n область", url: "/projects/moskovskaya_oblast/", center: [133,226], points: [[122,208],[130,208],[130,212],[136,214],[143,215],[145,217],[144,220],[139,226],[140,231],[142,235],[141,241],[135,242],[132,240],[124,242],[125,235],[121,230],[124,226],[123,221],[120,219],[119,216],[122,212]]}, {n:12, title: "Мурманская\n область", url: "/projects/murmansk/", center: [243,127], points: [[212,103],[215,98],[222,98],[226,92],[226,87],[234,83],[246,84],[253,87],[256,94],[255,95],[251,93],[251,98],[255,106],[256,124],[258,131],[258,137],[252,147],[244,149],[231,142],[230,137],[227,131],[227,124],[225,120],[224,113],[223,119],[217,114],[217,111]]}, {n:13, title: "Вологодская\n область", url: "/projects/vologodskaya_oblast/", center: [183,205], points: [[174,172],[168,173],[164,176],[161,182],[154,183],[151,186],[154,190],[155,195],[159,195],[160,201],[172,207],[171,213],[174,217],[185,218],[192,222],[196,230],[201,234],[207,233],[209,236],[213,232],[211,229],[213,226],[216,226],[220,223],[219,219],[217,214],[213,214],[209,208],[203,208],[184,188],[184,182],[187,178],[185,177],[184,172],[179,174],[176,174]]}, {n:14, title: "Волгоградская\n область", url: "/projects/volgogradskaya_oblast/", center: [110,312], points: [[95,307],[94,302],[99,299],[99,291],[104,288],[104,285],[111,285],[111,288],[117,290],[118,295],[123,297],[127,301],[127,305],[125,308],[125,312],[129,311],[129,316],[134,318],[135,324],[124,329],[122,333],[118,335],[113,330],[107,329],[102,329],[100,329],[99,325],[97,325],[95,328],[88,327],[85,322],[86,318],[85,313],[88,311],[92,312],[96,309]]}, {n:15, title: "Челябинская\n область", url: "/projects/chelyabinskaya_oblast/", center: [246,343], points: [[248,318],[250,317],[256,323],[263,326],[265,329],[265,337],[257,342],[257,345],[262,349],[261,353],[252,353],[248,350],[242,354],[246,360],[245,363],[241,361],[236,361],[235,366],[231,366],[228,368],[227,365],[230,363],[228,358],[223,358],[223,352],[227,352],[228,349],[230,344],[236,340],[239,341],[245,335],[243,334],[236,334],[229,332],[227,328],[228,323],[233,321],[235,323],[236,327],[241,328],[247,331],[249,329],[247,325]]}, {n:16, title: "Республика\n Башкортостан", url: "/projects/bashkortostan/", center: [217,330], points: [[222,297],[225,297],[225,302],[231,302],[231,305],[233,305],[235,311],[237,311],[242,316],[247,318],[246,325],[247,330],[245,331],[242,328],[235,327],[235,323],[231,321],[227,325],[227,329],[232,333],[238,335],[243,334],[244,336],[241,338],[239,341],[234,341],[229,344],[226,351],[223,353],[222,359],[219,359],[217,362],[214,361],[211,358],[207,358],[203,354],[207,350],[204,348],[206,345],[204,344],[202,345],[201,340],[203,337],[200,333],[201,330],[200,326],[200,320],[204,312],[208,314],[209,309],[206,308],[207,304],[211,306],[215,304],[217,302]]}, {n:17, title: "Красноярский\n край", url: "/projects/krasnoyarskiy_kray/", center: [488,286], points: [[442,162],[468,163],[465,157],[468,148],[476,146],[482,141],[492,140],[492,135],[500,134],[502,138],[505,138],[514,137],[512,132],[519,132],[518,125],[523,116],[528,114],[533,117],[531,121],[538,122],[536,129],[542,126],[551,126],[560,136],[557,151],[550,161],[538,173],[538,176],[556,168],[556,177],[563,185],[564,194],[567,199],[560,203],[558,216],[544,223],[550,229],[550,251],[548,254],[548,259],[553,273],[549,286],[558,288],[562,287],[564,289],[560,291],[553,293],[554,305],[552,308],[555,314],[553,322],[545,327],[547,330],[545,334],[547,340],[551,340],[552,344],[549,349],[549,352],[551,353],[549,363],[542,359],[540,353],[534,356],[535,360],[525,370],[524,378],[522,378],[517,369],[513,374],[504,374],[499,382],[504,390],[503,393],[496,395],[496,400],[495,414],[487,413],[486,417],[494,425],[493,428],[479,430],[472,440],[464,447],[456,446],[447,440],[454,433],[455,428],[459,426],[457,419],[456,411],[454,409],[454,404],[442,404],[439,406],[438,401],[444,393],[439,386],[441,375],[446,371],[447,368],[439,365],[439,359],[444,354],[444,349],[440,350],[436,342],[421,339],[422,332],[421,325],[432,322],[432,319],[427,317],[428,306],[434,298],[435,291],[439,285],[438,278],[433,276],[433,266],[430,263],[431,250],[428,246],[429,238],[427,235],[434,233],[435,219],[426,218],[421,211],[424,205],[432,201],[430,192],[430,186],[434,184],[430,177],[435,176],[441,187],[446,187],[444,182],[440,177],[440,166]]}, {n:18, title: "Армения", url: "/projects/armenia/", center: [62,457], points: [[33,436],[51,435],[54,439],[55,444],[59,451],[62,453],[65,460],[59,462],[59,458],[53,454],[49,454],[43,449],[44,447],[37,446]]}, {n:19, title: "Амурская\n область", url: "/projects/amurskaya_oblast/", center: [726,386], points: [[651,366],[661,360],[666,363],[667,361],[670,364],[674,362],[683,361],[686,365],[695,362],[700,365],[711,360],[717,359],[721,357],[717,356],[730,349],[738,345],[741,347],[736,358],[737,361],[735,364],[735,369],[741,370],[749,376],[757,371],[759,363],[767,362],[771,371],[768,375],[763,375],[762,376],[764,380],[756,392],[757,397],[754,401],[754,406],[763,409],[769,418],[764,429],[752,426],[748,427],[740,429],[708,396],[699,399],[692,396],[681,400],[673,391],[675,386],[672,385],[672,377],[668,377],[665,373],[659,375],[656,373],[659,370]]}, {n:20, title: "Хабаровский\n край", url: "/projects/khabarovskiy_kray/", center: [786,367], points: [[797,420],[800,415],[797,415],[786,417],[781,415],[772,415],[769,418],[762,409],[754,405],[756,392],[764,380],[764,375],[770,374],[772,372],[769,362],[759,363],[757,368],[751,375],[735,369],[739,362],[738,358],[742,347],[737,345],[730,349],[726,344],[730,338],[722,332],[726,325],[719,320],[721,315],[722,302],[733,298],[735,292],[742,292],[743,282],[747,281],[744,271],[740,269],[742,256],[737,246],[741,243],[745,245],[753,245],[757,242],[763,240],[770,233],[781,238],[781,242],[779,248],[781,251],[785,248],[792,248],[793,252],[793,258],[788,258],[772,273],[773,280],[771,283],[772,291],[770,320],[761,341],[761,343],[767,345],[774,342],[777,349],[780,345],[784,349],[787,338],[795,334],[810,337],[807,342],[817,348],[822,365],[835,390],[835,410],[831,409],[829,405],[825,402],[818,407],[820,410],[826,412],[827,417],[822,420],[823,425],[819,430],[808,430],[805,433],[807,437],[802,437],[800,432],[802,427]]}, {n:21, title: "Сахалинская\n область", url: "/projects/sakhalin/", center: [833,357], points: [[807,315],[813,322],[820,327],[827,339],[838,349],[860,364],[851,365],[847,367],[852,383],[863,389],[869,390],[872,397],[868,395],[862,397],[862,408],[855,399],[855,395],[849,391],[847,384],[842,381],[834,366],[828,360],[826,352],[818,349],[815,346],[812,335],[808,334],[807,328],[812,328],[804,320]]} ]; this.init = function(){ self.lang = "ru"; var path_parts = location.pathname.split("/"); if( path_parts.length > 0 ){ if( path_parts[1] == "en" ){ self.lang = "en"; } } self.lng = self.langs[self.lang]; self.image = '/tpl/default/img/map3_' + self.lang + '.png'; $('#'+self.idCanvas).drawImage({ layer: true, source: self.image, x: 0, y: 0, width: self.w, height: self.h, fromCenter: false }) for(var i = 0; i < self.objects.length; i++){ self.objects[i].ind = i; self.drawObject( i ); } self.tooltip_layer = $('canvas').getLayer(-1).index - self.objects.length + 1; } this.drawTooltip = function( n ){ var o = this.objects[n]; if( "undefined" != typeof $('#'+self.idCanvas).getLayer('Tooltip') ){ $('#'+self.idCanvas).removeLayerGroup('Tooltip'); } setTimeout(function(){ $('#'+self.idCanvas).drawLine({ layer: true, index: self.tooltip_layer, strokeStyle: "#054A37", strokeWidth: 1, groups: ['Tooltip'], x1: o.center[0], y1: o.center[1], x2: o.center[0], y2: o.center[1] - 40 }) .drawRect({ layer: true, index: self.tooltip_layer+1, groups: ['Tooltip'], fillStyle: '#fff', strokeStyle: "#054A37", x: o.center[0], y: o.center[1] - 40 - 40, width: 100, height: 80 }) .drawText({ layer: true, index: self.tooltip_layer+2, groups: ['Tooltip'], fillStyle: '#054A37', x: o.center[0], y: o.center[1] - 40 - 40, fontSize: '12px', fontFamily: 'Verdana, sans-serif', text: self.lng['reg'+o.n] + "\n" + self.lng.projects + ": " + (o.n in proj_counts ? proj_counts[o.n] : 0) }); }, 50); } this.drawObject = function( n ){ var obj_bg = { layer: true, index: 1, name: 'bg' + n, groups: ['BACKS'], strokeStyle: self.borders_color, strokeWidth: 1, fillStyle: self.default_bg, closed: true }, obj_act = { layer: true, name: 'act' + n, groups: ['ACTIONS'], strokeStyle: "rgba(0,0,0,0)", strokeWidth: 1, fillStyle: "rgba(0,0,0,0)", closed: true, data: this.objects[n], mouseover: self.obj_mouseover, mouseout: self.obj_mouseout, click: self.obj_click } for (var i=0; i < this.objects[n].points.length; i++) { obj_bg['x'+(i+1)] = obj_act['x'+(i+1)] = this.objects[n].points[i][0]; obj_bg['y'+(i+1)] = obj_act['y'+(i+1)] = this.objects[n].points[i][1]; } $('#'+self.idCanvas).drawLine(obj_bg).drawLine(obj_act); } this.obj_mouseover = function( layer ){ $(this).animateLayer( 'bg' + layer.data.ind, { fillStyle: self.hightlight_bg, strokeStyle: self.hightlight_borders }, self.hightlight_duration); setTimeout(function(){ $('#' + self.idCanvas).css({'cursor':'pointer'}); },50); self.drawTooltip( layer.data.ind ) } this.obj_mouseout = function( layer ){ $(this).animateLayer( 'bg' + layer.data.ind, { fillStyle: self.default_bg, strokeStyle: self.borders_color }, self.hightlight_duration); $('#' + self.idCanvas).css({'cursor':'default'}); $('#'+self.idCanvas).removeLayerGroup('Tooltip'); } this.obj_click = function( layer ){ if( /\/nir\//.test(location.href) ){ return; } if( 'url' in layer.data && layer.data.url.length ){ location.href = "/" + self.lang + layer.data.url; } } self.init(); }