﻿$(document).ready(function(){
	$("div.clientLogin").keypress(function(e){
		if(e.keyCode == 13){
			login();
			e.cancelBubble = true;
			return false;
		}
	});
});

function login(){
	$('form.loginForm').get(0).submit();
	return false;
};

if(!window.True){
	Type.registerNamespace('True');
}

True.LoginDefaulter = function(p_el){
	True.LoginDefaulter.constructBase(this, [p_el]);
	this.setBackground();
};
	
True.LoginDefaulter.prototype = {
	handle_focus: function(evt){
		this.jq.addClass("filled");
		this.jq.removeClass(this.element.id);
	},
	handle_blur: function(evt){
		this.setBackground();
	},
	setBackground: function(){
		if(this.jq.val() != undefined && this.jq.val() != ""){
			this.jq.addClass("filled");
			this.jq.removeClass(this.element.id);
		}
		else{	
			this.jq.addClass(this.element.id);
			this.jq.removeClass("filled");
		}
	}
}


True.LoginDefaulter.register('True.LoginDefaulter', True.Behavior);

