﻿ieHover = function() 
{
  var li = document.getElementById('navigation').getElementsByTagName('LI');
  for (var i=0; i< li.length; i++) 
    if( li[i].className != 'alone' )
    {
      li[i].onmouseover = function() {  this.className += "iehover" }
      li[i].onmouseout  = function() {  this.className = this.className.replace(new RegExp("iehover"), "") }
    }

  var a = document.getElementById('header').getElementsByTagName('A');
  for (var i=0; i < a.length; i++) 
    a[i].onfocus = function() { this.blur() }

  if( document.getElementById('location') )
  {
    var a = document.getElementById('location').getElementsByTagName('A');
    for (var i=0; i < a.length; i++) 
      a[i].onfocus = function() { this.blur() }
  }

  if( document.getElementById('menu') )
  {
    var a = document.getElementById('menu').getElementsByTagName('A');
    for (var i=0; i < a.length; i++) 
      a[i].onfocus = function() { this.blur() }
  }
}

if (window.attachEvent && /MSIE (5|6).+Win/.test(navigator.userAgent) )
  window.attachEvent("onload", ieHover);

function show_map()
{
  var w = 565 ;
  var h = 396 ;

  var cWidth = 0, cHeight = 0;
  
  if (typeof(window.innerWidth) == 'number') 
  {
    cWidth = window.innerWidth;
    cHeight = window.innerHeight;
  } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
    cWidth = document.documentElement.clientWidth;
    cHeight = document.documentElement.clientHeight;
  } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
    cWidth = document.body.clientWidth;
    cHeight = document.body.clientHeight;
  }

  var scrOfX = 0, scrOfY = 0;

  if(typeof(window.pageYOffset) == 'number') 
  {
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }

  w += 60;
  h += 60;

  var wc = parseInt((cWidth-w)/2)+ scrOfX + 30;
  var hc = parseInt((cHeight-h)/2) + scrOfY ;

  document.getElementById('popup').style.top     = hc + "px"; 
  document.getElementById('popup').style.left    = wc + "px"; 
  document.getElementById('popup').style.width   = w + "px"; 
  document.getElementById('popup').style.height  = h + "px"; 
  document.getElementById('popup').style.display = 'block';

  document.getElementById('pimg').style.display = 'none';

  var isrc = 'http://'+window.location.host+'/p/map_full.gif';

  if( document.getElementById('pimg').src != isrc )
  {
    document.getElementById('pimg').onload = function() { this.style.display = 'block' }
    document.getElementById('pimg').src   = '/p/map_full.gif';
  }
  else
    document.getElementById('pimg').style.display = 'block';

  return false ; 
}

function hf()
{
  document.getElementById('popup').style.display = 'none';
}

function write_lic(){
 document.write('<a href="http://www.liveinternet.ru/click" '+
 'target="_blank"><img src="http://counter.yadro.ru/hit?t52.6;r'+
 escape(document.referrer)+((typeof(screen)=='undefined')?'':
 ';s'+screen.width+'*'+screen.height+'*'+(screen.colorDepth?
 screen.colorDepth:screen.pixelDepth))+';u'+escape(document.URL)+
 ';'+Math.random()+
 '" title="" '+'border="0" width="88" height="15" alt=""></a>')//--></script>
}
