﻿///<reference path="jquery.intellisense.js"/>

jQuery(document).ready(function() {
	addEvents();
});

function addEvents() {
	jQuery('#dealerForgotPassword').click(function() {
		alert("Do Forgot Password");
	});

	jQuery('#dealerLoginButton').click(function() {
		var userName = jQuery('#dealerLoginUsername').val();
		var password = jQuery('#dealerLoginPassword').val();
		var options = new Object();

		if (userName && password) {
			if ((userName == "patrickm") && (password == "password")) {
				document.location = "DealersHome.aspx";

				return;
			} else {
				//options.message = "Please fill complete all the fields.";
				options.content = "Username and Password combination not found.";
				options.header = "LOGIN FAILED";
				options.width = 400;
				options.showModalizer = true;
			}
		} else {
			//options.message = "Please fill complete all the fields.";
			options.content = "Please supply a Username and Password to login.";
			options.header = "DATA REQUIRED";
			options.width = 400;
			options.showModalizer = true;
		}

		showPopup(options);
	});
}
