[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path Zen Cart 源代码 calendarcode.js
/*
* Bazillyo's Spiffy DHTML Popup Calendar v. 1.0 2000 S. Ousta
* - freeware with this comment
* - for download size, you can strip all spaces & comments except the notices
* - Thanks to Chris for the domlay() function
* - this requires calendarcode.js, calendar.css, and calendarTest.htm
* - works in IE4.x, IE5.x, NS4.75 possibly 4.x, NS6 (with slight cosmetic issues)
* - Netscape does display some controls overtop of the layer so layout is important
*
*/
// initialiZe variables...
var ppcIE=((navigator.appName == "Microsoft Internet Explorer") || ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5)));
var ppcNN6=((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5));
//var ppcIE=(navigator.appName == "Microsoft Internet Explorer");
var ppcNN=((navigator.appName == "Netscape")&&(document.layers));
var ppcX = 4;
var ppcY = 4;
var IsCalendarVisible;
var calfrmName;
var maxYearList;
var minYearList;
var todayDate = new Date;
var curDate = new Date;
var curImg;
var curDateBox;
var minDate = new Date;
var maxDate = new Date;
var hideDropDowns;
var IsUsingMinMax;
var FuncsToRun;
var img_del;
var img_close;
img_del=new Image();
img_del.src="./images/cal_del_small.gif";
img_close=new Image();
img_close.src="./images/cal_close_small.gif";
function toggleDropDowns(showHow){
var i; var j;
for (i=0;i<document.forms.length;i++) {
for (j=0;j<document.forms[i].elements.length;j++) {
if (document.forms[i].elements[j].tagName == "SELECT") {
if (document.forms[i].name != "Cal")
document.forms[i].elements[j].style.visibility=showHow;
}
}
}
}
function hideCalendar(){
domlay('popupcalendar',0,ppcX,ppcY);
calSwapImg(curImg, 'img_Date_UP');
IsCalendarVisible = false;
if (hideDropDowns) {toggleDropDowns('visible');}
}
function calClick() {
window.focus();
}
function domlay(id,trigger,lax,lay,content) {
/*
* Cross browser Layer visibility / Placement Routine
* Done by Chris Heilmann (mail@ichwill.net)
* Feel free to use with these lines included!
* Created with help from Scott Andrews.
* The marked part of the content change routine is taken
* from a script by Reyn posted in the DHTML
* Forum at Website Attraction and changed to work with
* any layername. Cheers to that!
* Welcome DOM-1, about time you got included... :)
*/
// Layer visible
if (trigger=="1"){
if (document.layers) document.layers[''+id+''].visibility = "show"
else if (document.all) document.all[''+id+''].style.visibility = "visible"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
}
// Layer hidden
else if (trigger=="0"){
if (document.layers) document.layers[''+id+''].visibility = "hide"
else if (document.all) document.all[''+id+''].style.visibility = "hidden"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
}
// Set horizontal position
if (lax){
if (document.layers){document.layers[''+id+''].left = lax}
else if (document.all){document.all[''+id+''].style.left=lax}
else if (document.getElementById){document.getElementById(''+id+'').style.left=lax+"px"}
}
// Set vertical position
if (lay){
if (document.layers){document.layers[''+id+''].top = lay}
else if (document.all){document.all[''+id+''].style.top=lay}
else if (document.getElementById){document.getElementById(''+id+'').style.top=lay+"px"}
}
// change content
if (content){
if (document.layers){
sprite=document.layers[''+id+''].document;
// add father layers if needed! document.layers[''+father+'']...
sprite.open();
sprite.write(content);
sprite.close();
}
else if (document.all) document.all[''+id+''].innerHTML = content;
else if (document.getElementById){
//Thanx Reyn!
rng = document.createRange();
el = document.getElementById(''+id+'');
rng.setStartBefore(el);
htmlFrag = rng.createContextualFragment(content)
while(el.hasChildNodes()) el.removeChild(el.lastChild);
el.appendChild(htmlFrag);
// end of Reyn ;)
}
}
}
function Calendar(whatMonth,whatYear) {
var output = '';
var datecolwidth;
var startMonth;
var startYear;
startMonth=whatMonth;
startYear=whatYear;
var nextMonth = whatMonth+1;
var nextYear = whatYear;
if (nextMonth==12) { nextMonth=0; nextYear=nextYear+1;}
if (column > 0) {
for (i=1; column<7; i++, column++) {
output += getDayLink(i,true,nextMonth,nextYear);
}
output += '<\/tr><\/table><\/td><\/tr>';
}
else {
output = output.substr(0,output.length-4); // remove the <tr> from the end if there's no last row
output += '<\/table><\/td><\/tr>';
}
if (ppcIE) {
curDate.setMonth(document.forms["Cal"].cboMonth.options[monthCheck].value);
}
else if (ppcNN) {
curDate.setMonth(document.popupcalendar.document.forms["Cal"].cboMonth.options[monthCheck].value );
}
domlay('popupcalendar',1,ppcX,ppcY,Calendar(curDate.getMonth(),curDate.getFullYear()));
}
function changeMonth() {
if (ppcIE) {
curDate.setMonth(document.forms["Cal"].cboMonth.options[document.forms["Cal"].cboMonth.selectedIndex].value);
domlay('popupcalendar',1,ppcX,ppcY,Calendar(curDate.getMonth(),curDate.getFullYear()));
}
else if (ppcNN) {
function makeArray0() {
for (i = 0; i<makeArray0.arguments.length; i++)
this[i] = makeArray0.arguments[i];
}
var names = new makeArray0('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var days = new makeArray0(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var dow = new makeArray0('S','M','T','W','T','F','S');