$("document").ready(function(){

	$(".text input").each(function(){
	
		$(this).focus(function(){
	
			if($(this).attr("value") == $(this).attr("error")){
			
				$(this).css({"color": "#000"});
				$(this).attr({"value": ""});
			
			}
			
		});
	
	});

	$("#form").submit(function(){
	
		var valid	=	true;

		$(".text input").each(function(){
	
			if($(this).attr("error")){
	
				if(!$(this).attr("value") | $(this).attr("value") == $(this).attr("error")){
	
					$(this).attr({"value": $(this).attr("error")});
					$(this).css({"color": "red"});
				
					valid	=	false;
				
				}
				
			}
	
		});
		
		if(valid == false){
		
			window.scrollBy(0,-2000);
		
		}
	
		return valid;
		
	});

});

