function changeStyle (obj, stylename) {

	if (obj == null) return;

	obj.className = stylename;

}



function showInfoBoxCover (inText, inText2) {

    objBox = document.getElementById("infoBoxCover");

    objBox2 = document.getElementById("infoBoxCoverInside");

    objBoxText = document.getElementById("infoBoxCoverText");

    objBoxImage = document.getElementById("infoBoxCoverImage");

    if (objBox == null || objBox2 == null || objBoxText == null || objBoxImage == null) return;

    objBoxText.innerHTML = inText;

    if (inText2 != null) {

    	objBoxImage.innerHTML = inText2;

    }

    objBox.className = "showInfoBoxCoverShow";

    objBox2.className = "showInfoBoxCoverShowInside";

}



function showSimpleDialogCover (dialogSysName, inText, posTop, posLeft) {

    objBox = document.getElementById("simpleDialogCover_" + dialogSysName);

    objBox2 = document.getElementById("simpleDialogCoverInside_" + dialogSysName);

    objBoxText = document.getElementById("simpleDialogCoverText_" + dialogSysName);

    if (objBox == null || objBox2 == null || objBoxText == null) return;

    objBoxText.innerHTML = inText;

    objBox.className = "simpleDialogCoverShow";

    objBox2.className = "simpleDialogCoverInside";

    if (posTop != null) {

        if (posTop.indexOf("%") == -1) posTop += "px";

        objBox2.style.top = posTop;

    }

    if (posLeft != null) {

        if (posLeft.indexOf("%") == -1) posLeft += "px";

        objBox2.style.left = posLeft;

    }

}

function hideSimpleDialogCover (dialogSysName) {

    objBox = document.getElementById("simpleDialogCover_" + dialogSysName);

    objBox2 = document.getElementById("simpleDialogCoverInside_" + dialogSysName);

    objBoxText = document.getElementById("simpleDialogCoverText_" + dialogSysName);

    if (objBox == null || objBox2 == null || objBoxText == null) return;

    objBoxText.innerHTML = "";

    objBox.className = "simpleDialogCoverHide";

    objBox2.className = "simpleDialogCoverHide";

}



function goAction (submitElement, parentFormName) {

    if (submitElement == null) return;

    objHelpInput = document.getElementById("HELP_ACTION");

    if (objHelpInput == null) {

        alert ("Missing help-hidden element !");

        return;

    }

    objHelpInput.name = submitElement.name;

    objHelpInput.value = submitElement.value;

    submitElement.name = "xxx"; // prevent change name

    objForm = document.getElementById(parentFormName);

    if (objForm == null) {

        alert ("Form "+parentFormName+" neexistuje !");

        return;

    }

    else {

        document.onkeydown = disableActionKeys;

        objForm.submit();

    }

}



function disableActionKeys (evt) {

    pressedKey = (evt != null) ? evt.keyCode : (event != null) ? event.keyCode : null;

    // 9 - TAB, 32-SPACE, 13-ENTER

    return (pressedKey == null || (pressedKey != 9 && pressedKey != 32 && pressedKey != 13));

}

