$(document).ready(function() {
	$('.header form .text-input').each(function() {
		searchText = $(this).val();

		$(this).focus(function() {
			if($(this).val()==searchText) {
				$(this).val('');
			}
		});

		$(this).blur(function() {
			if(empty($(this).val())) {
				$(this).val(searchText);
			}
		});
	});
	$("#date").datepicker({dateFormat: 'dd/mm/yy', minDate: 0});
});

function empty(str) {
	if (str === "" || str === 0 || str === "0" || str === null || str === false || typeof str === 'undefined') {
		return true;
	}
	if (typeof str == 'object') {
		var key;
		for (key in str) {
			return false;
		}
		return true;
	}
	return false;
}