//   Need://   function cal1_GetData(mm, yy)//   function cal1_ActionCallback(info)//   in main program  - example at bottomfunction cal1_init(elem, mm, yy, disp){     if (mm == "") {          var ndt= new Date()          var yy = ndt.getFullYear()          var mm = ndt.getMonth()+1     }     if (disp == true) cal1_Display(elem, mm, yy)}function cal1_Display(elem, mm, yy){     var day_hdgs = new Array("S","M","T","W","T","F","S")     // get day specific info from server     var cal = cal1_GetData(mm, yy)     // calc hdgs     var prev_mm = parseFloat(mm)-1     var prev_yy = parseFloat(yy)     if (mm==0)     {          prev_mm = 12          prev_yy--     }     var next_mm = parseFloat(mm)+1     var next_yy = parseFloat(yy)     if (mm==12)     {          next_mm = 1          next_yy++     }     var month = monthName(parseFloat(mm),3)     var t = document.getElementById(elem)     // set calendar's month/year     t.month = mm     t.year = yy     // clear table     tableClear(elem, 0)     // display hdgs     var r = document.createElement("tr")     // left - year-     var c = document.createElement("td")     c.appendChild(document.createTextNode("<<"))     c.cal = elem     c.month = mm     c.year = parseFloat(yy)-1     c.className = "cal1hdg"     c.onclick = function() {cal1_Display(this.cal, this.month, this.year)}     r.appendChild(c)     // left - month-     var c = document.createElement("td")     c.appendChild(document.createTextNode("<"))     c.cal = elem     c.month = prev_mm     c.year = prev_yy     c.className = "cal1hdg"     c.onclick = function() {cal1_Display(this.cal, this.month, this.year)}     r.appendChild(c)     //center     var c = document.createElement("td")     c.appendChild(document.createTextNode(month + " " + yy))     c.style.color = "black"     c.style.fontWeight = "bold"     c.colSpan = "3"     c.align = "center"     r.appendChild(c)     // right - month+     var c = document.createElement("td")     c.appendChild(document.createTextNode(">"))     c.cal = elem     c.month = next_mm     c.year = next_yy     c.className = "cal1hdg"     c.onclick = function() {cal1_Display(this.cal, this.month, this.year)}     r.appendChild(c)     // right - year+     var c = document.createElement("td")     c.appendChild(document.createTextNode(">>"))     c.cal = elem     c.month = mm     c.year = parseFloat(yy)+1     c.className = "cal1hdg"     c.onclick = function() {cal1_Display(this.cal, this.month, this.year)}     r.appendChild(c)     t.appendChild(r)     // Days of the week     var r = document.createElement("tr")     for (var i=0; i<day_hdgs.length; i++)     {          var c = document.createElement("td")          c.appendChild(document.createTextNode(day_hdgs[i]))          c.className = "cal1hdg"          r.appendChild(c)     }     t.appendChild(r)     // Days of the month     var dt = formatString(mm, "99") + "/01/" + yy     var daysinmonth = daysInMonth(dt)     var r, dow     // first row     r = document.createElement("tr")     for (var day=0; day<daysinmonth; day++)     {          // get info from server          var cl = getTagValue(cal, "color"+(day+1))          var info = getTagValue(cal, "info"+(day+1))          var dt = formatString(mm, "99") + "/" + formatString(day+1,"99")+"/" + yy          dow = dayOfWeek0(dt)          // any blank spots at beginning?          if (day == 0) {               for (var i=0; i<dow; i++) {                    var c = document.createElement("td")                    r.appendChild(c)               }          }          var c = document.createElement("td")          c.appendChild(document.createTextNode(day+1))          c.className = "cal1dayreg"          c.day = day+1          c.id = elem + (day+1)          c.info = info          c.onclick = function() {cal1_DayClick(this.id, this.day)}          if (cl)          {               c.style.backgroundColor = cl               if (cl == "lightgreen") c.style.color = "black"          }          r.appendChild(c)          // if Sat then end row          if (dow == 6) {               t.appendChild(r)               // need new row?               if (day < daysinmonth) {                    r = document.createElement("tr")               }          }     }     // any blanks at end     if (dow < 6) {          for (var i=dow+1; i<7; i++)               {                    var c = document.createElement("td")                    r.appendChild(c)               }          t.appendChild(r)     }}function cal1_DayClick(id, day){     info = document.getElementById(id).info     cal1_DayDown(id)     cal1_ActionCallback(info)     cal1_DayUp(id)}function cal1_DayDown(id){     eid = document.getElementById(id)     eid.style.borderTopColor = "black"     eid.style.borderLeftColor = "black"     eid.style.borderBottomColor = "white"     eid.style.borderRightColor = "white"}function cal1_DayUp(id){     eid = document.getElementById(id)     eid.style.borderTopColor = "white"     eid.style.borderLeftColor = "white"     eid.style.borderBottomColor = "black"     eid.style.borderRightColor = "black"}//function cal1_GetData(mm, yy)//{//     query = "action=XGET"//     query = query + "&month=" + mm//     query = query + "&year=" + yy////     var xml = xmlRequest(url, query, -1)////     if (xml)//     {//          if (xml.length==0)//          {//               document.getElementById("resptext").firstChild.nodeValue = "Error-1"//               return (false)//          }//          else//          {//               var respcode = displayResponse(xml)//          }//     }//     else//     {//          document.getElementById("resptext").firstChild.nodeValue = "Error-2"//          return (false)//     }////     if (respcode==0)//     {//          return (xml[0])//     }////}
