function ChckClsDgLt(e) {
    if (navigator.userAgent.indexOf("Opera") > -1) { e = event.keyCode }
    if (e == 27) {
        if (objGet('DialogBox').className == 'DialogBoxActiv') {
            objGet('DialogBox').className = 'DialogBox';
        }

    }
}
function Doglite() {
}

Doglite.prototype.addsend = function(oForm) {

    var bContinue = true;

    if (oForm) {
        var semail = oForm['sEmail'].value;
        var bstoreterm = oForm['bStoreTerm'].checked;
        var bpriceterm = oForm['bPriceTerm'].checked;
        var nprice = oForm['nPrice'].value;
        var fktblCommodity = oForm['fktblCommodity'].value;
        var sname = oForm['sName'].value;


        //kontrola emailu
        bContinue = EmailControl(semail);
        if (!bContinue) {
            return false
        }
        //neni zadana zadna podminka pro hlidaciho psa
        bContinue = (bstoreterm || bpriceterm);
        if (!bContinue) {
            alert('Vyberte alespoň jednu hlídanou podmínku.');
            return false
        }

        //Cena neni cislo 
        if (isNaN(nprice)) {
            alert('Chybně vyplněná cena.');
            return false
        } else {
            if (nprice <= 0) {
                alert('Chybně vyplněná cena.');
                return false
            }
        }

    } else {
        //alert('Form neni');
    }


    if (bContinue) {
        var sParam = '["semail","' + semail + '"], ["bstoreterm", "' + bstoreterm + '"], ["bpriceterm", "' + bpriceterm + '"], ["nprice", "' + nprice + '"], ["fktblCommodity", "' + fktblCommodity + '"], ["sname", "' + NonDiacritic(sname) + '"]';
        sParam = '[' + sParam + ']';
        ajax.url = 'DogLite/DogLiteAdd.asp';
        ajax.method = 'get';
        ajax.cbf = cbf;
        ajax.sendRQ(eval(sParam), true);
    }
}


Doglite.prototype.fill = function(pktblcommodity, nprice, bstore) {

    var sParam = '["pktblcommodity", "' + pktblcommodity + '"], ["nprice", "' + nprice + '"], ["bstore", "' + bstore + '"]';
    sParam = '[' + sParam + ']';
    ajax.url = 'DogLite/DogLiteShow.asp';
    ajax.method = 'get';
    ajax.cbf = cbf;
    ajax.sendRQ(eval(sParam), true);

}
