$(document).ready(function() {
    $('input[type="text"]').addClass("idle");
	$('input[type="text"]').focus(function() {
		$(this).removeClass("idle").addClass("focus");
        if (this.value == this.defaultValue){
        	this.value = '';
    	}
        if(this.value != this.defaultValue){
	    	this.select();
        }
    });
    $('input[type="text"]').blur(function() {
    	$(this).removeClass("focus").addClass("idle");
        if ($.trim(this.value == '')){
        	this.value = (this.defaultValue ? this.defaultValue : '');
    	}
    });
});