function PasswordReminder() {
	var myUsername = document.getElementById("myLogin_iUsername").value;

	dealerships_autobrag_com.Login1.btnRemindMe_Click(myUsername, PasswordReminder_Async_callback);
}

function PasswordReminder_Async_callback(response) {


	var retval = response.value;

	if (retval.ErrorMessage.length > 0) {
		SetError(retval.ErrorMessage);
	    ShowError();
	}

	if (retval.RedirectionURL.length > 0) {
		top.location.href = retval.RedirectionURL;
	}
	
}


function GetLogin_Async()
{
	// Use asynchronous call
	//c = 0;

	var myUsername = document.getElementById("myLogin_iUsername").value;
	var myPassword = document.getElementById("myLogin_iPassword").value;
	var myRememberMe = document.getElementById("myLogin_iRememberMe").checked;

	//DisplayLoader();
	dealerships_autobrag_com.Login1.btnLogin_Click(myUsername, myPassword, myRememberMe, GetLogin_Async_callback);
			
}

function GetLogin_Async_callback(response) {
		
	var retval = response.value;

	if (retval.ErrorMessage.length > 0) {
	    SetError(retval.ErrorMessage);
	    ShowError();
	}

	if (retval.RedirectionURL.length > 0) {
		top.location.href = retval.RedirectionURL;
	}
	
}


function ShowError() {
    $.blockUI({ message: $('#DealerErrors'), css: { width: '375px', 
        backgroundColor:'#F0F8FF',
        padding: '15px', 
        border: '3px solid #F6180F',
        '-webkit-border-radius': '10px', 
        '-moz-border-radius': '10px' } }); 
}

function SetError(ErrorText) {
    document.getElementById("ErrorText").innerHTML = ErrorText;
}