日期:2009-08-18  浏览次数:21461 次

4。calendar.js
var gdCtrl = new Object();
var goSelectTag = new Array();
var gcGray = "#808080";

var gcToggle = "#ffff00";
var gcBG = "#99CCFF";
var previousObject = null;

var gdCurDate = new Date();
var giYear = gdCurDate.getFullYear();
var giMonth = gdCurDate.getMonth()+1;
var giDay = gdCurDate.getDate();

var gCalMode = "";
var gCalDefDate = "";

var CAL_MODE_NOBLANK = "2";

function fSetDate(iYear, iMonth, iDay){
  //VicPopCal.style.visibility = "hidden";
  if ((iYear == 0) && (iMonth == 0) && (iDay == 0)){
      gdCtrl.value = "";
  }else{
      iMonth = iMonth + 100 + "";
      iMonth = iMonth.substring(1);
      iDay   = iDay + 100 + "";
      iDay   = iDay.substring(1);
      gdCtrl.value = iYear+"-"+iMonth+"-"+iDay;
  }
  
  for (i in goSelectTag)
      goSelectTag[i].style.visibility = "visible";
  goSelectTag.length = 0;
  
  window.returnValue=gdCtrl.value;
  window.close();
}

function HiddenDiv()
{
    var i;
  VicPopCal.style.visibility = "hidden";
  for (i in goSelectTag)
      goSelectTag[i].style.visibility = "visible";
  goSelectTag.length = 0;

}
function fSetSelected(aCell){
  var iOffset = 0;
  var iYear = parseInt(tbSelYear.value);
  var iMonth = parseInt(tbSelMonth.value);
  
  aCell.bgColor = gcBG;
  with (aCell.children["cellText"]){
      var iDay = parseInt(innerText);
      if (color==gcGray)
        iOffset = (Victor<10)?-1:1;

    /*** below temp patch by maxiang ***/
    if( color == gcGray ){
        iOffset = (iDay < 15 )?1:-1;
    }
    /*** above temp patch by maxiang ***/

    iMonth += iOffset;
    if (iMonth<1) {
        iYear--;
        iMonth = 12;
    }else if (iMonth>12){
        iYear++;
        iMonth = 1;
    }
  }
  fSetDate(iYear, iMonth, iDay);
}

function Point(iX, iY){
    this.x = iX;
    this.y = iY;
}

function fBuildCal(iYear, iMonth) {
  var aMonth=new Array();
  for(i=1;i<7;i++)
      aMonth[i]=new Array(i);
  
  var dCalDate=new Date(iYear, iMonth-1, 1);
  var iDayOfFirst=dCalDate.getDay();
  var