
var applyDefault = function(input, text){
	input.style.color = "#555";
	input.value = text;
	input.onfocus = function(){
		if(input.value == text){		
			input.value = "";
			input.style.color = "#000";
		}					
	}
	input.onblur = function(){
		if(input.value == ""){
			input.value = text;
			input.style.color = "#555";
		}
	
	}
}
var ge = function(id){
	return document.getElementById(id);
}

// The code that creates the default text in the input fields.
window.onload = function(){
	applyDefault(ge("email"), "Email");
	var email = ge("email");
	var placeholder = ge("password_placeholder");
	var password = ge("password"); 
	
	placeholder.innerHTML = "Password";
	placeholder.onclick = function(){
		this.style.display = "none";
		password.focus();
	}
	
	password.onfocus = function(){
		placeholder.style.display = "none";
	}
	
	email.onfocus = function(){
		email.value = "";
		placeholder.style.display = "none";
	}
	
	password.onblur = function(){
		if(password.value == "")
			placeholder.style.display = "block";
	}
}