function _id(id) { // zwraca element po id, skrót
  return document.getElementById(id);
}

function gcs(id) { // pobiera aktualny styl elementu
  if (window.getComputedStyle) return window.getComputedStyle(_id(id),null);
  else return _id(id).currentStyle;
}

function switchPanel(buttonId, bgOffset, panel1Id, panel2Id) {
  if (gcs(panel1Id).display == 'block') {
    _id(buttonId).style.backgroundPosition = bgOffset;
    _id(panel1Id).style.display = 'none';
    _id(panel2Id).style.display = 'block';
  }
  else {
    _id(buttonId).style.backgroundPosition = '0px 0px';
    _id(panel1Id).style.display = 'block';
    _id(panel2Id).style.display = 'none';
  }
}

function popup(url,w,h) {
  var win = window.open(url,'displayWindow','width='+w+',height='+h+',top=20,resizable=1,scrollbars=yes,menubar=no');
  win.focus();
}

$(document).ready(function() {
  $('#main_bottom').before($('#search_main'));
  $('#search_quick').after($('#main_bottom'));
});