function NewR(link)
{
  open(link, "", "scrollbars=yes, width=750, height=600,status=no,resizable=no,directories=no,toolbar=no,menubar=no,location=no" );
}
function New(link,w,h)
{
  open(link, "", "scrollbars=yes, width="+w+", height="+h+",status=no,resizable=no,directories=no,toolbar=no,menubar=no,location=no" );
}
function confirmdelete( link )
{
	var x = confirm( "Opravdu chcete smazat tuto položku?" );
	if(x)
		window.location = link;
	else
		return false;
}
document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes)) retnode.push(elem[i]);
}
return retnode;
};

function confirmExit()
{
	if (needToConfirm)
		return( "Chystáte se opustit tuto stránku, což může vést ke ztrátě neuložených dat (nedokončené vložení pokoje apod.) Přejete si pokračovat?" );	
}

function oznac(id)
{
	var x = document.getElementsByClassName("td"+id);
	for( i=0;i<x.length;i++)
	{
		x[i].className = "hover td"+id;
	}
}
function odznac(id)
{
	var x = document.getElementsByClassName("td"+id);
	for( i=0;i<x.length;i++)
	{
		x[i].className = "td"+id;
	}
}

function checkDestinations(el)
{
    var tmp = el.id.split('-');
    id = tmp[1];
    var dests = document.getElementsByClassName("dest_box-" + id);
    for(i = 0; i < dests.length; i++)
    {
        dests[i].checked = el.checked;
    }
}

