/* ************************************************************************ Softricks Popup Date Picker Calendar Version: v1.82 # ************************************************************************* # COPYRIGHT NOTICE # Copyright (c) 2000-2001 Softricks.com, All rights reserved. # This script may be used and modified free of charge for Non-profit purposes # by anyone as long as this copyright notice and the comments above are kept # in their original form. By using this script, you agree to the disclaimer # notices as on the softricks.com site. # # Selling the code for this script, without prior written consent of # Softricks.com, is not allowed. Redistributing this script over the internet # or in any medium should be done only with the written permission from # Softricks.com. # # IN ALL CASES COPYRIGHT AND HEADERS MUST REMAIN INTACT. # # If you plan to use the script on a commercial site/application, you should # notify Softricks.com and verify the licensing terms. # # Visit the website for more information on Softricks.com's Copyright, # Privacy, Disclaimer and Terms of use policies. ************************************************************************ */ // IE5.0 fix for Array.push method if (!Array.prototype.push) { Array.prototype.push = function() { for (var i=0; i 5) return dateAdd(td, m[4], m[3]); else if (m[1].toUpperCase() == "TODAY") return td; } else { // Read the date in its format return Calendar.readDate(vInputData, pFormat); } } function Calendar_readDate(indt, infmt) { var re = ""; var whoarr = new Array(); whoarr.push("Dummy"); // The split function has problems in IE. // It does not include the separators // specified by the regular expression in the return array. Damn..! // var mach = infmt.split(new RegExp("(DD|MM|MONTH|MON|YYYY|YY|DOW)", "g")); var mach = IESplit(new RegExp("(DD|MM|MONTH|MON|YYYY|YY|DOW)"), infmt); for (i=0; i 50) ? (ytpart + 1900) : (ytpart + 2000)); break; case "YYYY": ypart = parseInt(ma[i], 10); break; } } } if (!(dpart||mpart||ypart)) return null; else return(new Date(mpart+"/"+dpart+"/"+ypart)); } function Calendar_Close(pType, pINLINE) { if (pType == "POPUP") ggWinCal.close(); if (pType == "INLINE") Calendar.Lwwrite(Calendar.gInitText, pINLINE) ggWinCal = null; } // This is for compatibility with Navigator 3, we have to create and discard one object before the prototype object exists. new Calendar(); Calendar.prototype.getMonthlyCalendarCode = function() { var vCode = ""; var vHeader_Code = ""; var vData_Code = ""; // Begin Table Drawing code here.. vCode = vCode + ""; vHeader_Code = this.cal_header(); vData_Code = this.cal_data(); vCode = vCode + vHeader_Code + vData_Code; vCode = vCode + "
"; return vCode; } Calendar.prototype.onclickfn = function() { // This should return the code string for the onclickfn in the calendar document. // This is the reference to the return object // window.opener.document. / window.document. ... .value var whois = this.WHO + ((this.gType == "POPUP") ? "document." + v_NSHierarchy : "window.document." + v_NSHierarchy) + this.gReturnItem + ".value"; // apchar will turn out to be either " = " or " += ''" or " += ';'" var apchar = (this.returnMode == "Replace") ? " = " : " += "; var retCode = "apchar = ''" + ((this.returnMode == "Replace") ? ";" : " + ") + "((" + whois + " == '') ? '' : '" + this.appendChar + "');\n" + whois + apchar + "apchar + pday;\n"; return retCode; } Calendar.prototype.showSmartNavBar = function() { var selcalendar = "
"; selcalendar += ""; selcalendar += "\n"; selcalendar += "" + "" + "^" + "
" + "" + "v" + "
"; this.wwrite(selcalendar); } Calendar.prototype.show = function() { var vCode = ""; if (this.gType == "POPUP") this.gWinCal.document.open(); // Setup the page... this.wwrite(""); this.wwrite("Calendier"); if (this.gType == "POPUP") this.wwrite("