document.write('<iframe id=CalFrameAlone name=CalFrameAlone frameborder=0 src=calendar.htm style=display:none;position:absolute;z-index:100></iframe>');
document.onclick=hideCalendarAlone;

function showCalendarAlone(sImg,bOpenBound,sFld1,sFld2,sCallback)
{
	var fld1,fld2;
	var cf=document.getElementById("CalFrameAlone");
	var wcf=window.frames.CalFrameAlone;
	var oImg=document.getElementById(sImg);
	if(!oImg){alert("error1");return;}
	if(!sFld1){alert("error2");return;}
	fld1=document.getElementById(sFld1);
	if(!fld1){alert("error3");return;}
	if(fld1.tagName!="INPUT"||fld1.type!="text"){alert("error4");return;}
	if(sFld2)
	{
		fld2=document.getElementById(sFld2);
		if(!fld2){alert("error5");return;}
		if(fld2.tagName!="INPUT"||fld2.type!="text"){alert("error6");return;}
	}
	if(!wcf.bCalLoaded){alert("error7");return;}
	if(cf.style.display=="block"){cf.style.display="none";return;}
	
	//var eT=0,eL=0,p=oImg;
	//var sT=document.body.scrollTop,sL=document.body.scrollLeft;
	//var eH=oImg.height,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";
	
	var eT=0,eL=0,p=oImg;
	var sT=document.body.scrollTop,sL=document.body.scrollLeft;
	var eH=oImg.height,eW=oImg.width;
	while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent;}
	cf.style.top=parseInt((document.body.clientHeight-(eT-sT)-eH>=cf.height)?eT+eH:eT-cf.height)+"px";
	cf.style.left=parseInt((document.body.clientWidth-(eL-sL)>=cf.width)?eL:eL+eW-cf.width)+"px";
	cf.style.display="block";
	
	wcf.openbound=bOpenBound;
	wcf.fld1=fld1;
	wcf.fld2=fld2;
	wcf.callback=sCallback;
	wcf.initCalendar();
}
function hideCalendarAlone()
{
	var cf=document.getElementById("CalFrameAlone");
	cf.style.display="none";
}