//Sets the vars for the elements
var login = document.getElementById('login');
var signup = document.getElementById('signup');

//hides the login div once logged in
function hideBoth(){
	login.style.display="none";
}


function showTwo(element){
	$(element).hide();
	$("#passwordTwo").show();
	$("#passwordTwo").focus();
}
function hideTwo(element){
	$("#passwordOne").show();
	$(element).hide();
}


//Clear's the input onfocus, and type to password where nessesary
function clear_input(element){
    element.value = "";
}

//Restores the default value for the elements
function restore_default(element){
	if(element.value == ''){
        element.value = element.name.substring(0, 1).toUpperCase()
        + element.name.substring(1, element.name.length);
		element.type = "text";
    }
}



//Validates the Login and Signup Forms
$(document).ready(function(){
    $("#loginForm").validate({
		rules: {
		    email: {
		    	required: true,
		    	email: true
	    	},
	 		pass: {
				required: true
			}
		}
	});
});