function inithead(){
cpt.style.backgroundColor = "#003399";
cpt.style.color = "white";
cpt.style.textAlign = "center";
cpt.appendChild(anchorPriorYear);
cpt.appendChild(anchorPriorMonth);
cpt.appendChild(ynm);
cpt.appendChild(anchorNextMonth);
cpt.appendChild(anchorNextYear);
cpt.appendChild(anchorClose);
var row = tblhd.insertRow();
row.align = "center";
var weekStr = new Array("日","一","二","三","四","五","六");
for (var i=0;i<weekStr.length;i++){
var cell = row.insertCell();
cell.innerText = weekStr[i];
cell.style.borderBottom = "solid 1px";
cell.style.cursor = "default";
cell.align = "center";
if(i==0||i==6)cell.style.color="red";
}
}
function initbody(){
for (var i=0;i<6;i++){
var row = tblbd.insertRow();
for (var j=0;j<7;j++){
var cell = row.insertCell();
cell.innerHTML = " ";
cell.style.cursor = "default";
cell.align = "center";
}
}
}
function fillCalendar(adate){
ynm.innerText = adate.getFullYear() + "年" + (adate.getMonth() + 1) + "月";
var tempdate = new Date();
tempdate.setFullYear(adate.getFullYear(),adate.getMonth(),1);
var first = true;
for (var i=0;i<tblbd.rows.length;i++){
for (var j=0;j<tblbd.rows(i).cells.length;j++){
var cell = tblbd.rows(i).cells(j);
cell.innerHTML = " ";
cell.bgcolor = "";
cell.title = "";
if(j==0||j==6) cell.style.color="red";
else cell.style.color="black";
cell.style.backgroundColor = "";
if (tempdate.getDay() == j){
if (!first) continue;
cell.innerText = tempdate.getDate();
var today=new Date();
if (tempdate.getDate() == activeDate.getDate()){
cell.setAttribute("active",true);
hightLightDate(cell);
}
tempdate.setFullYear(tempdate.getFullYear(),tempdate.getMonth(),tempdate.getDate()+1);
first = tempdate.getDate() > 1;
}
}
}
}
function hightLightDate(object){
var tds = tblbd.all.tags("TD");
for (var i=0;i<tds.length;i++){
if (tds(i) != object){
tds(i).style.backgroundColor = tds(i).bgcolor;
tds(i).style.color = tds(i).style.color
}
else{
tds(i).style.backgroundColor = "red";
tds(i).style.color = "white";
}
}
}
function selectDate(){
var i = parseInt(window.event.srcElement.innerText);
if ((!isNaN(i)) && (i<3000)){
activeDate.setFullYear(date.getFullYear(),date.getMonth(),i);
fillCalendar(activeDate);
}
fillInput.value=activeDate.getFullYear()+'-'+(activeDate.getMonth()+1)+"-"+i;
}
function moveDate(){
var k = window.event.keyCode;
switch(k){
case 37: activeDate.setFullYear(activeDate.getFullYear(),activeDate.getMonth(),activeDate.getDate()-1);
break;
case 38: activeDate.setFullYear(activeDate.getFullYear(),activeDate.getMonth(),activeDate.getDate()-7);
break;
case 39: activeDate.setFullYear(activeDate.getFullYear(),activeDate.getMonth(),activeDate.getDate()+1);
break;
case 40: activeDate.setFullYear(activeDate.getFullYear(),activeDate.getMonth(),activeDate.getDate()+7);
break;
}
date.setFullYear(activeDate.getFullYear(),activeDate.getMonth(),activeDate.getDate());
fillCalendar(date);
fillInput.value=activeDate.getFullYear()+'-'+(activeDate.getMonth()+1)+"-"+activeDate.getDate();
}
function goNextMonth(){
date.setMonth(date.getMonth()+1,1);
setActiveDate();
fillCalendar(date);
}
function goNextYear(){
date.setFullYear(date.getFullYear()+1,date.getMonth(),1);
setActiveDate();
fillCalendar(date);
}
function goPriorYear(){
date.setFullYear(date.getFullYear()-1,date.getMonth(),1);
setActiveDate();
fillCalendar(date);
}
function goPriorMonth(){
date.setMonth(date.getMonth()-1,1);
setActiveDate();
fillCalendar(date);
}
function setActiveDate(){
var i = activeDate.getDate();
activeDate.setFullYear(date.getFullYear(),date.getMonth(),i);
while ((date.getMonth() != activeDate.getMonth()) || (date.getFullYear() != activeDate.getFullYear())){
activeDate.setFullYear(date.getFullYear(),date.getMonth(),i--);
}
fillCalendar(date);
}
function showCalendar(e){
calendar.style.top=e.offsetTop+e.offsetHeight;
calendar.style.left=e.offsetLeft;
calshow=true;
fillInput=e;
calendar.style.display="block";
}
function hiddenCal()
{
if(!calshow)calendar.style.display="none";
}
function closeCalendar()
{
calshow=false;
calendar.style.display="none";
}
</SCRIPT>
</HEAD>
Set rsCustomers = Server.CreateObject("ADODB.Recordset")
CampaignID=Request.Form("txtCampaignID")
sql ="SELECT Startdate,enddate FROM Campaign where Campaignid=25"
rsCustomers.Open sql, Cnn
function fUpdateCal(iYear, iMonth) {
myMonth = fBuildCal(iYear, iMonth);
objPrevElement.bgColor = "";
document.all.calSelectedDate.value = "1";
for (w = 1; w < 7; w++) {
for (d = 0; d < 7; d++) {
if (!isNaN(myMonth[w][d])) {
calDateText[((7*w)+d)-7].innerText = myMonth[w][d];
} else {
calDateText[((7*w)+d)-7].innerText = " ";
}
}
}
}
function OKButton()
{
var zjby =document.frm1.tbSelYear.value;
var zjbm =document.frm1.tbSelMonth.value;
var zjbd =document.frm1.calSelectedDate.value;
if (zjbd <10)
{
zjbd ="0"+zjbd;
}
if (zjbm <10)
{
zjbm ="0"+zjbm;
}