// *** BROWSER VERSION *** var agt=navigator.userAgent.toLowerCase(); var appVer = navigator.appVersion.toLowerCase(); var is_minor = parseFloat(appVer); var is_major = parseInt(is_minor); // Note: On IE, start of appVersion return 3 or 4 // which supposedly is the version of Netscape it is compatible with. // So we look for the real version further on in the string var iePos = appVer.indexOf('msie'); if (iePos !=-1) { is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos))) is_major = parseInt(is_minor); } var is_getElementById = (document.getElementById) ? "true" : "false"; // 001121-abk var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // 001127-abk var is_documentElement = (document.documentElement) ? "true" : "false"; // 001121-abk var is_gecko = ((navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false; var is_gver = 0; if (is_gecko) is_gver=navigator.productSub; var is_moz = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && ((navigator.vendor=="")||(navigator.vendor=="Mozilla"))); if (is_moz) { var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0; if(!(is_moz_ver)) { is_moz_ver = agt.indexOf('rv:'); is_moz_ver = agt.substring(is_moz_ver+3); is_paren = is_moz_ver.indexOf(')'); is_moz_ver = is_moz_ver.substring(0,is_paren); } is_minor = is_moz_ver; is_major = parseInt(is_moz_ver); } var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (!(is_moz))); // Netscape6 is mozilla/5 + Netscape6/6.0!!! // Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0 // Changed this to use navigator.vendor/vendorSub - dmr 060502 // var nav6Pos = agt.indexOf('netscape6'); // if (nav6Pos !=-1) { if ((navigator.vendor)&& ((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&& (is_nav)) { is_major = parseInt(navigator.vendorSub); // here we need is_minor as a valid float for testing. We'll // revert to the actual content before printing the result. is_minor = parseFloat(navigator.vendorSub); } var is_opera = (agt.indexOf("opera") != -1); var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1); var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1); var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1); var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1); var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // new 020128- abk var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4); var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); // new020128 var is_nav2 = (is_nav && (is_major == 2)); var is_nav3 = (is_nav && (is_major == 3)); var is_nav4 = (is_nav && (is_major == 4)); var is_nav4up = (is_nav && is_minor >= 4); // changed to is_minor for // consistency - dmr, 011001 var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) ); var is_nav6 = (is_nav && is_major==6); // new 010118 mhp var is_nav6up = (is_nav && is_minor >= 6) // new 010118 mhp var is_nav5 = (is_nav && is_major == 5 && !is_nav6); // checked for ns6 var is_nav5up = (is_nav && is_minor >= 5); var is_nav7 = (is_nav && is_major == 7); var is_nav7up = (is_nav && is_minor >= 7); var is_ie = ((iePos!=-1) && (!is_opera)); var is_ie3 = (is_ie && (is_major < 4)); var is_ie4 = (is_ie && is_major == 4); var is_ie4up = (is_ie && is_minor >= 4); var is_ie5 = (is_ie && is_major == 5); var is_ie5up = (is_ie && is_minor >= 5); var is_ie5_5 = (is_ie && (agt.indexOf("msie 5.5") !=-1)); // 020128 new - abk var is_ie5_5up =(is_ie && is_minor >= 5.5); // 020128 new - abk var is_ie6 = (is_ie && is_major == 6); var is_ie6up = (is_ie && is_minor >= 6); // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser // or if this is the first browser window opened. Thus the // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable. var is_aol = (agt.indexOf("aol") != -1); var is_aol3 = (is_aol && is_ie3); var is_aol4 = (is_aol && is_ie4); var is_aol5 = (agt.indexOf("aol 5") != -1); var is_aol6 = (agt.indexOf("aol 6") != -1); var is_aol7 = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1)); var is_webtv = (agt.indexOf("webtv") != -1); // new 020128 - abk var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); var is_AOLTV = is_TVNavigator; var is_hotjava = (agt.indexOf("hotjava") != -1); var is_hotjava3 = (is_hotjava && (is_major == 3)); var is_hotjava3up = (is_hotjava && (is_major >= 3)); // *** Calendar CODE *** //var timeoutDelay = 2000; NOT USED // milliseconds, change this if you like, set to 0 for the calendar to never auto disappear //var timeoutId = false; NOT USED // used by timeout auto hide functions var g_startDay = 0// 0=sunday, 1=monday // preload images //var imgUp = new Image(8,12); imgUp.src = '/Resources/calendar/images/up.gif'; //var imgDown = new Image(8,12); imgDown.src = '/Resources/calendar/images/down.gif'; document.write(''); // void.html just contains and
tag. Calendar script writes into tag. var g_Calendar; // global to hold the calendar reference, set by constructor // constructor for calendar class function Calendar(){ g_Calendar = this; // some constants needed throughout the program this.daysOfWeek = new Array("Su","Mo","Tu","We","Th","Fr","Sa"); this.months = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); this.daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); if (is_ie5up || is_nav6up) { tmpIframeObject = document.getElementById('container'); this.targetIframe = tmpIframeObject; // retrieve the iframe's inner document if (is_ie5 || is_ie5_5) { this.targetDocument = frames['calendarFrame'].document; this.targetDocument.createStyleSheet('calendar.css') } else if (is_ie6up) { this.targetDocument = tmpIframeObject.contentWindow.document } else if (is_nav6up) { this.targetDocument = tmpIframeObject.contentDocument} } } Calendar.prototype.getFirstDOM = function() { var thedate = new Date(); thedate.setDate(1); thedate.setMonth(this.month); thedate.setFullYear(this.year); return thedate.getDay(); } Calendar.prototype.getDaysInMonth = function (){ if (this.month!=1) { return this.daysInMonth[this.month] } else { // is it a leap year if (Date.isLeapYear(this.year)) { return 29; } else { return 28; } } } Calendar.prototype.buildString = function(){ var tmpStr = '' return tmpStr; } Calendar.prototype.selectChange = function(){ this.month = this.targetDocument.forms[0].month.selectedIndex; this.writeString(this.buildString()); } Calendar.prototype.inputChange = function(){ var tmp = this.targetDocument.forms[0].year; if (tmp.value >=1900 || tmp.value <=2100){ this.year = tmp.value; this.writeString(this.buildString()); } else { tmp.value = this.year; } } Calendar.prototype.changeYear = function(incr){ (incr==1)?this.year++:this.year--; this.writeString(this.buildString()); } Calendar.prototype.changeMonth = function(incr){ if (this.month==11 && incr==1){ this.month = 0; this.year++; } else { if (this.month==0 && incr==-1){ this.month = 11; this.year--; } else { (incr==1)?this.month++:this.month--; } } this.writeString(this.buildString()); } Calendar.prototype.clickDay = function(day){ // the "tmp" Object is the date field in the main document and is set by the "show" function (see below) var tmp = eval('document.' + this.target); if (this.dateFormat=='dd-mmm-yyyy' || this.dateFormat=='dd/mmm/yyyy') tmp.value = day + this.dateDelim + this.months[this.month].substr(0,3) + this.dateDelim + this.year; if (this.dateFormat=='dd/mm/yyyy' || this.dateFormat=='dd-mm-yyyy') tmp.value = day + this.dateDelim + (this.month+1) + this.dateDelim + this.year; if (this.dateFormat=='mm/dd/yyyy' || this.dateFormat=='mm-dd-yyyy') tmp.value = (this.month+1) + this.dateDelim + day + this.dateDelim + this.year; if (this.dateFormat=='yyyy-mm-dd') tmp.value = this.year + this.dateDelim + (this.month+1) + this.dateDelim + day; // hide Iframe when the date field has been updated this.targetIframe.style.visibility='hidden'; } Calendar.prototype.writeString = function(str){ // retrieve the (only) tag in the void.html Iframe source var innerBody = this.targetDocument.getElementsByTagName('body').item(0); innerBody.innerHTML = str; } // EXAMPLE: onclick="g_calendar.show(event,current_form.current_field, ...) Calendar.prototype.show = function(evt, target, bHasDropDown, dateFormat, dateFrom, dateTo){ if (is_ie5up || is_nav6up) { // calendar can restrict choices between 2 dates, if however no restrictions // are made, let them choose any date between 1900 and 3000 if (dateFrom) this.dateFrom = dateFrom; else this.dateFrom = new Date(1900,0,1); this.dateFromDay = padZero(this.dateFrom.getDate()); this.dateFromMonth = padZero(this.dateFrom.getMonth()); this.dateFromYear = this.dateFrom.getFullYear(); if (dateTo) this.dateTo = dateTo; else this.dateTo = new Date(3000,0,1); this.dateToDay = padZero(this.dateTo.getDate()); this.dateToMonth = padZero(this.dateTo.getMonth()); this.dateToYear = this.dateTo.getFullYear(); this.hasDropDown = bHasDropDown; if (dateFormat) this.dateFormat = dateFormat; else this.dateFormat = 'dd-mmm-yyyy'; switch (this.dateFormat){ case 'dd-mmm-yyyy': case 'dd-mm-yyyy': case 'yyyy-mm-dd': this.dateDelim = '-'; break; case 'dd/mm/yyyy': case 'mm/dd/yyyy': case 'dd/mmm/yyyy': this.dateDelim = '/'; break; } // hide IFRAME during computation (if already visible for another field) if (this.targetIframe.style.visibility=='visible') { this.targetIframe.style.visibility='hidden'; return; } // move IFRAME to coordinates of mouse click (handle event) evt = (evt) ? evt : ((window.event) ? window.event : "") // if Netscape6/DOM, "evt" already contains event, otherwise (IE) set to window.event if (is_ie5up) { this.targetIframe.style.left = evt.clientX + document.body.scrollLeft; this.targetIframe.style.top = evt.clientY + document.body.scrollTop; } else if (is_nav6up) { this.targetIframe.style.left = evt.pageX; this.targetIframe.style.top = evt.pageY; } // process the current date in the field (passed as "target") and setup calendar this.target = target; var tmp = eval('document.' + this.target); if (tmp && tmp.value && tmp.value.split(this.dateDelim).length==3 && tmp.value.indexOf('d')==-1){ var atmp = tmp.value.split(this.dateDelim) switch (this.dateFormat){ case 'dd-mmm-yyyy': case 'dd/mmm/yyyy': for (var i=0;i