function apelare_calendar () {
	$(function()
	{
		$('#date-view1')
			.datePicker({inline:true})
			.bind(
				'dateSelected',
				function(e, selectedDate, $td)
				{
					$('#date1').val(selectedDate.asString());
					$('#date-view2, #date-view3').dpSetSelected(selectedDate.addDays(3).asString());
				}
			);
		$('#date-view2')
			.datePicker({inline:true})
			.bind(
				'dateSelected',
				function(e, selectedDate, $td)
				{
					$('#date2').val(selectedDate.asString());
				}
			);
		$('#date-view3').datePicker();
		$('#form-check')
			.bind(
				'click',
				function()
				{
					alert('date1=' + $('#date1').val() + '\n' + 'date2=' + $('#date2').val());
				}
			);
	});
}

function inchiriaza () {
	if (document.rent.nume.value=="") {
		alert('Va rugam sa va completati numele');
		document.rent.nume.focus();
		return false;
	}
	if (document.rent.mail.value=="") {
		alert('Va rugam sa va completati o adresa de email');
		document.rent.mail.focus();
		return false;
	} else {
		var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/
		
		if(!filter.test(document.rent.mail.value)){
			alert("Adresa de e-mail nu este valida!")
			document.rent.mail.focus()
		return false
		}
		
	}
	if (document.rent.telefon.value=="") {
		alert('Va rugam sa va completati numarul de telefon');
		document.rent.telefon.focus();
		return false;
	}
	/*
	if ((document.rent.data1.value == "") || (document.rent.data2.value == "")) {
		alert("va rugam selectati data in care doriti masina");
		return false;
	}	  
	*/
	return true;
}

function quick_inchiriaza () {
	if (document.quickrent.mail.value=="") {
		alert('Va rugam sa va completati o adresa de email');
		return;
	}
	document.quickrent.submit();
}
