var isIE=(document.all && !window.opera)?true:false;
function ConfirmDelete (url) {
	if (window.confirm("Opravdu chcete vymazat zvolený záznam?!")){
		parent.top.location.href=url;
	}
}
function submitcsobform (targetdomain, messa) {
  document.frmset.action = 'https://' + targetdomain + '/Channels.aspx';
  window.document.getElementById("ZPRAVA").value=messa;
  document.frmset.submit();
}
function showstitek () {
    var stitek = document.getElementById("stitek");
    if (stitek.style.display == "none") stitek.style.display = "block";
    else stitek.style.display = "none";
}
function pozarucni (v) {
    var stitek = document.getElementById("mistoNakupu");
    if (v == "1") {
        if (isIE) stitek.style.display = "block";
        else stitek.style.display = "table-row";
    }
    else {
        stitek.style.display = "none";
    }
}
function hidepozarucni (v) {
    var stitek = document.getElementById("mistoNakupu");
    stitek.style.display = "none";
}
function showstitek () {
    var stitek = document.getElementById("stitek");
    if (stitek.style.display == "none") stitek.style.display = "block";
    else stitek.style.display = "none";
}
function servisType (v) {
    var stitek = document.getElementById("mistoNakupu");
    if (v.value == "3") {
        if (isIE) stitek.style.display = "block";
        else stitek.style.display = "table-row";
    }
    else {
        stitek.style.display = "none";
    }
}
var selectedTab = null;
var firstOpened = null;
function initTabs () {
	var menu = $("#menu, .top").each(function (i) {
		if (this.className == "top selected") {
			firstOpened = this;
			selectedTab = this;
			$(this).mouseover( function () { hoverThis(this); } );
			$(this).mouseout( function () { setDefaultHover(this); } );
		}
		else if (this.className == "top") {
			$(this).mouseover( function () { hoverThis(this); } );
			$(this).mouseout( function () { setDefaultHover(this); } );
		}
	});
}
function hoverThis (el) {
	if (selectedTab != null) selectedTab.className = "top";
	selectedTab = el;
	el.className = "top selected";
}
function setDefaultHover () {
	if (firstOpened != null) {
		hoverThis(firstOpened);
	}
	else {
		if (selectedTab != null) selectedTab.className = "top";
		selectedTab = null;
	}
}