/********************************* AJAX - ZAKLAD ******************************/
function vytvorXMLHttpRequest2(handler) {
  if (window.XMLHttpRequest) {
    xmlHttp = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    try {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (error) {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  return xmlHttp;
}
/****************************** KONEC AJAX - ZAKLAD ***************************/
function del_this_value(elm, typ) {
  if (typ == 'jmeno') {
    if (elm.value == 'Jméno') {
      elm.value = '';
    }
  }
  if (typ == 'heslo') {
    if (elm.value == 'Heslo') {
      elm.value = '';
    }
  }
}



/**
 *******************************************************************************
 **/

function openWin(url, winWidth, winHeight, winRes) {
  if (winRes==1) {
    stat = "resizable=1,scrollbars=1";
  } else {
    stat = "resizable=0,scrollbars=0";
  };
  // calculate centered window position
  winLeft = Math.round((screen.width-winWidth)/2);
  winTop  = Math.round((screen.availHeight-winHeight)/2);
  winDef = "left="+winLeft+",top="+winTop+",height="+winHeight+",width="+winWidth+",directories=no,location=no,menubar=no,status=no,toolbar=no,"+stat;
  window.open(url, "", winDef);
  return true;
}

//vyskakovaci okno s dotazem na aktualni cenu produktu
function cena(produkt) {
  openWin('dotaz-na-cenu.php?vyrobek='+produkt, 600, 360, 0);
  return false;
}

