//<![CDATA[

//-----------------------------------------------------------------
// FUNKCE NA SPUSTENI DIALOGU NA EDITACI KONSTANTY
//-----------------------------------------------------------------
function RunEditConstantDialog(e)
{
	var run = true;
	// - nacteni promennych
	if (e == null) e = window.event;
	var s =	FindConstantTag(e.srcElement ? e.srcElement : e.target);
	if (s == null) return;
	var c = s.getAttribute("const");
	var g = s.getAttribute("is_guid");
	var k = s.getAttribute("key");
	g = (g != null && g == 1) ? 1 : 0;
	// - zjistení, zda je mozne dialog spustit
	if (k != null && k != "" && k.toLowerCase() == "ctrl" && !e.ctrlKey) run = false;
	// - pokud je povoleno spusteni
	if (run) {
		// !!! pokud je zapnuty prepis cest pak je treba vlozit absolutni url !!!
		OpenWindow("constant.aspx?data=" + c + "&isguid=" + g, 640, 500, null, "yes");
		return false;
	}
}

// Vyhleda tag obsahujici definici konstanty
function FindConstantTag(ASourceNode)
{
	var node = ASourceNode;
	while (node != null && node.getAttribute("const") == null) {
		node = node.parentNode;
		if (node == node.parentNode) node = null;
	}
	if (node != null && node.getAttribute("const") != null) return node;
	return null;
}

//]]>