var clone=null;

function dlg(){
var pwd=$("#lg_pwd").val();
var usr=$("#usr").val();
if ($('#remember').is(':checked') == true) {
var rem='yes';
}
else{
var rem='no';
}

if (pwd=='' || usr==""){
return;
}
clone=$("#lgb").clone();
var success=function(data){
if (data=='0'){
$("#barcnt").html('Login Authorized');
//DoReload();
window.location = uds;
}
else{
$('#barcnt').html(clone);
alert('ooops! Invalid usernamo or password!');
}

};

var beforeSend=function(){
$("#barcnt").html('<div id="load" style="color:#000099">Logging In</div>');
};

var error=function(){
$('#barcnt').html(clone);
alert('ooops! We had some problems connecting with the server. Please try again!');
};

var url=uds+'/at/lgn.php';
var data = { 
pwd: pwd, 
rem: rem, 
usr: usr,
a: "1"
};

$.ajax({
type: "POST",
url: url,
data: data,
success: success,
beforeSend: beforeSend,
error: error
});
};
//---------------------------