// // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | http://www.zen-cart.com/index.php | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: general.js 1105 2005-04-04 22:05:35Z birdbrain $ // 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; }