function ClearGridExport() {
    document.getElementById("__EVENTARGUMENT").value = "";
    document.getElementById("__EVENTTARGET").value = "";
}
function GetRadWindow()
{
	var oWindow = null;
	if (window.radWindow) oWindow = window.radWindow;
	else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
	return oWindow;
}
function CloseRadWindow()
{
	var oWindow = GetRadWindow();
	if (arguments[0] != null && arguments[1] != null) {
		var obj = new Object();
		obj.Event = arguments[0];
		obj.Argument = arguments[1];
		oWindow.CallBack(obj);
	} else {
	    if (arguments[0] != null)
	        oWindow.Callback(arguments[0]);
	    else
		    oWindow.Close();
    }
}
function getID(id) 
{
	return (document.getElementById(id));
}
// nadpis
function SetNadpis(first, second) {
	if (self.name == "o_mainframe" && self.parent.frames["o_topframe"].document.getElementById("nadpis") != null) {
	    var n = "<span>" + first + "</span>";
	    if (second != "")
	        n += "&nbsp;&raquo;&nbsp;" + second;
		self.parent.frames["o_topframe"].document.getElementById("nadpis").innerHTML = n;
	}
}
function StartupAssign()
{   
    getID("divLoading").style.display = "none";
    $("input[@type='button'], input[@type='submit'], input[@type='reset']").hover(function() { Button_MouseOver($(this)); }, function() { Button_MouseOut($(this)); });
    $("select").keydown(ListBoxKeySearch_KeyDown);
    $("select").keypress(ListBoxKeySearch_KeyPress);
    $("select").blur(ListBoxKeySearch_Blur);
    self.status = DefaultStatusbarText;
}

function getSecondsInTime(s_timeValue) {
	s_timeValue = s_timeValue.replace(":","");
	var m = parseInt(s_timeValue.substr(0, 2)) * 60;
	m += parseInt(s_timeValue.substr(2));
	return (m * 60);
}
function getMinuteFromTime(s_time) {
	if ($.trim(s_time) == "" || s_time == "0") {
		return (0);
	} else {
		return (getSecondsInTime(s_time) / 60);
	}
}
function getTimeFromMinute(i_minutes) {
	var a = parseInt(i_minutes / 60);
	if (a.toString().length == 1) a = "0" + a;
	var b = i_minutes % 60;
	if (b.toString().length == 1) b = "0" + b;
	return (a + ":" + b);
}

function Users() {}

Users.SwitchTab = function(tab, f12id)
{
    switch (tab)
    {
        case "prava":
            location.href = "user_prava.aspx?f12id=" + f12id;
            break;
        case "kvalifikace":
            location.href = "user_kvalifikace.aspx?f12id=" + f12id;
            break;
        case "slevy":
            location.href = "slevy.aspx?f12id=" + f12id;
            break;
        case "user":
            location.href = "user.aspx?f12id=" + f12id;
            break;
        case "nalet":
            location.href = "nalet.aspx?f12id=" + f12id;
            break;
    }
}

function Aircrafts() {}

Aircrafts.SwitchTab = function(tab, a40id)
{
    switch (tab)
    {
        case "ceny":
            location.href = "letadlo_ceny.aspx?a40id=" + a40id;
            break;
        case "wab":
            location.href = "letadlo_wb.aspx?a40id=" + a40id;
            break;
        case "blokace":
            location.href = "letadlo_blokace.aspx?a40id=" + a40id;
            break;
    }
}