$(document).ready( function() { 
	var myDate = new Date(); 
	$("#itdTimeHour").val(myDate.getHours());
	$("#itdTimeMinute").val(myDate.getMinutes());
    $("#itdDateDay").val(myDate.getDate());
	$("#itdDateMonth").val(myDate.getMonth()+1);
	$("#itdDateYear").val(myDate.getFullYear());
	$("#name_origin, #name_destination, #itdTimeHour, #itdTimeMinute, #itdDateDay, #itdDateMonth, #itdDateYear").neverEmpty();
	$("#place_origin, #place_destination").neverEmptyClean();
});
jQuery.fn.extend({
	neverEmpty: function() {
		return this.each(function() {
			var p = $(this);
			p.data("neverEmptyDefault",p.val());
			p.focusin(function(e) {
				if($(this).val() == $(this).data("neverEmptyDefault")) {
					$(this).val("");
				}
			});
			p.focusout(function(e) {
				if($(this).val() == "") {
					p.val($(this).data("neverEmptyDefault"));
				}
			});
		});
	}
});

jQuery.fn.extend({
    neverEmptyClean: function() {
        return this.each(function() {
            var p = $(this);
            p.data("neverEmptyDefault",p.val());
            p.focusin(function(e) {
                if($(this).val() == $(this).data("neverEmptyDefault")) {
                    $(this).val("");
                }
            });
        });
    }
});

