function bookmarksite(title, url){if (document.all)window.external.AddFavorite(url, title);else if (window.sidebar)window.sidebar.addPanel(title, url, "")}function IsLeapYear(yrStr){ var leapYear = false; var year = parseInt(yrStr, 10); if (year%4 == 0)   { 	leapYear = true;	if (year%100 == 0)	 {	  leapYear = false;	  if (year%400 == 0)	   {	    leapYear = true;		}	  }   }  return leapYear; }function getDaysInMonth(mthIdx, yrStr) { var maxDays = 31; if (mthIdx == 1)	{	 if (IsLeapYear(yrStr))	   { 	    maxDays = 29;	   }	 else		{		  maxDays = 28;		}     } if (mthIdx == 3 || mthIdx == 5 || mthIdx == 8 || mthIdx == 10)	{	 maxDays = 30;	 } return maxDays;}function adjustDate(mthIdx, Dt, initDate){var value = 0;var today = new Date();var theYear = parseInt(today.getYear(),10);if (mthIdx < today.getMonth()) {	theYear = (parseInt(today.getYear(),10) + 1);}if (theYear < 100) {	theYear = "19" + theYear;	}else {	if ((theYear - 100) < 10) {		theYear = "0" + (theYear - 100);		}	else 		{		theYear = (theYear - 100) + "";		}	theYear = "20" + theYear}var numDays = getDaysInMonth(mthIdx, theYear); // checks whether to initialize date or not.if (initDate == 1) 	{	  if (numDays - Dt == 7)		{		document.resrvForm.doa_mm.options.selectedIndex = mthIdx;	    document.resrvForm.doa_dd.options.selectedIndex = numDays - 1;		document.resrvForm.dod_mm.options.selectedIndex = document.resrvForm.doa_mm.options.selectedIndex + 1;	    document.resrvForm.dod_dd.options.selectedIndex =  7 - (numDays - Dt);		}		else if (numDays - Dt  < 7)				{				document.resrvForm.doa_mm.options.selectedIndex = mthIdx + 1;				document.resrvForm.doa_dd.options.selectedIndex = 6 - (numDays - Dt);				document.resrvForm.dod_mm.options.selectedIndex = document.resrvForm.doa_mm.options.selectedIndex;				document.resrvForm.dod_dd.options.selectedIndex = 7 - (numDays - Dt);					}		else			{ 			document.resrvForm.doa_mm.options.selectedIndex = mthIdx;			document.resrvForm.doa_dd.options.selectedIndex = (Dt - 1) + 7			document.resrvForm.dod_mm.options.selectedIndex = document.resrvForm.doa_mm.options.selectedIndex;			document.resrvForm.dod_dd.options.selectedIndex = (Dt - 1) + 8;			}		}else	{			if (mthIdx == 1)		{		if (Dt.options.selectedIndex + 1 < numDays) 			{			return 0;			}		else			{			Dt.options.selectedIndex=numDays - 1;			if (numDays == 29)				{				return 99;				}			else				{				return 1;				}			}		}	 if (Dt.options.selectedIndex + 1 < numDays)		{		value = 0;		}	 else		{		if (Dt.options.selectedIndex + 1 > numDays)			{			Dt.options.selectedIndex--;			value = 3;			}		else			{			value = 2;			}		}	 return value;	}}function adjustDateAdv(mthIdx, Dt, initDate){var value = 0;var today = new Date();var theYear = parseInt(today.getYear(),10);if (mthIdx < today.getMonth()) {	theYear = (parseInt(today.getYear(),10) + 1);}if (theYear < 100) {	theYear = "19" + theYear;	}else {	if ((theYear - 100) < 10) {		theYear = "0" + (theYear - 100);		}	else 		{		theYear = (theYear - 100) + "";		}	theYear = "20" + theYear}var numDays = getDaysInMonth(mthIdx, theYear); // checks whether to initialize date or not.if (initDate == 1) 	{	  if (numDays - Dt == 7)		{		document.HotelSearch.doa_mm.options.selectedIndex = mthIdx;	    document.HotelSearch.doa_dd.options.selectedIndex = numDays - 1;		document.HotelSearch.dod_mm.options.selectedIndex = document.HotelSearch.doa_mm.options.selectedIndex + 1;	    document.HotelSearch.dod_dd.options.selectedIndex =  7 - (numDays - Dt);		}		else if (numDays - Dt  < 7)				{				document.HotelSearch.doa_mm.options.selectedIndex = mthIdx + 1;				document.HotelSearch.doa_dd.options.selectedIndex = 6 - (numDays - Dt);				document.HotelSearch.dod_mm.options.selectedIndex = document.HotelSearch.doa_mm.options.selectedIndex;				document.HotelSearch.dod_dd.options.selectedIndex = 7 - (numDays - Dt);					}		else			{ 			document.HotelSearch.doa_mm.options.selectedIndex = mthIdx;			document.HotelSearch.doa_dd.options.selectedIndex = (Dt - 1) + 7			document.HotelSearch.dod_mm.options.selectedIndex = document.HotelSearch.doa_mm.options.selectedIndex;			document.HotelSearch.dod_dd.options.selectedIndex = (Dt - 1) + 8;			}		}else	{			if (mthIdx == 1)		{		if (Dt.options.selectedIndex + 1 < numDays) 			{			return 0;			}		else			{			Dt.options.selectedIndex=numDays - 1;			if (numDays == 29)				{				return 99;				}			else				{				return 1;				}			}		}	 if (Dt.options.selectedIndex + 1 < numDays)		{		value = 0;		}	 else		{		if (Dt.options.selectedIndex + 1 > numDays)			{			Dt.options.selectedIndex--;			value = 3;			}		else			{			value = 2;			}		}	 return value;	}}function amadChange(inM, inD, outM, outD){ var res = adjustDate(inM.options.selectedIndex, inD, 0); if (res != 0 )	{		outD.options.selectedIndex = 0;		if (outM.options.selectedIndex == 11) {			outM.options.selectedIndex = 0;			}		else {			outM.options.selectedIndex = inM.options.selectedIndex + 1;			}		} else	{	outM.options.selectedIndex = inM.options.selectedIndex;	outD.options.selectedIndex = inD.options.selectedIndex + 1;	}return;}function initDate(){	var today = new Date();	var currMth = today.getMonth();	var currDate = today.getDate();	var mth = document.resrvForm.doa_dd.options.selectedIndex = currMth;	var Dt = document.resrvForm.doa_dd.options.selectedIndex = currDate;	adjustDate(mth, Dt, 1);}function initDateAdv(){	var today = new Date();	var currMth = today.getMonth();	var currDate = today.getDate();	var mth = document.HotelSearch.doa_dd.options.selectedIndex = currMth;	var Dt = document.HotelSearch.doa_dd.options.selectedIndex = currDate;	adjustDateAdv(mth, Dt, 1);}function newWindow(curr){currWindow = window.open(curr, 'CurrConverter', 'width=460,height=310');currWindow.focus;}