/**
 * nastaveni a kontrola datumu
 */
function SetDatum(date,form,date_type) {
    if(window.showModalDialog) {
        var wh = 246, mh = 205;
        if(date_type == 'full') {
            wh = wh + 20;
            mh = mh + 20;
        }
        datum = showModalDialog( '/sys.php?action=show_date&lang=cz&datum='+date.value+'&date_type='+date_type, '', 'font-family: Verdana; font-size: 10; dialogWidth: 270px; dialogHeight: '+wh+'px; status: no; scroll: no; help: no; resizable: no; ');
        if(datum) {
            date.value=datum;
        }
    } else {
        MozzilaReturn = 0;
        modalWin = window.open('/sys.php?action=show_date&lang=cz&datum='+date.value+'&date_type='+date_type, '','width=260,height='+mh+',status=no,scrollbars=no,resizable=no;');
        window.onfocus = function() {
            if(modalWin && !modalWin.closed) {
                modalWin.focus();
            }
        }
        SetDatumDate = date;
        SetDatumForm = form;
        setTimeout("SetDatumMozzila()", 50);
    }
}

function SetDatumMozzila()
{
    if(!modalWin.closed && modalWin) {
        setTimeout("SetDatumMozzila()", 50);
        return;
    }
    if(MozzilaReturn) {
        form = SetDatumForm;
        SetDatumDate.value=MozzilaReturn;
    }
}

