
// dotaz na potvrzeni smazani zaznamu
function delCommit(){
    var pokracovat = confirm("Opravdu chcete smazat tento záznam?");
    return pokracovat;
} 


// 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();
  }	
}

//smaze value objektu
function clearValue (object, defVal){
 if (object){
  if (object.value == defVal) object.value='';
 }
}

//zamkne WYSIWYG
function lockEditor (){
    var checkbox = document.getElementById("chkLock"); 
    var editor = FCKeditorAPI.GetInstance("text");
    if (!checkbox.checked) {
        editor.ToolbarSet.Expand();
        document.frames[0].objContent.DOM.designMode = 'on'
        editor.EditorDocument.designMode = 'on';
    }
    else {
        editor.ToolbarSet.Collapse();
        editor.EditorDocument.body.disabled=true
        document.frames[0].objContent.DOM.designMode = 'off'
        editor.EditorDocument.designMode = 'off';
        
    }
}
