
 function initDate()
 {
   var now = new Date();
   var mth = now.getMonth();
   var dd = now.getDate();
   var yy = now.getFullYear();
   if (mth < 10)
    {
      mth == 0 + mth;
     }
   if (dd < 10)
    {
      dd == 0 + dd;
    }
     if ((mth==11) && (dd>=29)) {
		 document.resrvForm.doa_mm.selectedIndex = mth;
		 document.resrvForm.doa_dd.selectedIndex = dd - 1;
		 document.resrvForm.dod_yy.value= yy;
		 document.resrvForm.dod_dd.selectedIndex = dd - dd;
		 document.resrvForm.dod_mm.selectedIndex = mth-mth;
		 document.resrvForm.dod_yy.value= yy+1;
     }
     else if ((dd>=29 ) || ((dd>=27 ) && (mth==1)))
     {
	 document.resrvForm.doa_mm.selectedIndex = mth+1;
     document.resrvForm.doa_dd.selectedIndex = dd-dd;
     document.resrvForm.doa_yy.value= yy;
     document.resrvForm.dod_dd.selectedIndex = (dd-dd)+1;
     document.resrvForm.dod_mm.selectedIndex = mth + 1;
     document.resrvForm.dod_yy.value= yy;
    }
   else
    {
   	document.resrvForm.doa_mm.selectedIndex=mth;
   	document.resrvForm.doa_dd.selectedIndex=dd+1;
   	document.resrvForm.dod_yy.value= yy;
   	document.resrvForm.dod_mm.selectedIndex=mth;
   	document.resrvForm.dod_dd.selectedIndex=dd+3;
	document.resrvForm.dod_yy.value= yy;
   }
}


function initDates()
	{
		for (i = 0; i < document.getElementsByTagName('form').length; i++)
			{
				var now = new Date();
				var myDate = new Date();
				myDate.setDate(now.getDate() + 1);
				if (document.forms[i].elements['doa_dd'] && document.forms[i].elements['doa_mm'])
					{
						document.forms[i].elements['doa_dd'].value = addAnO(now.getDate());
						document.forms[i].elements['doa_mm'].value = addAnO(now.getMonth() + 1);
					}
				if (document.forms[i].elements['dod_dd'] && document.forms[i].elements['dod_mm'])
					{
						document.forms[i].elements['dod_dd'].value = addAnO(myDate.getDate());
						document.forms[i].elements['dod_mm'].value = addAnO(myDate.getMonth() + 1);
					}
			}
	}	

function addAnO(myVar)
	{
		if (myVar < 10)
			{
				myVar = '0' + myVar;
			}
		return myVar;
	}