/* $Id: general.js,v 1.1.1.1 2004/03/04 23:40:52 ccwjr Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ function SetFocus(TargetFormName) { var target = 0; if (TargetFormName != "") { for (i=0; i 7) { if (strFormatString.indexOf('mmm') == -1) { strMonth = strDateToCheck.substring(strFormatString.indexOf('mm'), 2); } else { strMonth = strDateToCheck.substring(strFormatString.indexOf('mmm'), 3); } strDay = strDateToCheck.substring(strFormatString.indexOf('dd'), 2); strYear = strDateToCheck.substring(strFormatString.indexOf('yyyy'), 2); } else { return false; } } if (strYear.length != 4) { return false; } intday = parseInt(strDay, 10); if (isNaN(intday)) { return false; } if (intday < 1) { return false; } intMonth = parseInt(strMonth, 10); if (isNaN(intMonth)) { for (i=0; i 12 || intMonth < 1) { return false; } intYear = parseInt(strYear, 10); if (isNaN(intYear)) { return false; } if (IsLeapYear(intYear) == true) { intDaysArray[1] = 29; } if (intday > intDaysArray[intMonth - 1]) { return false; } return true; } function IsLeapYear(intYear) { if (intYear % 100 == 0) { if (intYear % 400 == 0) { return true; } } else { if ((intYear % 4) == 0) { return true; } } return false; }