﻿function showloginerrormessage() {
        Ext.MessageBox.show({
            title: 'Foutmelding:',
            msg: 'Het inloggen is niet gelukt, probeer het nogmaals of vraag een nieuw wachtwoord aan.',
            buttons: Ext.MessageBox.OK,
            animEl: 'ctl00$LoginLogout1$button_login',
            fn: focuspassword
        });
}

function LoginControl() {
//      var dd11 = Ext.get('loginlogoutcontainer');
//      dd11.dd = new Ext.dd.DDProxy('loginlogoutcontainer', 'group');

//      dragZone1 = new Ext.dd.DragZone(Ext.get('left'), {
//          ddGroup: 'group',
//          scroll: true
//      });
//      dragZone2 = new Ext.dd.DragZone(Ext.get('right'), {
//          ddGroup: 'group',
//          scroll: true
//      });
//  

        if (Ext.get("ctl00_LoginLogout1_txt_username").dom.value == "") {
            Ext.MessageBox.show({
                title: 'Foutmelding:',
                msg: 'Vul a.u.b. uw e-mailadres in.',
                buttons: Ext.MessageBox.OK,
                animEl: 'ctl00$LoginLogout1$button_login',
                fn: focususername
                //,icon: Ext.get('icons').dom.value
            });
            return false;
        } else if (Ext.get("ctl00_LoginLogout1_txt_password").dom.value == "") {
            Ext.MessageBox.show({
                title: 'Foutmelding:',
                msg: 'Vul a.u.b. uw wachtwoord in.',
                buttons: Ext.MessageBox.OK,
                animEl: 'ctl00$LoginLogout1$button_login',
                fn: focuspassword
                //,icon: Ext.get('icons').dom.value
            });
            return false;
        } else {
            //    var ds_user = new Ext.data.Store(
            //    {
            //        proxy: new Ext.data.HttpProxy(
            //         {
            //           url: '../Test.asmx/UserList',
            //           method: 'POST' 
            //    }),
            //    reader: new Ext.data.XmlReader(
            //    {
            //        record: 'records',
            //        id: 'UserId',
            //        totalRecords: 'recordCount'
            //    },
            //     ['UserId', 'FullName'])
            //    }); 
            return true;
        }
}

function focususername() {
    var obj = Ext.get("ctl00_LoginLogout1_txt_username");
    obj.highlight();
    obj.dom.focus();
}
function focuspassword() {
    var obj = Ext.get("ctl00_LoginLogout1_txt_password");
    obj.highlight();
    obj.dom.focus();
}

