function calendar_change(A){date=new Date();
curY=date.getYear();if(curY<1900){curY=curY+1900
}curM="0"+(date.getMonth()+1);len=curM.length;
docY=calendar.document.getElementById("document_year").value-0;
docM=calendar.document.getElementById("document_month").value-0;
if(curY>docY||(curY==docY&&curM>docM)){if(document.getElementById("calendar")){document.getElementById("calendar").src="/calendar/"+A+"/"+curY+curM.substring(len-2,len)+".html"
}if(document.getElementById("calendar_nyushi")){id=A-0;
id=id+100;document.getElementById("calendar_nyushi").src="/calendar/"+id+"/"+curY+curM.substring(len-2,len)+".html"
}}}function link_change(){date=new Date();
curY=date.getYear();if(curY<1900){curY=curY+1900
}curM=date.getMonth()+1;curD=date.getDate();
docY=document.getElementById("document_year").value-0;
docM=document.getElementById("document_month").value-0;
if(curY>=docY&&curM>=docM){document.getElementById("prev").innerHTML="\u524d\u6708";
wd=date.getDay();if(wd==0){wd=7
}w=Math.floor((curD-wd+13)/7)-1;
for(i=0;i<w;i++){idx=i+1;document.getElementById("week"+idx).innerHTML="\u7b2c"+idx+"\u9031"
}for(i=0;i<curD-1;i++){idx=i+1;
document.getElementById("day"+idx).innerHTML=idx+"<br>(0\u4ef6)";
document.getElementById("day"+idx).className="tbl06"
}}}




var PickupCalendar = function(
		elm, url, year, month){
	if(window == this || !this.init){
		return new PickupCalendar(
			elm, url, year, month);
	}
	return this.init(
		elm, url, year, month);
};

PickupCalendar.prototype.init = function(
		elm, url, year, month){
	this.elm = elm;
	this.url = url;
	this.year = year;
	this.month = month;
};

PickupCalendar.prototype.load = function(){
	var elm = this.elm;
	$.ajax({
		url: this.url,
		type: "post",
		cache: false,
		data: {
			"year": this.year,
			"month" : this.month
		},
		success: function(html){
			$('#' + elm).empty().append(html);
			EventHandler.unbind();
			EventHandler.bind();
		}
	});
};

