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 showbill(page,pwidth,pheight) {
	createPopUpBill(page,"ActiveCalendarWindow",pwidth,pheight,"yes","no");
}
function createPopUpBill(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 getEUDate(year,month,day){
	self.close();
	opener.setEUDates(day,month,year);
}
function getUSDate(year,month,day){
	self.close();
	opener.setUSDates(day,month,year);
}
function setStartDates(day,month,year) {
    for (i=0; i<document.f1.date.length; i++) {
        if (document.f1.date.options[i].value == day){
		document.f1.date.selectedIndex = i;
        }
    }
    month--;
    month=month+':'+year;
    for (i=0; i<document.f1.month.length; i++) {
        if (document.f1.month.options[i].value == month){
		document.f1.month.selectedIndex = i;
        }
    }
    onchangepopulateIndate();
     for (i=0; i<document.f1.date.length; i++) {
        if (document.f1.date.options[i].value == day){
		document.f1.date.selectedIndex = i;
        }
    }
    changeDate('date','month');
    month--;
    month=month+':'+year;
    for (i=0; i<document.f1.month.length; i++) {
        if (document.f1.month.options[i].value == month){
		document.f1.month.selectedIndex = i;
        }
    }
}
function setEndDates(day,month,year) {
       for (i=0; i<document.f1.dateOut.length; i++) {
        if (document.f1.dateOut.options[i].value == day){
		document.f1.dateOut.selectedIndex = i;
        }
    }
    month--;
    month=month+':'+year;
    for (i=0; i<document.f1.monthOut.length; i++) {
        if (document.f1.monthOut.options[i].value == month){
		document.f1.monthOut.selectedIndex = i;
        }
    }
    onchangepopulateOutdate();
     for (i=0; i<document.f1.dateOut.length; i++) {
        if (document.f1.dateOut.options[i].value == day){
		document.f1.dateOut.selectedIndex = i;
        }
    }
    checkDate();
    month--;
    month=month+':'+year;
    for (i=0; i<document.f1.monthOut.length; i++) {
        if (document.f1.monthOut.options[i].value == month){
		document.f1.monthOut.selectedIndex = i;
        }
    }
}
function setEUDates(day,month,year) {
	date=day+'-'+month+'-'+year;
	document.calform.eu.value = date;
}
function setUSDates(day,month,year) {
	date=month+'/'+day+'/'+year;
	document.calform.us.value = date;
}
 

