function openChangeNote(href) {
  window.open(href, null, "status=no, toolbar=no, menubar=no, scrollbars=no, resizable=no, width=400, height=200");
}

function openVubPay(href) {
  window.open(href, null, "status=yes, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, width=780, height=400");
}

function openUniplatba(href) {
  window.open(href, null, "toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes, width=700, height=500");
}

function openGoodsBuyForm(href) {
  window.open(href, null, "status=no, toolbar=no, menubar=no, scrollbars=no, resizable=no, width=400, height=200");
}

function remove(basketItemID) {
  document.forms['change' + basketItemID].goodsCount.value = 0;
  document.forms['change' + basketItemID].submit();
}

function openHelp(destination) {
  window.open(destination, null, "status=no, toolbar=no, menubar=no, scrollbars=no, resizable=no, width=510, height=400");
}

function closeTip () {
  document.all.tipBar.style.display = 'none';
}

function openTip (code, sid) {
  document.all.tipBar.style.display = '';
  if (document.all.tipData.dataInside == 0) {
    document.all.tipBarFrame.src = 'load_tips.php?' + sid + '&code=' + code;
  }
}

function setShowTip(sid) {
  if (document.all.showCheck.checked) {
    show = 1;
  } else {
    show = 0;
  }
  document.all.tipBarFrame.src = 'set_tips.php?' + sid + '&show=' + show;
}

function openSearch () {
  document.all.searchBar.style.display = '';
}

openedBar = null;

function changeBar(name) {
  try {
    if (openedBar != null) {
      document.getElementById(openedBar).style.display = 'none';
    }
    if (openedBar == name)
      openedBar = null;
    else {
      openedBar = name;
      document.getElementById(openedBar).style.display = 'block';
    }
  } catch (e) {
  }
//  return false;
}

function showHideYear(src) {
  if (src.firstChild.selected == true) {
    document.getElementById("year").style.display = 'none';
  } else {
    document.getElementById("year").style.display = 'inline';
  }
}

function unsetText(src, defaultText) {
  if (src.value == defaultText) {
    src.value = "";
  }
}

function setText(src, defaultText) {
  if (src.value == "") {
    src.value = defaultText;
  }
}

var oldWindow = null;
function showGoods(image, width, height) {
  if (oldWindow != null) {
    try {
      oldWindow.close();
    } catch (e) {}
  }
  oldWindow = window.open(image, "_blank", "status=no, toolbar=no, menubar=no, scrollbars=no, resizable=no, width=" + width + ", height=" + height);
}

function unloadImage() {
  if (oldWindow != null) {
    oldWindow.close();
  }
}
function closeInfo(id) {
  document.getElementById(id).style.display = "none";
}

function showHelp(link) {
  window.open(link, null, "status=no, toolbar=no, menubar=no, scrollbars=no, resizable=no, width=300, height=200");
}

function openCommentWindow(link) {
  window.open(link, null, "status=no, toolbar=no, menubar=no, scrollbars=no, resizable=no, width=600, height=400");
}

function addComment(link) {
  completeLink = link;
  completeLink += "&name=" + document.getElementById("name").value;
  completeLink += "&email=" + document.getElementById("email").value;
  completeLink += "&value=" + document.getElementById("value").value;
  completeLink += "&text=" + document.getElementById("text").value;
  window.opener.document.location = completeLink;
  window.close();
}