
// dotaz na potvrzeni smazani zaznamu
function delCommit(){
    var pokracovat = confirm("Opravdu chcete smazat tento záznam?");
    return pokracovat;
} 

var gotoHand = null;
// nastavi nazev v poly txtNazev vlozeneho souboru
function gotoLink(url){
  var width = 800;
  var height = 600;
  
  if (gotoHand != null) gotoHand.close();
  gotoHand = window.open(url,'winGo','width='+ width +',height='+ height +',toolbar=yes,menubar=yes,scrollbars,resizable=yes,left=50,top=50');
  gotoHand.focus();  
  return true;
}

function eshopWindow(url) {
  if (gotoHand != null) gotoHand.close();
  gotoHand = window.open(url,'winGo',"width=800,height=600,location=1,menubar=1,resizable=1,scrollbars=1,status=true,titlebar=yes,toolbar=1");
  gotoHand.focus();
  return true;
}

// nastavi nazev v poly txtNazev vlozeneho souboru
function fillName(value){
		nazev = document.getElementById('txtNazev');
		if (nazev && nazev.value.length <1 ){
			start=value.lastIndexOf('\\');
			tmp=value.substring(start+1, value.length);
			nazev.value=tmp;
		}
}

var winHand = null;
// otevre nove okno s obrazkem
function imgWindow(url) {
  imgObj = new Image();
	imgObj.src = url;
	imgObj.onload=function(){
    //alert(imgObj.width);
    var width = imgObj.width+30;
    var height = imgObj.height+30;
    
    if (winHand != null) winHand.close();
    winHand = window.open(url,'winImg','width='+ width +',height='+ height +',scrollbars,resizable=yes,left=50,top=50');
    winHand.focus();
  }	
}

function checkLength() {
  if (document.getElementById('hledej').value.length < 3) {
    alert('Pro hledání zadejte 3 a více znaků');
    return false;
  }
  else
    return true; 
}



