function showCalendar(sImg,bOpenBound) {
	var checkyear,checkmonth,checkday;
	var cf=document.getElementById("CalFrame");
	var wcf=window.frames.CalFrame;
	var oImg=document.getElementById(sImg);
	
	checkyear  = document.getElementById("checkinyear");
	checkmonth = document.getElementById("checkinmonth");
	checkday   = document.getElementById("checkinday");
	
	if(cf.style.display=="block") {
		cf.style.display="none";return;
	}
	
	var eT = 0;
	var eL = 0;
	var p  = oImg;
	var sT = document.body.scrollTop;
	var sL = document.body.scrollLeft;
	var eH = oImg.height;
	var eW = oImg.width;
	while(p && p.tagName != "body"){
		eT += p.offsetTop;
		eL += p.offsetLeft;
		p   = p.offsetParent;
	}
	cf.style.top = (document.body.clientHeight - (eT-sT)- eH >= cf.height)?eT+eH : eT-cf.height;
	cf.style.left = (document.body.clientWidth - (eL-sL) >= cf.width)?eL : eL+eW-cf.width;
	
	cf.style.display ="block";
	
	wcf.openbound  = bOpenBound;
	wcf.checkyear  = checkyear;
	wcf.checkmonth = checkmonth;
	wcf.checkday   = checkday;
	wcf.initCalendar();
}

function hideCalendar() {
	var cf = document.getElementById("CalFrame");
	cf.style.display="none";
}
