	function displaySearch(strBookingURL,strAffiliateID, strProviderID, strPremisesCode, strAccomType, intLeadTime, strBackColour, strObjColour)
	{	
		

		document.write('<form action="" name="CheckPremfrm" id="CheckPremfrm" style="margin: 5px 0px 0px 0px;">')
		
		//hidden controls to hold parameters passed in for button click event below 
		document.write('<input type= "hidden" name="hdnBookingURL" value=' + strBookingURL + '>')
		document.write('<input type= "hidden" name="hdnAffiliateID" value=' + strAffiliateID + '>')
		document.write('<input type= "hidden" name="hdnProviderID" value=' + strProviderID + '>')
		document.write('<input type= "hidden" name="hdnPremisesCode" value=' + strPremisesCode + '>')
		document.write('<img src="images/booking_header_1.gif" width="240" height="5" border="0" alt="">')
		document.write('<TABLE width="230" cellSpacing="0" cellPadding="3" border="0" bgcolor=' + strBackColour + '  style="border: 2px solid #D3BD7E;">')
		
		document.write('<TR>')
		document.write('<TD>')
		document.write('<TABLE width="230" cellSpacing="0" cellPadding="3" border="0">')
		document.write('<TR>')
		document.write('<td colspan="4">')
		document.write('<img src="images/booking_header_2.gif" width="199" height="23" border="0" alt="">')
		document.write('</td>')
		document.write('</TR>')
		document.write('<TR>')
		document.write('<TD width="55" align="left" valign="top" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10px; color: #806413; font-weight: bold;">Adults<br><select name="selNumAdults" style="MARGIN-TOP:1px; border: 1px solid #745B13; font-size: 12px; color: #000000; background-color: ' + strObjColour + ';">')
		document.write('<option value="1">1</option>')
		document.write('<option value="2" selected>2</option>')
		document.write('<option value="3">3</option>')
		document.write('<option value="4">4</option>')
		document.write('<option value="5">5</option>')
		document.write('<option value="6">6</option>')
		document.write('<option value="7">7</option>')
		document.write('<option value="8">8</option>')
		document.write('</select>')
		document.write('</TD>')
		document.write('<TD width="55" valign="top" align="left" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10px; color: #806413; font-weight: bold;">Children<br><select name="selNumChildren" style="MARGIN-TOP:1px; border: 1px solid #745B13; font-size: 12px; color: #000000; background-color: ' + strObjColour + ';">')
		document.write('<option value="0" selected>0</option>')
		document.write('<option value="1">1</option>')
		document.write('<option value="2">2</option>')
		document.write('<option value="3">3</option>')
		document.write('<option value="4">4</option>')
		document.write('<option value="5">5</option>')
		document.write('<option value="6">6</option>')
		document.write('<option value="7">7</option>')
		document.write('<option value="8">8</option>')
		document.write('</select>')
		document.write('</TD>')
		document.write('<TD width="55" valign="top" align="left" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10px; color: #806413; font-weight: bold;">Infants<br><select name="selNumInfants" style="MARGIN-TOP:1px; border: 1px solid #745B13; font-size: 12px; color: #000000; background-color: ' + strObjColour + ';">')
		document.write('<option value="0" selected>0</option>')
		document.write('<option value="1">1</option>')
		document.write('<option value="2">2</option>')
		document.write('<option value="3">3</option>')
		document.write('<option value="4">4</option>')
		document.write('<option value="5">5</option>')
		document.write('<option value="6">6</option>')
		document.write('<option value="7">7</option>')
		document.write('<option value="8">8</option>')
		document.write('</SELECT>')
		document.write('</TD>')

		document.write('<TD width="60" valign="top" align="left" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10px; color: #806413; font-weight: bold;">')
		document.write('Night(s)<br>')
		document.write('<select name="selNumNights" style="MARGIN-TOP:1px; border: 1px solid #745B13; font-size: 12px; color: #000000; background-color: ' + strObjColour + ';">')
		document.write('<option value="1" selected>1</option>')
		document.write('<option value="2" >2</option>')
		document.write('<option value="3" >3</option>')
		document.write('<option value="4" >4</option>')
		document.write('<option value="5" >5</option>')
		document.write('<option value="6" >6</option>')
		document.write('<option value="7">7</option>')
		document.write('<option value="8" >8</option>')
		document.write('<option value="9" >9</option>')
		document.write('<option value="10" >10</option>')
		document.write('<option value="11" >11</option>')
		document.write('<option value="12" >12</option>')
		document.write('<option value="13" >13</option>')
		document.write('<option value="14" >14</option>')
		document.write('<option value="15" >15</option>')
		document.write('<option value="16" >16</option>')
		document.write('<option value="17" >17</option>')
		document.write('<option value="18" >18</option>')
		document.write('<option value="19" >19</option>')
		document.write('<option value="20" >20</option>')
		document.write('<option value="21" >21</option>')
		document.write('<option value="22" >22</option>')
		document.write('<option value="23" >23</option>')
		document.write('<option value="24" >24</option>')
		document.write('<option value="25" >25</option>')
		document.write('<option value="26" >26</option>')
		document.write('<option value="27" >27</option>')
		document.write('<option value="28" >28</option>')
		document.write('<option value="29" >29</option>')
		document.write('<option value="30" >30</option>')
		document.write('<option value="31" >31</option>')
		document.write('</select>')
		document.write('</TD>')
		document.write('</TR>')
		document.write('</TABLE>')
		document.write('<TABLE width="230" cellSpacing="0" cellPadding="3" border="0">')
		document.write('<TR>')
		document.write('<TD valign="top" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; color: #806413; font-weight: bold;">')
		document.write('Arrival date<br>')
		document.write('<INPUT TYPE="TEXT" id="SmallText" NAME="selCalendar" SIZE="10" style="border: 1px solid #745B13; font-size: 12px; color: #000000; background-color: #FFF7E0; WIDTH: 130px; Cursor:hand;" VALUE="Click Here for Calendar" READONLY="TRUE" ONCLICK="JavaScript:createCalendar(document.CheckPremfrm.selArriveMonth.value, document.CheckPremfrm.selArriveYear.value)"><br>')

		document.write('<input type="hidden" value="25" name="selArriveDay" >')
		document.write('<input type="hidden" value="7" name="selArriveMonth">')
		document.write('<input type="hidden" value="2006" name="selArriveYear">')

		var today = new Date();
		var icount = 7;
		if(strAccomType=='SA')
		{
			today.setDate(today.getDate()+intLeadTime);
			var icount = 0;
		}
		else //SC
		{
			while(datePart('w',dateAdd('d', icount, today)) !=6)
				{
					icount = icount + 1;
				}
		}

		today.setDate(today.getDate()+icount);
		
		if(today.getDay()==0){document.forms['CheckPremfrm'].selCalendar.value ='Sun' + " " + parseInt(today.getDate())  + " " + monthName[today.getMonth()] + " " + today.getFullYear()} 
			else {document.forms['CheckPremfrm'].selCalendar.value = weekName[parseInt(today.getDay())-1]  + " " + parseInt(today.getDate())  + " " + monthName[today.getMonth()] + " " + today.getFullYear()}
		document.forms['CheckPremfrm'].selArriveMonth.value=today.getMonth()+1;
		document.forms['CheckPremfrm'].selArriveYear.value= today.getFullYear(); 
		document.forms['CheckPremfrm'].selArriveDay.value=parseInt(today.getDate());

		document.write('</TD>')

		document.write('<TD valign="bottom"><INPUT type=button id=Search_Button value = "Search" alt="Check Availability" style="border: 1px solid #745B13; font-size: 12px; color: #FFFFFF; background-color: #BDA45D; font-weight: bold; width: 70px; height: 20px;" onclick="javascript:Search();"></TD>')

		document.write('<TR>')
		document.write('</TABLE>')
		document.write('</TD>')
		document.write('</TR>')
		document.write('</TABLE>')

		document.write('</FORM>')
	}

	//declare variable to hold URL - build URL from controls on page - redirect page to this URL
	function Search() 
	{
	//variable to hold our deepLink
	var deepLink

	//build the URL for deepLinking
	deepLink = document.forms['CheckPremfrm'].hdnBookingURL.value 	
	deepLink = deepLink + "?affiliateid=" + document.forms['CheckPremfrm'].hdnAffiliateID.value 	
	deepLink = deepLink + "&ProvID=" + document.forms['CheckPremfrm'].hdnProviderID.value 	
	deepLink = deepLink + "&PremisesCode=" + document.forms['CheckPremfrm'].hdnPremisesCode.value 	
	deepLink = deepLink + "&AffiliatevisitID=" + "1"
	deepLink = deepLink + "&selNumAdults=" + document.forms['CheckPremfrm'].selNumAdults.value 	
	deepLink = deepLink + "&selNumChildren=" + document.forms['CheckPremfrm'].selNumChildren.value 
	deepLink = deepLink + "&selNumInfants=" + document.forms['CheckPremfrm'].selNumInfants.value 
	deepLink = deepLink + "&selArriveMonth=" + document.forms['CheckPremfrm'].selArriveMonth.value 
	deepLink = deepLink + "&selArriveYear=" + document.forms['CheckPremfrm'].selArriveYear.value 
	deepLink = deepLink + "&selArriveDay=" + document.forms['CheckPremfrm'].selArriveDay.value 
	deepLink = deepLink + "&selNumNights=" + document.forms['CheckPremfrm'].selNumNights.value 
	deepLink = deepLink + "&selCurrency=978"
	deepLink = deepLink + "&isAdvanced=" + "1"
	deepLink = deepLink + "&hdnAction=" + "search"

	//redirect page to our deepLink URL
	window.location.href = deepLink;
	}

	function dateAdd(p_Interval, p_Number, p_Date)
	{//simulate the date Add function in VB Script
		p_Number = new Number(p_Number);
		var dt = new Date(p_Date);
		switch(p_Interval.toLowerCase()){
			case "d":{		// day
				dt.setDate(dt.getDate() + p_Number);
				break;
			}
		}
		return dt;
	}

	function datePart(p_Interval, p_Date)
	{//simulate the date Part function in VB Script
		var dtPart = new Date(p_Date);
		switch(p_Interval.toLowerCase()){
			case "w": return dtPart.getDay();	// weekday
			}
	}