/**
 * @author rjagade
 */


$(document).ready(function($){
	//On login button click perform auth
	$("#loginButton").click(login);
	
	$("#forgotPasswordBtn").click(forgotPassword);
	
	//auth on enter event
	$("#loginForm").keypress(function (e){
		if(e.which == 13) {
			login();
		}
	});
	
	//unblock the ui
    $('.closeDlg').click(function() {
        $.unblockUI();
        return false;
    });
	
	$("#forgotPasswordLink").click(function(){
		//hide the login form and show password forgot form
		$("form#loginForm").slideUp("slow", function(){
			$("form#passwordForgotForm").show("slow");	
		});
		
		
		//hide the password forgot link and show the login link
		$("tr#forgotPasswordLink").hide();
		$("tr#showLoginScreenLink").show();
		
	});
	
	$("#showLoginScreenLink").click(function(){
		//hide the password forgot and show login form form
		$("form#passwordForgotForm").slideUp("slow", function(){
			$("form#loginForm").show("slow");	
		});
		
		
		//hide the login link and show the password forgot link
		$("tr#showLoginScreenLink").hide();
		$("tr#forgotPasswordLink").show();
		
	});	
	
 });
 




