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.danod.length; i++) {
        if (document.calform.danod.options[i].value == day){
		document.calform.danod.selectedIndex = i;
        }
    }
    for (i=0; i<document.calform.mjesecod.length; i++) {
        if (document.calform.mjesecod.options[i].value == month){
		document.calform.mjesecod.selectedIndex = i;
        }
    }
    for (i=0; i<document.calform.godinaod.length; i++) {
        if (document.calform.godinaod.options[i].value == year){
		document.calform.godinaod.selectedIndex = i;
        }
    }
}
function setEndDates(day,month,year) {
    for (i=0; i<document.calform.dando.length; i++) {
        if (document.calform.dando.options[i].value == day){
		document.calform.dando.selectedIndex = i;
        }
    }
    for (i=0; i<document.calform.mjesecdo.length; i++) {
        if (document.calform.mjesecdo.options[i].value == month){
		document.calform.mjesecdo.selectedIndex = i;
        }
    }
    for (i=0; i<document.calform.godinado.length; i++) {
        if (document.calform.godinado.options[i].value == year){
		document.calform.godinado.selectedIndex = i;
        }
    }
} 
