1var day = 12;
2var month = 12;
3var year = 2006;
4var age = 18;
5var setDate = new Date(year + age, month - 1, day);
6var currdate = new Date();
7
8if (currdate >= setDate) {
9 // you are above 18
10 alert("above 18");
11} else {
12 alert("below 18");
13}