function openWindow(url,dimX,dimY) {
	var dimensions;
	if((dimX == null || dimX == '') && (dimY == null || dimY == ''))
		dimensions = 'width=650,height=500';
	else
		dimensions = 'width='+dimX+',height='+dimY;		
	
	var type = '_blank';
	var param = 'toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes,resizable=yes,status=no,'+dimensions;
	
	if(url != ''){
		newWindow = window.open(url, name, param);
		var posX = (window.screen.width-newWindow.document.body.offsetWidth)/2;
		var posY = (window.screen.height-newWindow.document.body.clientHeight)/2-20;
		newWindow.moveTo(posX,posY);
		try { 
			newWindow.focus();
		}
		catch(e){}
	}
	return;
}

function refreshOpener(url){
	var winOpener = null;	
	
	winOpener = window.opener;
		
	if(winOpener != null){
		if(url == null){
			winOpener.location.reload();			
		}else{
			winOpener.location.replace(url);			
		}
		return;
	}
}

function unhide(what,when,newValue) {
  var item=document.getElementById(what);
  if(newValue == when) {
    item.className="show";
  } else {
    item.className="hidden";
  }

}

/**
 * Function to check if remove action is really wanted
 */
function checkRemove() {
    var result = window.confirm('Opravdu chcete položku vymazat?');
    if(result) {
        return true;
    } else {
        return false;
    }
}
