// wForms Custom Functions
//Network Technology Solutions
//8-15-2007

//Custom function to allow date in any format supported by the local browser as well as YYYY-MM-DD format
wFORMS.behaviors['validation'].isDate = function(s) { 
	var cYEAR = 0, cMONTH = 1, cDAY = 2; 
	var aDate; 
	aDate = s.split("\-"); 
    var testDate = new Date(aDate[cYEAR], aDate[cMONTH] - 1, aDate[cDAY]); 
	
	if ((aDate[cYEAR] != testDate.getFullYear() ) || (aDate[cMONTH] != 1 + testDate.getMonth()) ||(aDate[cDAY] != testDate.getDate()))
		var testDate = new Date(s);
		
	return wFORMS.behaviors['validation'].isEmpty(s) || !isNaN(testDate); 
} 
//End custom date function


