function otworzOkno(url, width, height) {
        var Win = window.open(url,'_blank','width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no' );
}

function pokazProdukt(url, width, height) {
        var Win = window.open(url,'_blank','width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no' );
}

function wyslij(form) {
         form.target = window.opener.name;
        form.submit();
        setTimeout('window.close()', 1000);
}

function sprawdzilosc(form) {
       if (form.produkt_ilosc.value=='' || isNaN(form.produkt_ilosc.value) || form.produkt_ilosc.value <= 0) {
              alert ( 'Ilość musi być > 0!' );
              form.produkt_ilosc.focus();
              return false;
       }
       if (form.produkt_ilosc.value > 99) {
              alert ( 'Maksymalna ilość to 99!' );
              form.produkt_ilosc.focus();
              return false;
       }       
       return true;
}

function aktualizujilosc(form, wejscie) {
        if (! sprawdzilosc(form)) {
           form.produkt_ilosc.value=wejscie;
           form.produkt_ilosc.focus();
           return false;
        }
        form.submit();
}

function aktualizujrozmiar(url) {
        if (url != '') window.location=url;
}

function autotab (original, destination) {
       if (original.getAttribute && original.value.length == original.getAttribute ("maxlength")) destination.focus();
}
function sprawdz(form) {
       if ( form.login.value == '' ) {
              alert ( 'Wypełnij pole TWÓJ LOGIN!' );
              form.login.focus();
              return false;
       }
       if ( form.haslo.value == '' ) {
              alert ( 'Wypełnij pole HASŁO!' );
              form.haslo.focus();
              return false;
       }
       return true;
}
function wyslij_formularz(form_id){
if(sprawdz(document.getElementById(form_id)))
document.getElementById(form_id).submit();
}
function sprawdz_login(form) {
       if ( form.login.value == '' ) {
              alert ( 'Wypełnij pole TWÓJ LOGIN!' );
              form.login.focus();
              return false;
       }
       return true;
}
function drukuj(url, width, height) {
        var Win = window.open(url,'_blank','width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no' );
}
function pokazHaslo(url, width, height) {
        var Win = window.open(url,'_blank','width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no' );
}
function keyInfo(evnt) {
 if (document.all)
  Key = evnt.keyCode;
 else
  Key = evnt.which;
 if(Key == 13)return true;
}


