var searchText = "Поиск на сайте";
var subscribeText = "Ваш E-mail";
function checkFlash() {
   var flash_versions = 20; var flash_installed = 0; var flash_version = '0.0'; var java_installed = 0;
   if (navigator.plugins && navigator.plugins.length) {  // Netscape style plugin detection
      for (x = 0; x < navigator.plugins.length; x++) {
         if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
            flash_version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
            flash_installed = 1;
            break;
         }
      }
      for (x = 0; x < navigator.plugins.length; x++) {
         if (navigator.plugins[x].name.indexOf('Java(TM)') != -1) {
            java_installed = 1;
            break;
         }
      }
   }
   else if (window.ActiveXObject) {  // ActiveX style plugin detection
      for (x = 2; x <= flash_versions; x++) {
         try {
            oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
            if (oFlash) {
               flash_installed = 1;
               flash_version = x + '.0';
            }
         }
         catch(e) { }
      }
   }
   return flash_installed;
}

var isFlash = checkFlash();

var hmVertShift = 18;
var d = document;
function GEByID(id) { return d.all ? d.all[id] : d.getElementById(id); }
function hmDivOn(id) { id.style.visibility = 'visible'; }
function hmDivOff(id) { id.style.visibility = 'hidden'; }
function hmx(e) { return e.offsetLeft+(e.offsetParent!=null&&e.tagName!='BODY'?hmx(e.offsetParent):0); }
function hmy(e) { return e.offsetTop+(e.offsetParent!=null&&e.tagName!='BODY'?hmy(e.offsetParent):0); }
function hmOff(id) { var e = GEByID(id); e.style.visibility = 'hidden'; }
function hmOn(id,parent,leftOff,topOff) { var e = GEByID(id); e.style.left = hmx(parent)+leftOff; e.style.top = hmy(parent)+hmVertShift+topOff; e.style.visibility = 'visible'; }

function fnCheckSearchForm(f) {
   if (!f.search.value.match(/^.+$/)) {
      alert("Укажите поисковый запрос!");
      f.search.focus();
      return false;
   }
   return true;
}

function fnCheckSubscribeForm(f) {
   if (!f.email.value.match(/^[0-9A-Za-z._-]+@([0-9a-z_-]+\.)+[a-z]{2,4}$/)) {
      alert("Укажите правильно Ваш e-mail!");
      f.email.focus();
      return false;
   }
   return true;
}