var bDay = ""+yearVal+"-"+monthVal+"-"+dayVal+"";
var checkAge = Math.floor((new Date().getTime() - new Date(bDay)) / (24 * 3600 * 365.25 * 1000));
if(checkAge < 18) {
$(".error").show();
return;
}
new Date(yearVal, monthVal, dayVal)
(new Date()).getTime() - (new Date(yearVal, monthVal, dayVal)).getTime()
var now = new Date();
var age = (now.getFullYear() - yearVal - ((now.getMonth() - (monthVal - 1) || now.getDate() - dayVal) < 0 ? 1 : 0));