function bookingsdate(x)
	{
		if (x == 'monthday')
		{
		var plus
		plus = parseInt(document.forms.resrvForm.elements['checkin_' + x].value) + 1
		if (plus < 10) { plus = '0' + plus};
		document.forms.resrvForm.elements['checkout_' + x].value = plus
		}
		else
		{
		document.forms.resrvForm.elements['checkout_' + x].value = document.forms.resrvForm.elements['checkin_' + x].value
		}
	}
function formatdate()
	{
	var tempmonth
	
	tempmonth = parseFloat(document.forms.resrvForm.elements['checkin_month'].value)
	
		document.forms.resrvForm.elements['checkin_year_month'].value = document.forms.resrvForm.elements['checkin_year'].value + "-" + tempmonth

	tempmonth = parseFloat(document.forms.resrvForm.elements['checkout_month'].value)
	
		document.forms.resrvForm.elements['checkout_year_month'].value = document.forms.resrvForm.elements['checkout_year'].value + "-" + tempmonth

	}

 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.checkin_month.selectedIndex = mth;
		 document.resrvForm.checkin_monthday.selectedIndex = dd - 1;
		 document.resrvForm.checkout_year.value= yy;
		 document.resrvForm.checkout_monthday.selectedIndex = dd - dd;
		 document.resrvForm.checkout_month.selectedIndex = mth-mth;
		 document.resrvForm.checkout_year.value= yy+1;
     }
     else if ((dd>=29 ) || ((dd>=27 ) && (mth==1)))
     {
	 document.resrvForm.checkin_month.selectedIndex = mth+1;
     document.resrvForm.checkin_monthday.selectedIndex = dd-dd;
     document.resrvForm.checkin_year.value= yy;
     document.resrvForm.checkout_monthday.selectedIndex = (dd-dd)+1;
     document.resrvForm.checkout_month.selectedIndex = mth + 1;
     document.resrvForm.checkout_year.value= yy;
    }
   else
    {
   	document.resrvForm.checkin_month.selectedIndex=mth;
   	document.resrvForm.checkin_monthday.selectedIndex=dd+1;
   	document.resrvForm.checkout_year.value= yy;
   	document.resrvForm.checkout_month.selectedIndex=mth;
   	document.resrvForm.checkout_monthday.selectedIndex=dd+3;
	document.resrvForm.checkout_year.value= yy;
   }
}

