// JavaScript Document

//PREINI
var W3CDOM = (document.createElement && document.getElementsByTagName);

if (window.attachEvent) {
  window.attachEvent('onload', init);
} else if (window.addEventListener) {
  window.addEventListener('load', init, false);
}


//FUNCTIONS


function init () {
  if (!W3CDOM) return;
  like_yandex();
}
//end init

function OpenActiveMenu() {
  return;
}
//end OpenActiveMenu

function like_yandex(){
  frm = document.getElementsByTagName('FORM');
  txt=[],inp=[];
  for (var i = 0; i < frm.length ; i++) {
    if (frm[i].className == 'common_ofm') {
    txt[i] = frm[i].getElementsByTagName('LABEL')[0];
    inp[i] = frm[i].getElementsByTagName('INPUT')[0];
    txt[i].number = i;
    inp[i].number = i;
    txt[i].style.position = 'absolute';
    txt[i].style.top = '2px';
    txt[i].style.left = '0';
    txt[i].style.cursor = 'text';
    txt[i].onclick = getLabel;
    inp[i].onblur = backToLabel;
    }
  }
}
//end like_yandex

function getLabel(){
    this.style.display = 'none';
  }
//end getLabel

function backToLabel(){
  if ( !inp[this.number].value ) {
   txt[this.number].style.display = 'block';
  }
}
//end backToLabel


function SetFavorites(url, title) {
  if (window.sidebar) { // Mozilla Firefox Bookmark
    window.sidebar.addPanel(title, url, '');
  }
  else if (window.opera && window.print) { // Opera
    document.getElementById('favor').rel = "sidebar";
    document.getElementById('favor').title = title;
    document.getElementById('favor').href = url;
  }
  else if (document.all) { // IE Favorite
    window.external.AddFavorite(url, title);
  }
}
//end SetFavorites
