try below code...
you just take 3rd no string and split using taht string... you don't need to pass multiple parameters...
if your date is "12/01/2012" or "12-01-2012" or "12.01.2012"
below code will return correct answer..
var leapyear = new Array();
leapyear =date.split(date.substr(2,1));
alert(leapyear[2]);
for (var i = 0; i < leapyear.length; i++)
document.writeln("<h4>" + leapyear[i] +"</h4>");
return true;