// JavaScript Document
function showcalendar(page,pwidth,pheight,form_name) {
createPopUp(page,"ActiveCalendarWindow",pwidth,pheight,"no","no", form_name);
}
function createPopUp(theURL, Name, popW, popH, scroll, resize, form_name) {
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();
window.form = form_name;
}
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) {
var form_name = window.form;
for (i=0; i<document.form_name.StartDay.length; i++) {
if (document.form_name.StartDay.options[i].value == day){
document.form_name.StartDay.selectedIndex = i;
}
}
for (i=0; i<document.form_name.StartMonth.length; i++) {
if (document.form_name.StartMonth.options[i].value == month){
document.form_name.StartMonth.selectedIndex = i;
}
}
for (i=0; i<document.form_name.StartYear.length; i++) {
if (document.form_name.StartYear.options[i].value == year){
document.form_name.StartYear.selectedIndex = i;
}
}
}
function setEndDates(day,month,year) {
var form_name = window.form;
for (i=0; i<document.form_name.EndDay.length; i++) {
if (document.form_name.EndDay.options[i].value == day){
document.form_name.EndDay.selectedIndex = i;
}
}
for (i=0; i<document.form_name.EndMonth.length; i++) {
if (document.form_name.EndMonth.options[i].value == month){
document.form_name.EndMonth.selectedIndex = i;
}
}
for (i=0; i<document.form_name.EndYear.length; i++) {
if (document.form_name.EndYear.options[i].value == year){
document.form_name.EndYear.selectedIndex = i;
}
}
}
function setEUDates(day,month,year) {
var form_name = window.form;
date=day+'-'+month+'-'+year;
document.form_name.eu.value = date;
}
function setUSDates(day,month,year) {
	var form_name = window.form;
date=month+'/'+day+'/'+year;
document.form_name.us.value = date;
}
