

// <!-- hide
function getBounds(element){ var left = element.offsetLeft;  var top = element.offsetTop;
  for (var parent = element.offsetParent; parent; parent = parent.offsetParent)
  { left += parent.offsetLeft - parent.scrollLeft; top += parent.offsetTop - parent.scrollTop  }
  return {left: left, top: top, width: element.offsetWidth, height: element.offsetHeight};
}

function isChrome() {
var is_chrome = false, chrome_version = false;
if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
       is_chrome = true;
       chrome_version = navigator.userAgent.replace(/^.*Chrome\/([\d\.]+).*$/i, '$1') }
  return is_chrome;     
}

function initMenu() {    /* $('#menu ul').hide();  $('#menu li a').click( function() {$(this).next().slideToggle('normal');  } );   */
  $('#menu ul').hide(); 
  $('#menu li a').click( function() {
	var checkElement = $(this).next();
    if((checkElement.is('ul')) && (checkElement.is(':visible'))) {return false;}
    if((checkElement.is('ul')) && (!checkElement.is(':visible'))) { $('#menu ul:visible').slideUp('normal'); checkElement.slideDown('normal'); return false; }
   });
}

function reset_qs(k) { 
     $("."+k).val('').focus().keydown(); }    
		
function init_f() {
     $("div#reklama").corner("10px");
     $("div.phones").corner("15px"); 
     $("div.info").corner("tl bl br 15px"); $("div.theader").corner('tl tr 15px'); 
     $(".toggle-link, #unfold-all").hover( function(){ $(this).toggleClass('toggle-link-hover'); }, function(){  $(this).toggleClass('toggle-link-hover'); });
     $(".toggle-st").click( function(){ $(this.getElementsByTagName("div")[0]).toggle()  });
      $("#unfold-all").click( function(){ 
          if ( $(this).html() == '[ + развернуть всё ]') { $(".hdoc").show(); $(this).html('[ – свернуть всё ]'); } else  { $(".hdoc").hide(); $(this).html('[ + развернуть всё ]'); }  } );
}

function jq_init() { 

$("div#reklama").everyTime(1000, "timer1", function(i) { $(this).fadeTo("fast","0.3"); $(this).fadeTo("normal","1"); }, 5);   

    init_f();      initMenu();

     
	/* detect IE6 - борьба с отсутствием кеширования фоновых картинок*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand;
	try {	if(!!m){	m("BackgroundImageCache", false, true) /* = IE6 only */ }	}
	catch(oh){}; 
   
     // var ibr = Math.floor( Math.random() * 4 ) + 1;      
     var ibr = 1; 
     sb = "url(/images/top-banner/top-"+ibr+".jpg) top left no-repeat";      
     $("div#topfield").css("background",sb);
     
     // если нажали на баннер "Кадастровые работы"
     if (ibr==1) { $("table#banner, div#topfield").click( function(){ document.location.href = "cadastre.html"; }); }

     // если нажали на баннер "ИСОГД МунГИС"
     if (ibr==2) { $("table#banner, div#topfield").click( function(){ document.location.href = "isogd.html"; }); }

     // если нажали на баннер "Увеличение участка юридического лица"
     if (ibr==3) { $("table#banner, div#topfield").click( function(){ document.location.href = "uvelichenie-uchastka.html"; }); }

     // если нажали на баннер "Льготный выкуп"
     if (ibr==4) { $("table#banner, div#topfield").click( function(){ document.location.href = "lgotnyi-vykup.html"; }); }

     // если нажали на баннер "Дачная амнистия - прирезка участка"
     if (ibr==5) { $("table#banner, div#topfield").click( function(){ document.location.href = "dachnaya_amnistiya.html"; }); }

     $("div#topfield").everyTime(3000, "timer1", function(i) { 
                    ibr = ibr+1;      
                    if (ibr > 5) { ibr = 1; }
                    
                    sb = "url(/images/top-banner/top-"+ibr+".jpg) top left no-repeat";      
                     
                     $("div#topfield").css("background",sb);
     
                     // если нажали на баннер "Кадастровые работы"
                     if (ibr==1) { $("table#banner, div#topfield").click( function(){ document.location.href = "cadastre.html"; }); }

                     // если нажали на баннер "ИСОГД МунГИС"
                     if (ibr==2) { $("table#banner, div#topfield").click( function(){ document.location.href = "isogd.html"; }); }

                     // если нажали на баннер "Увеличение участка юридического лица"
                     if (ibr==3) { $("table#banner, div#topfield").click( function(){ document.location.href = "uvelichenie-uchastka.html"; }); }

                     // если нажали на баннер "Льготный выкуп"
                     if (ibr==4) { $("table#banner, div#topfield").click( function(){ document.location.href = "lgotnyi-vykup.html"; }); }

                     // если нажали на баннер "Дачная амнистия - прирезка участка"
                     if (ibr==5) { $("table#banner, div#topfield").click( function(){ document.location.href = "dachnaya_amnistiya.html"; }); } 
              }, 0);   
     

    $("#odin-region-parts-map img").lazyload({  effect:"fadeIn", placeholder: "/images/grey.gif" }); 
      $("a.highslide img, img.rp, a.order img").lazyload({  effect:"fadeIn", placeholder: "/images/grey.gif" }); 

   
     $("a, table, h1, h2, h3").not(".img-t, .hl, acronym, #hl").tooltip({track: false, delay: 999999, showURL: false });  
      $("span:contains(411-10-22), span:contains(627-627), .anton").attr('title','<div class=c><b class=b>Для крупных Заказчиков и юридических лиц.</b><br> Увеличение участков, кадастровые работы, межевание, геодезия.</div>');

      $("span:contains(понедельник – пятница)").attr('title','<div class=c><b class=b>Внимание!</b> Мы <b>не</b>&nbsp;Кадастровая и <b>не</b>&nbsp;Регистрационная палата! И справок по их работе не&nbsp;даём.</div>');

  //    $("span:contains(info@ric-geo.ru)").attr('title','<div class=c><b class=b>Общая почта для консультаций.</b> Для получения максимально быстрого и корректного ответа не забудьте перечислить <u>все</u> документы на участок, которые у Вас имеются (с указанием их даты). <br>В теме письма укажите, какому менеджеру адресовано Ваше письмо.<br><b>Обязательно оставьте контактный телефон и имя!</b></div>');

     $("span:contains(642-36), .odintsovo").attr('title','<div class=c><b class=b>Районы Московской области:</b> Одинцовский, Красногорский, Звенигородский, Химкинский, Наро-Фоминский, Можайский.</div>');
     $("span:contains(649-94-07)").attr('title','<div class=c><b class=b>Вопросы по регистрации недвижимости:</b> Одинцовский, Красногорский, Звенигородский, Химкинский, Наро-Фоминский и Можайский районы Подмосковья.</div>');
     $("span:contains(642-35), .istra").attr('title','<div class=c><b class=b>Районы Московской области:</b> Истринский, Солнечногорский, Клинский, Волоколамский, Рузский, Шаховской, Лотошинский.</div>');
     $("span:contains(641-77-41), .geoagent").attr('title','<div class=c><b class=b>Районы Московской области:</b> Мытищинский, Дмитровский, Щёлковский, Пушкинский, Балашихинский, Ногинский, Павлово-Посадский, Сергиево-Посадский, Талдомский, Ленинский, Люберецкий, Подольский, Ступинский, Домодедовский, Воскресенский, Коломенский, Чеховский, Серпуховской, Раменский.</div>');

    $("acronym,.anton,.geoagent,.istra,.odintsovo,span:contains(627-627),span:contains(411-10-22), span:contains(642-36), span:contains(642-35),span:contains(info@ric-geo.ru), span:contains(649-94-07), span:contains(641-77),span:contains(понедельник – пятница)").tooltip({track: true, delay: 50, showURL: false, left: -100, fade: false, extraClass: "simple" });  

       $("a.dop").attr("title","развернуть...").append("&nbsp;&nbsp;<img src='/images/plus.png' style='vertical-align: middle;'>&nbsp;").click(function() { if ($(this).next("div").hasClass("hide")) { $(this).next("div").slideDown("normal").toggleClass("hide"); $(this).attr("title","cвернуть..."); } else { $(this).next("div").hide().toggleClass("hide"); $(this).attr("title","развернуть...");} return false; });
     
      $("img[@src*=text.png]").parent().not("tr,td").attr('title','Читать...').attr('alt','Читать...');
      $("img[@src*=rar.png]").parent().not("tr,td").attr('title','Скачать в формате WinRAR').attr('alt','Скачать в формате WinRAR');
     $("img[@src*=pdf.png]").parent().not("tr,td").attr('title','Скачать в формате Adobe Acrobat (pdf)').attr('alt','Скачать в формате Adobe Acrobat (pdf)');   
      $("img[@src*=word.png]").parent().not("tr,td").attr('title','Скачать в формате Microsoft Word (doc)').attr('alt','Скачать в формате Word (doc)');   

      $("div#logo").click(function() { document.location.href = "/";});
 
    $("#tabs > ul").tabs({ fxFade: true, fxSpeed: 'fast' });
  
    $("table.olist tr:nth-child(even)").addClass("odd");
    $("table.olist2 tr:nth-child(even)").addClass("odd");
    $("table.olist3 tr:nth-child(even)").addClass("odd");
    
      $("div#rsb").bind("click", function(){ document.location = 'nedv.html'; } ); 

      $("#ask, .feedback").attr({href: "_feedback.html",title:"Напишите свой вопрос и оставьте контактные данные"}).click(function() { return hs.htmlExpand(this, { objectType: 'ajax', contentId: 'sendform', dimmingOpacity: '0.7' }); }); 

      $("#ask-job").attr({href: "_feedback-job.html",title:"Заявка на трудоустройство"}).click(function() { return hs.htmlExpand(this, { objectType: 'ajax', contentId: 'sendform', dimmingOpacity: '0.7' }); }); 

/*  $("div#topmenu").dropShadow({left: 0, top: 1, blur: 2, opacity: 1}); */
     $(".top_text span").not("span:contains(понедельник), span:contains(+7)").dropShadow({left: 0, top: 1, blur: 2, opacity: 1});
     /* $("h1").dropShadow({left: 0, top: -16, blur: 1, opacity: 1});      */          

}

function hs_init() { 
    hs.graphicsDir = 'highslide/graphics/';
    hs.expandCursor = 'zoomin.cur';  hs.restoreCursor = 'zoomout.cur'; hs.numberOfImagesToPreload = 5;
    hs.wrapperClassName ='dark'; 	hs.outlineType = 'rounded-black';  hs.dimmingOpacity = 0.8; 
    hs.expandDuration = 250; hs.restoreDuration = 250;
    hs.marginLeft = 15;  hs.marginRight = 15;  hs.marginTop = 15;  hs.marginBottom = 15;  hs.zIndexCounter = 1001;  hs.loadingOpacity = 0.75;
    hs.allowMultipleInstances= true; hs.outlineWhileAnimating = 2;  hs.outlineStartOffset = 3; 
    hs.padToMinWidth = false; hs.fullExpandPosition = 'bottom right'; hs.showCredits = true; hs.creditsHref = 'http://ric-geo.ru';
 	hs.align = 'center'; hs.transitions = ['expand', 'crossfade']; hs.fadeInOut = true;

	hs.lang = {cssDirection:'ltr', loadingText : 'Загрузка...', loadingTitle : 'Клик для отмены', focusTitle : 'Вывести на ближний план', fullExpandTitle : 'Расширить до реального размера (f)', creditsText : '~ РИЦ-ГЕО ~', creditsTitle : 'РИЦ-ГЕО: регистрация недвижимости, быстрое оформление земли в Подмосковье, купля-продажа земельных участков, домов, коттеджей, оформление документов, сопровождение сделок, кадастровые работы, инженерно-геодезические изыскания, топосъемка, землеустройство, межевание, межевой план, увеличение и раздел участка, градостроительный план, получение разрешения на строительство, ввод домов в эксплуатацию, БТИ,  инвентаризация земель поселений, увеличение сбора земельного налога', previousText : '<<', nextText : '>>', moveText : 'Двигать', closeText : 'Закрыть', closeTitle : 'Закрыть (Esc)', resizeTitle : 'Размер', playText : 'Авторежим', playTitle : 'Слайд-шоу (пробел)', pauseText : 'Пауза', pauseTitle : 'Приостановить слайдшоу (пробел)', previousTitle : 'Назад', nextTitle : 'Вперёд', moveTitle : 'Переместить окно', fullExpandText : 'Полный размер', number: 'Фото %1 of %2', restoreTitle : 'Клик, чтобы закрыть окно. Нажмите и двигайте мышь, чтобы переместить окно. Влево / Вправо – смена изображений.'};
}

function nav(url) 
{ 	document.location.href = url; }

function insert_email(left_side) { 
    var email = left_side + String.fromCharCode(64,114,105,99,45,103,101,111,46,114,117);
    s = '<a class="hq" href="mailto:'+email+'">'+email+'</a>';
    document.write(s);
}


function extlink(num) {
  var addr='';
	if (num==0) { addr = 'http://ric-geo.ru'; }
	if (num==1) {  addr = 'mailto:info@ric-geo.ru'; }
	if (num==2) { addr = 'mailto:admin@ric-geo.ru'; }
  	if (num==3) { addr = 'contacts.html'; }
  	if (num==4) { addr = 'http://c-geo.ru'; } 
  	if (num==5) { addr = 'http://geo-agent.ru'; }
  	if (num==6) { addr = 'http://ric-istra.ru'; }
    if (addr!='') {  var _w = null;   
       _w = window.open(addr,"_w", "toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, resizable=yes, copyhistory=yes, scrollbars=yes, fullscreen=yes");  } 
}

function uplink(txt) { 
		document.write("<p class='up'><a href='#' onClick='scroll(0,0); return false' title='наверх'><img src='/images/up.gif' border='0' width='9' height='10' alt=''>&nbsp;"+txt+"&nbsp;<img src='/images/up.gif' border='0' width='9' height='10' alt=''></a></p><br>");
}

function contacts() {  s = "<div><span class='fs f10'>&#8667;&nbsp;</span>&nbsp;<a href='contacts.html' class='fc' title='Ответы на Ваши вопросы – здесь!'>контакты</a><br><br><span class='tab'></span><span class='s4 f13'>+7</span><span class='s5 f14'> (495) </span><br><span class='s6 f16'> 642-36-64 </span></div>";  document.getElementById("phone").innerHTML = s; }

function weather(d) { s = "<a class='img-t' target='_blank' href='http://clck.yandex.ru/redir/dtype=stred/pid=7/cid=1228/*http://weather.yandex.ru/index.xml?city=27517'><img src='http://info.weather.yandex.net/informer/120x156/27517.png' border='0' alt='Яндекс.Погода'/><img width='1' height='1' src='http://clck.yandex.ru/click/dtype=stred/pid=7/cid=1227/*http://img.yandex.ru/i/pix.gif' alt='' border='0'/></a>";
    if (d == 'vert') { s += "<br><br>" } else { s += "<span class='tab3'></span>" };  
    s += "<a class='img-t' target='_blank' href='http://clck.yandex.ru/redir/dtype=stred/pid=7/cid=1228/*http://weather.yandex.ru/index.xml?city=27612'><img src='http://info.weather.yandex.net/informer/120x156/27612.png' border='0' alt='Яндекс.Погода'/><img width='1' height='1'src='http://clck.yandex.ru/click/dtype=stred/pid=7/cid=1227/*http://img.yandex.ru/i/pix.gif' alt='' border='0'/></a>"; 
       document.write(s); }

function euro_usd(d) {   s = "<a class='img-t' target='_blank' href='http://www.informer.ru/cgi-bin/redirect.cgi?id=1_1_1_19_2_2-0&url=http://www.rbc.ru&src_url=usd_nal_8831_11.gif'><img src='http://pics.rbc.ru/img/grinf/usd_nal_8831_11.gif?'"+ Math.floor( 100000*Math.random() ) + " width=88 height=31 border=0></a>";
    if (d == 'vert') { s += "<br><br>" } else { s += "<span class='tab'></span>" }; 
  s += "<a class='img-t' target='_blank' href='http://www.informer.ru/cgi-bin/redirect.cgi?id=191_1_1_56_2_2-0&url=http://www.rbc.ru&src_url=eur_nal_8831_8.gif'><img src='http://pics.rbc.ru/img/grinf/eur_nal_8831_8.gif?'"+ Math.floor( 100000*Math.random() ) + " width=88 height=31 border=0></a>";
       document.write(s); } 
       
function traffic() {  s = "<a class='img-t' target='_blank'  href='http://clck.yandex.ru/redir/dtype=stred/pid=30/cid=533/*http://maps.yandex.ru/moscow_traffic' style='background-image:url(http://clck.yandex.ru/click/dtype=stred/pid=30/cid=529/*http://ya.ru)'><img src='http://info.maps.yandex.net/traffic/moscow/current_traffic_120.gif' alt='Пробки на Яндекс.Картах' /></a>"; 
       document.write(s);} 

// -->
