Just use the functions I gave you and it will work fine. You should also get som kind of javascript debugger that points out errors in your code. Modified below to give an alert on dates before next...
Since valiDate is called from within compareDate you don't need to call valiDate at all. Just send the user input to compareDate as I did above and it will work.
Wow, that is a lot of else if's... First of all, it is almost always better to compare the user input with what you want it to look like, not with what you don't want it to look like. Take this...
Your code almost works, but you have to read up on functions and how they work. If you define a variable inside a function, it will only work locally, in that function. Therefore: