function checksizeandtype(id, size, typ, maxx, maxy) {
  var obj = document.getElementById(id);
	var chyba = '';
  var img;
    
  // kontrola velikosti
  if (obj.value != "") {
  	img = document.getElementById('img'+id);
  	img.src = 'file:///' + obj.value;

    if (size > 0 && parseInt(img.fileSize) > size) {
      chyba = 'Vložený soubor je příliš velký!' + "\n";
    }
  }
  
  // kontrola typu
  if (typ) {
    var s = new String();
    s = typ;
    typy = s.split(',');
    var jetam = false;
    for (i = 0; i < typy.length; i++) {
      if ((obj.value.toLowerCase()).indexOf(typy[i]) > 0) {
        jetam = true;
        break; 
      }
    }
  
    if (!jetam) {
      if (chyba) {
        chyba += "\n";
      }
      chyba += 'Vložený soubor není požadovaného typu!';
    }
  }

  if (chyba) {
    alert(chyba);
    return false;
  } else {
    return true;
  }
}

function odvyberselect(id) {
  var sel = document.getElementById(id);
  sel.selectedIndex = -1;
}