function showcalendar(page,pwidth,pheight) {
	createPopUp(page,"ActiveCalendarWindow",pwidth,pheight,"no","no");
}
function createPopUp(theURL, Name, popW, popH, scroll, resize) {
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+'';
	Win = window.open(theURL, Name, winProp);
	Win.window.focus();
}
function getStartDate(year,month,day) {
	self.close();
	opener.setStartDates(day,month,year);
}
function getEndDate(year,month,day) {
	self.close();
	opener.setEndDates(day,month,year); 
}
function setStartDates(day,month,year) {
    for (i=0; i<document.calform.sd.length; i++) {
        if (document.calform.sd.options[i].value == day){
		document.calform.sd.selectedIndex = i;
        }
    }
    for (i=0; i<document.calform.sm.length; i++) {
        if (document.calform.sm.options[i].value == month){
		document.calform.sm.selectedIndex = i;
        }
    }
    for (i=0; i<document.calform.sy.length; i++) {
        if (document.calform.sy.options[i].value == year){
		document.calform.sy.selectedIndex = i;
        }
    }
}
function setEndDates(day,month,year) {
    for (i=0; i<document.calform.ed.length; i++) {
        if (document.calform.ed.options[i].value == day){
		document.calform.ed.selectedIndex = i;
        }
    }
    for (i=0; i<document.calform.em.length; i++) {
        if (document.calform.em.options[i].value == month){
		document.calform.em.selectedIndex = i;
        }
    }
    for (i=0; i<document.calform.ey.length; i++) {
        if (document.calform.ey.options[i].value == year){
		document.calform.ey.selectedIndex = i;
        }
    }
}
