/*
  Podglad
*/
function podglad(t, p, w, h) {
  param = "status=no, toolbar=no, resizable=yes, width="+ w +", height="+ h;
  param = "toolbar=no, menubar=no, width="+(w+20)+", height="+(h+20)+", scrollbars=yes, status=no, resizable=no";
  okno = window.open("", "", param);
  html = "<html><head><meta http-equiv='Content-type' content='text/html; charset=iso-8859-2'><title>"+t+"</title><meta http-equiv='imagetoolbar' content='no'></head><body style='margin:0px'><img onclick='window.close()' src='"+p+"' alt='Naci¶nij by zamkn±æ'></body></html>";
  okno.document.write(html);
  okno.document.close();
  okno.focus();
}
function idz_porownaj(tem) {
//echo "<form name='form_".$tem."' method='POST' action='?compare'>";
  var str = "";
  for(i=0;i<arr_id.length;i++) {
    str = str + "_" + arr_id[i];  
  }
  document.form_compare.f_ids.value = str;
  document.form_compare.f_tem.value = tem;
  document.form_compare.submit();
}
/*
*/
arr_id = [];
function porownaj_click(id, tem, obj) {
  var jest = "";
  
  for(i=0;i<arr_id.length;i++) {
    if ((arr_id[i]==(id+";"+tem))) {// && (obj.checked==false))
      arr_id[i] = (obj.checked?id:"0")+";"+tem;
      jest=true;
      break;
    }
  }
  if (jest==false)
    arr_id.push((obj.checked?id:"0")+";"+tem);
/*  
  for(i=0;i<arr_id.length;i++) {
    str = str + "_" + arr_id[i];  
  }
  alert("Tablica: "+str);
*/
}

/*
  Podglad
*/
function podglad_all(adres) {
  okno = window.open(adres, "", "toolbar=no, menubar=no, scrollbars=yes, width=700, height=520");
  okno.focus();
}
/*
function makeArray(w, k) { 
     ar = new Array(w); 

     for (i=0; i<w;i++) 
         ar[i]=new Array(k); 

     return ar; 
} 
*/
/*
  lista zakupow
*/
function lista_zakupow() {
  okno = window.open("shoppinglist.php", "", "width=720, toolbar=no, menubar=no, scrollbars=yes, status=no, resizable=yes");
  okno.document.write(html);
  okno.document.close();
  okno.focus();
  
}

/**/
function find_area_place() {
  location.href="?plc="+document.form_places.f_place_and_area.value;
}

/**/
function find_area_place_person() {
  location.href="index.php?person&plc="+document.form_wyslij.f_place_and_area.value;
}


/**/
function check_all_cart() {
//alert("sdafg");
  for(i=0;i<document.form_edit_cart.elements.length;i++) {
    var e = document.form_edit_cart.elements[i];
    if (e.type == 'checkbox') { 
      //document.form_edit_cart.elements[i].checked;
      if (e.checked==true)
        e.checked = false;
      else
        e.checked = true;
    }
  }
}

/*
  slownik(temat)
  Otwiera plik adm_help.php i wyswietla okreslon± podpowiedz
*/
function slownik(temat) {
  var okienko = window.open("adm/adm_help.php?temat="+temat, "", "toolbar=no, menubar=no, width=500, height=320");
  okienko.focus();
}
