document.write('<IFRAME STYLE="display:none;position:absolute;width:165;height:270;z-index=100" ID="CalFrame" MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE FRAMEBORDER=0 SCROLLING=NO SRC=""></IFRAME>');
function y2k(number)	{
	return (number < 1000) ? number + 1900 : number;
}

function calendarWin(calendarDir,the_img,the_target) {
	var time = new Date();
	var strMonth = time.getMonth();
	var strYear = y2k(time.getYear());
	eval('the_targetObj=' + the_target +';');
	str_theDateL=customSplit(the_targetObj.value, '/', 'theDate')
	if (str_theDateL==3)
		if ( (theDate[1]>=1 && theDate[1]<=12) && (theDate[2]>=1900 && theDate[2]<=2101) )  {
   			strMonth=theDate[1]-1;
   			strYear=theDate[2];
   		}
	if (navigator.appName == "Netscape")
		ShowCalendarNN(calendarDir,the_target,strMonth,strYear);
	else
		ShowCalendarIE(calendarDir,the_img,the_target,strMonth,strYear);
}

function ShowCalendarNN(calendarDir,strTarget,strMonth,strYear) {
	var attributes, winX, winY;
	winX = (screen.availWidth - 165)*.5;
	winY = (screen.availHeight - 218)*.5;
	attributes = 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,height=218,width=165,left='+winX+',top='+winY;
	myWindow = open(calendarDir+'/calendar.asp?txt_month='+strMonth+'&txt_year=' + strYear + '&txt_target=' + strTarget,'calwin',attributes);
	if (myWindow.opener == null) myWindow.opener = self;
}
	
function ShowCalendarIE(calendarDir,imgObj,strTarget,strMonth,strYear)	{
	var dF=document.all.CalFrame;
    	var eL=0; var eT=0;
    	dF.src=calendarDir+'/calendar.asp?txt_month='+strMonth+'&txt_year='+strYear + '&txt_target=' + strTarget; 		
    	for(var p=imgObj; p&&p.tagName!='BODY'; p=p.offsetParent){
			eL+=p.offsetLeft;
      		eT+=p.offsetTop;
    	}
    	var eH=imgObj.offsetHeight;
    	var dH=200;
    	var sT=document.body.scrollTop;		
		dF.style.left=eL;

    	if(eT-dH >= sT && eT+eH+dH > document.body.clientHeight+sT)
      		dF.style.top=eT-dH;
    	else
      		dF.style.top=eT+eH;
			
    	if("none"==dF.style.display)
      		dF.style.display="block";
}