	function displaySearch(strBookingURL, strAffiliateID, strProviderID, strLocation,strTownLevel,strPremType,strSharing,strPremName,strGrade,strPrice,strFacilities)
	{	
		document.write('<FORM id=CheckPremfrm name=CheckPremfrm>')

		//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="hdnTownLevel" value=' + strTownLevel + '>')
		document.write('<input type= "hidden" name="hdnPremType" value=' + strPremType + '>')
		document.write('<input type= "hidden" name="hdnSharing" value=' + strSharing + '>')
		document.write('<input type= "hidden" name="hdnPremName" value=' + strPremName + '>')
		document.write('<input type= "hidden" name="hdnGrade" value=' + strGrade + '>')
		document.write('<input type= "hidden" name="hdnPrice" value=' + strPrice + '>')
		document.write('<input type= "hidden" name="hdnFacilities" value=' + strFacilities + '>')
	

		document.write('<TABLE width = 370 border = 0 cellpadding=0 cellspacing=0 class = "table1"><!--outer table for border-->')
		document.write('<TR>')
		document.write('<TD>')
		document.write('<TABLE width = "100%" border=0 cellpadding=0 cellspacing=2><!-- Location -->')

		document.write('<TR>')
		document.write('<TD width="30%">&nbsp;Location:</TD>')
		document.write('</TR>')
		document.write('<TR>')
		document.write('<TD width="70%">')

		//location combo (mandatory)
		if(strTownLevel=="yes")
			{document.write('<SELECT style="WIDTH: 200" name=hdnLocation onchange=showTowns(this.value)>') }
		else
			{document.write('<SELECT style="WIDTH: 200" name=hdnLocation>') }

		document.write('<OPTION value="" ' + ((strLocation=="")?"selected":"") + '>please select</OPTION>') 
		document.write('<OPTION value="DU,D1,,0" ' + ((strLocation=="DU,D1,,0")?"selected":"") + '>Dublin City</OPTION>') 
		document.write('<OPTION value="DU,D1,DCC,0" ' + ((strLocation=="DU,D1,DCC,0")?"selected":"") + '>Dublin City Centre</OPTION>') 
		document.write('<OPTION value="DU,N,D089,0" ' + ((strLocation=="DU,N,D089,0")?"selected":"") + '>Dublin Airport</OPTION>') 
		document.write('<OPTION value="DU,N,,0" ' + ((strLocation=="DU,N,,0")?"selected":"") + '>Dublin County North</OPTION>') 
		document.write('<OPTION value="DU,S,,0" ' + ((strLocation=="DU,S,,0")?"selected":"") + '>Dublin County South</OPTION>') 
		document.write('<OPTION value="DU,W,,0" ' + ((strLocation=="DU,W,,0")?"selected":"") + '>Dublin County West</OPTION>') 
		document.write('<OPTION value="AM,,,0" ' + ((strLocation=="AM,,,0")?"selected":"") + '>Antrim County</OPTION>') 
		document.write('<OPTION value="AH,,,0" ' + ((strLocation=="AH,,,0")?"selected":"") + '>Armagh County</OPTION>') 
		document.write('<OPTION value="AM,BC,B719,0" ' + ((strLocation=="AM,BC,B719,0")?"selected":"") + '>Belfast City</OPTION>') 
		document.write('<OPTION value="CW,,,0" ' + ((strLocation=="CW,,,0")?"selected":"") + '>Carlow County</OPTION>') 
		document.write('<OPTION value="CN,,,0" ' + ((strLocation=="CN,,,0")?"selected":"") + '>Cavan County</OPTION>') 
		document.write('<OPTION value="CE,,,0" ' + ((strLocation=="CE,,,0")?"selected":"") + '>Clare County</OPTION>') 
		document.write('<OPTION value="CK,C1,,0" ' + ((strLocation=="CK,C1,,0")?"selected":"") + '>Cork City</OPTION>') 
		document.write('<OPTION value="CK,N,,0" ' + ((strLocation=="CK,N,,0")?"selected":"") + '>Cork(North) County</OPTION>') 
		document.write('<OPTION value="CK,,,0" ' + ((strLocation=="CK,,,0")?"selected":"") + '>Cork County</OPTION>') 
		document.write('<OPTION value="DY,FV,L709,0" ' + ((strLocation=="DY,FV,L709,0")?"selected":"") + '>Derry City</OPTION>') 
		document.write('<OPTION value="DY,,,0" ' + ((strLocation=="DY,,,0")?"selected":"") + '>Derry County</OPTION>') 
		document.write('<OPTION value="DL,,,0" ' + ((strLocation=="DL,,,0")?"selected":"") + '>Donegal County</OPTION>') 
		document.write('<OPTION value="DN,,,0" ' + ((strLocation=="DN,,,0")?"selected":"") + '>Down County</OPTION>') 
		document.write('<OPTION value="FH,,,0" ' + ((strLocation=="FH,,,0")?"selected":"") + '>Fermanagh County</OPTION>') 
		document.write('<OPTION value="GY,G1,,0" ' + ((strLocation=="GY,G1,,0")?"selected":"") + '>Galway City</OPTION>') 
		document.write('<OPTION value="GY,,,0" ' + ((strLocation=="GY,,,0")?"selected":"") + '>Galway County</OPTION>') 
		document.write('<OPTION value="KY,,,0" ' + ((strLocation=="KY,,,0")?"selected":"") + '>Kerry County</OPTION>') 
		document.write('<OPTION value="KE,,,0" ' + ((strLocation=="KE,,,0")?"selected":"") + '>Kildare County</OPTION>') 
		document.write('<OPTION value="KK,,K037,0" ' + ((strLocation=="KK,,K037,0")?"selected":"") + '>Kilkenny City</OPTION>') 
		document.write('<OPTION value="KK,,,0" ' + ((strLocation=="KK,,,0")?"selected":"") + '>Kilkenny County</OPTION>') 
		document.write('<OPTION value="LS,,,0" ' + ((strLocation=="LS,,,0")?"selected":"") + '>Laois County</OPTION>') 
		document.write('<OPTION value="LM,,,0" ' + ((strLocation=="LM,,,0")?"selected":"") + '>Leitrim County</OPTION>') 
		document.write('<OPTION value="LK,L1,,0" ' + ((strLocation=="LK,L1,,0")?"selected":"") + '>Limerick City</OPTION>') 
		document.write('<OPTION value="LK,,,0" ' + ((strLocation=="LK,,,0")?"selected":"") + '>Limerick County</OPTION>') 
		document.write('<OPTION value="DY,FV,L709,0" ' + ((strLocation=="DY,FV,L709,0")?"selected":"") + '>Londonderry City</OPTION>') 
		document.write('<OPTION value="DY,,,0" ' + ((strLocation=="DY,,,0")?"selected":"") + '>Londonderry County</OPTION>') 
		document.write('<OPTION value="LD,,,0" ' + ((strLocation=="LD,,,0")?"selected":"") + '>Longford County</OPTION>') 
		document.write('<OPTION value="LH,,,0" ' + ((strLocation=="LH,,,0")?"selected":"") + '>Louth County</OPTION>') 
		document.write('<OPTION value="MO,,,0" ' + ((strLocation=="MO,,,0")?"selected":"") + '>Mayo County</OPTION>') 
		document.write('<OPTION value="MH,,,0" ' + ((strLocation=="MH,,,0")?"selected":"") + '>Meath County</OPTION>') 
		document.write('<OPTION value="MN,,,0" ' + ((strLocation=="MN,,,0")?"selected":"") + '>Monaghan County</OPTION>') 
		document.write('<OPTION value="OY,,,0" ' + ((strLocation=="OY,,,0")?"selected":"") + '>Offaly County</OPTION>') 
		document.write('<OPTION value="RN,,,0" ' + ((strLocation=="RN,,,0")?"selected":"") + '>Roscommon County</OPTION>') 
		document.write('<OPTION value="CE,,S020,0" ' + ((strLocation=="CE,,S020,0")?"selected":"") + '>Shannon Airport</OPTION>') 
		document.write('<OPTION value="SO,,,0" ' + ((strLocation=="SO,,,0")?"selected":"") + '>Sligo County</OPTION>') 
		document.write('<OPTION value="TI,,,0" ' + ((strLocation=="TI,,,0")?"selected":"") + '>Tipperary County</OPTION>') 
		document.write('<OPTION value="TE,,,0" ' + ((strLocation=="TE,,,0")?"selected":"") + '>Tyrone County</OPTION>') 
		document.write('<OPTION value="WD,W1,,0" ' + ((strLocation=="WD,W1,,0")?"selected":"") + '>Waterford City</OPTION>') 
		document.write('<OPTION value="WD,,,0" ' + ((strLocation=="WD,,,0")?"selected":"") + '>Waterford County</OPTION>') 
		document.write('<OPTION value="WH,,,0" ' + ((strLocation=="WH,,,0")?"selected":"") + '>Westmeath County</OPTION>') 
		document.write('<OPTION value="WX,,,0" ' + ((strLocation=="WX,,,0")?"selected":"") + '>Wexford County</OPTION>') 
		document.write('<OPTION value="WW,,,0" ' + ((strLocation=="WW,,,0")?"selected":"") + '>Wicklow County</OPTION>') 
		document.write('</SELECT>') 
		document.write('<TD><!-- Prem Type -->')
		document.write('</TR>')

		//town level combo (optional) - see event on location combo - also remove event from body onload on your html page to initially display town level combo
		document.write('<TR>')
		document.write('<TD >')
		document.write('<DIV id="txtTowns"></div>')
		document.write('</TD>')
		document.write('</TR>')
		
		//premises type combo (mandatory)
		document.write('<TR>')
		document.write('<TD width="30%">&nbsp;Prem Type:</TD>')
		document.write('</TR>')
		document.write('<TR>')
		document.write('<TD width="70%">')
		document.write('<SELECT style="WIDTH: 200" name=selAccomType> ')
		document.write('<OPTION value="1" ' + ((strPremType=="1" || strPremType=="")?"selected":"") + '>All serviced accommodation</OPTION>') 
		document.write('<OPTION value="2" ' + ((strPremType=="2")?"selected":"") + '>All self-catering accommodation</OPTION>') 
		document.write('<OPTION value="3" ' + ((strPremType=="3")?"selected":"") + '>Hotel</OPTION>') 
		document.write('<OPTION value="4" ' + ((strPremType=="4")?"selected":"") + '>Guesthouse</OPTION>') 
		document.write('<OPTION value="5" ' + ((strPremType=="5")?"selected":"") + '>Bed and breakfast</OPTION>') 
		document.write('<OPTION value="6" ' + ((strPremType=="6")?"selected":"") + '>Hostel</OPTION>') 
		document.write('<OPTION value="7" ' + ((strPremType=="7")?"selected":"") + '>University accommodation</OPTION>') 
		document.write('<OPTION value="20" ' + ((strPremType=="20")?"selected":"") + '>Hotel &amp; guesthouse</OPTION>') 
		document.write('<OPTION value="21" ' + ((strPremType=="21")?"selected":"") + '>Townhouse</OPTION>') 
		document.write('<OPTION value="22" ' + ((strPremType=="22")?"selected":"") + '>Country house</OPTION>') 
		document.write('<OPTION value="23" ' + ((strPremType=="23")?"selected":"") + '>Farmhouse</OPTION>') 
		document.write('<OPTION value="24" ' + ((strPremType=="24")?"selected":"") + '>Country house of character</OPTION>') 
		document.write('<OPTION value="25" ' + ((strPremType=="25")?"selected":"") + '>Entertainment</OPTION>') 
		document.write('<OPTION value="26" ' + ((strPremType=="26")?"selected":"") + '>Health farm</OPTION>') 
		document.write('<OPTION value="27" ' + ((strPremType=="27")?"selected":"") + '>Historic house</OPTION>') 
		document.write('<OPTION value="28" ' + ((strPremType=="28")?"selected":"") + '>Pub accommodation</OPTION>') 
		document.write('<OPTION value="29" ' + ((strPremType=="29")?"selected":"") + '>Residential activities</OPTION>') 
		document.write('<OPTION value="30" ' + ((strPremType=="30")?"selected":"") + '>Residential language school</OPTION>') 
		document.write('<OPTION value="31" ' + ((strPremType=="31")?"selected":"") + '>Restaurant with rooms</OPTION>') 
		document.write('<OPTION value="32" ' + ((strPremType=="32")?"selected":"") + '>Specialist accommodation</OPTION>') 
		document.write('</SELECT> ')
		document.write('</TD>')
		document.write('</TR>')
		
		//sharing combo (optional)
		if(strSharing=='yes')
		{
			document.write('<TR>')
			document.write('<TD>Sharing:</TD>')
			document.write('<TD vAlign=top align=left>')
			document.write('<SELECT name=selSharing>')
			document.write('<OPTION value=1 selected>Sharing Bedroom</OPTION>')
			document.write('<OPTION value=2>Own bed</OPTION> ')
			document.write('<OPTION value=3>Own room</OPTION>')
			document.write('</SELECT> ')
			document.write('</TD>')
			document.write('</TR>')
		}

		//party details (mandatory)
		document.write('<TR>')
		document.write('<TD width="30%">&nbsp;Party:</TD>')
		document.write('</TR>')
		document.write('</TABLE>')

		document.write('<TABLE BORDER=0>')
		document.write('<TR>')
		document.write('<TD width="30%"vAlign=top align=left><font size=0> Adults</font></TD>')
		document.write('<TD width="30%"vAlign=top align=left><font size=0> Children</font></TD>')
		document.write('<TD width="30%"vAlign=top align=left><font size=0> Infants</font></TD>')
		document.write('<TD width="10%"vAlign=top align=left><font size=0></font></TD>')
		document.write('</TR>')
		document.write('<TR>')
		document.write('<TD width="30%"vAlign=top align=left>')
		document.write('<SELECT style="MARGIN-TOP: 1px" name=selNumAdults>')
		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="30%"vAlign=top align=left>')
		document.write('<SELECT style="MARGIN-TOP: 1px" name=selNumChildren>')
		document.write('<OPTION value=0></OPTION>')
		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="30%"vAlign=top align=left>')
		document.write('<SELECT style="MARGIN-TOP: 1px" name=selNumInfants>')
		document.write('<OPTION value=0></OPTION>')
		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="10%"vAlign=top align=left></TD>')
		document.write('</TR>')
		document.write('</TABLE>')

		document.write('<TABLE width = "100%" border=0 cellpadding=0 cellspacing=2>')


		//Arrival Date (mandatory)
		document.write('<tr>')
		document.write('<TD valign=bottom align=left>Arrival:</td></tr>')
		document.write('<tr><td align=left><select name="selDays" style="MARGIN-TOP:1px;">')
		var todaysDate = new Date();
		
		for (var counter = 1; counter<=31;counter++)
		{
			document.write('<option ')  
			document.write('value=' + counter)
			if (counter == parseInt(todaysDate.getDate())) 
				{
					document.write(' selected') 
				}
			document.write('>' + counter )
			document.write('</option>')
		}
		document.write('</select> ')

		document.write('<select name="selMonthYear" style="MARGIN-TOP:1px;" ONCLICK="JavaScript:SplitIntoHiddenControls()">')

		var m_names = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");

		for (var yearCounter = todaysDate.getFullYear(); yearCounter<2012; yearCounter++ )
		{
			if(yearCounter == todaysDate.getFullYear())
			{
				for (var monthCounter = todaysDate.getMonth()+1; monthCounter<=12;monthCounter++)
				{
					document.write('<option ')
					document.write('value=' + monthCounter + '-' + yearCounter)

					if ((monthCounter == parseInt(todaysDate.getMonth()+1)) && (yearCounter == parseInt(todaysDate.getFullYear())))
						{
							document.write(' selected')
						}
					document.write('>' + m_names[monthCounter-1] + '-' + yearCounter)
					document.write('</option>')
				}
			}
			else
			{
				for (var monthCounter = 1; monthCounter<=12;monthCounter++)
				{
					document.write('<option ')
					document.write('value=' + monthCounter + '-' + yearCounter)

					if ((monthCounter == parseInt(todaysDate.getMonth()+1)) && (yearCounter == parseInt(todaysDate.getFullYear())))
						{
							document.write(' selected')
						}
					document.write('>' + m_names[monthCounter-1] + '-' + yearCounter)
					document.write('</option>')
				}
			}
		}

		document.write('</select> ')
		
		//split selmonthyear which holds month-year as one value into 2 values
		var str=document.CheckPremfrm.selMonthYear.value;
		var myStr = str.split("-")
		//hidden controls to hold selected year and month from split function
		document.write('<input type= "hidden" name="hdnSelectedMonth" value=' + myStr[0] + '>')
		document.write('<input type= "hidden" name="hdnSelectedYear" value=' + myStr[1] + '>')

		
//		document.write('<img src="http://www.resireland.com/inc/cal.gif" alt="Calendar" style="Cursor:hand;" ONCLICK="JavaScript:createCalendar(document.CheckPremfrm.hdnSelectedMonth.value, document.CheckPremfrm.hdnSelectedYear.value)" >')
		document.write('<img src="images/cal.gif" alt="Calendar" style="Cursor:hand;" ONCLICK="JavaScript:createCalendar(document.CheckPremfrm.hdnSelectedMonth.value, document.CheckPremfrm.hdnSelectedYear.value)" >')
		document.write('</TD>')
		document.write('</TR><!-- Departure Details -->')
		
		//num nights (mandatory)
		document.write('<TR>')
		document.write('<TD vAlign=top width="30%">&nbsp;Night(s):</TD>')
		document.write('</TR>')
		document.write('<TR>')
		document.write('<TD width="70%">')
		document.write('<SELECT style="MARGIN-TOP: 1px" name=selNumNights>')
		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>')

		//property name (optional)
		if(strPremName=='yes')
		{
			document.write('<TR>')
			document.write('<TD>Property Name:</TD>')
			document.write('<TD><INPUT maxLength=30 name=txtPremName></TD>')
			document.write('</TR>')
		}

		//grade (optional)
		if(strGrade=='yes')
		{
			document.write('<TR>')
			document.write('<TD>Grade:</TD>')
			document.write('<TD>')
			document.write('<TABLE border=1>')
			document.write('<TBODY>')
			document.write('<TR>')
			document.write('<TD width="50%">')
			document.write('<INPUT type=checkbox value=Y name=chkGrade5 >5* Five Star')
			document.write('</TD>')
			document.write('<TD width="50%">')
			document.write('<INPUT type=checkbox value=Y name=chkGrade2 >2* Two Star')
			document.write('</TD>')
			document.write('</TR>')
			document.write('<TR>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=chkGrade4 >4* Four Star')
			document.write('</TD>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=chkGrade1 >1* One Star')
			document.write('</TD>')
			document.write('</TR>')
			document.write('<TR>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=chkGrade3 >3* Three Star')
			document.write('</TD>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=chkGradeAll checked>All Grades')
			document.write('</TD>')
			document.write('</TR>')
			document.write('</TBODY>')
			document.write('</TABLE>')
			document.write('</TD>')
			document.write('</TR>')
		}
		//price (optional)
		if(strPrice=='yes')
		{
			document.write('<TR>')
			document.write('<TD>Price:</TD>')
			document.write('<TD>')
			document.write('<TABLE border=0>')
			document.write('<TBODY>')
			document.write('<TR>')
			document.write('<TD>From: <INPUT name=txtPriceFrom></TD>')
			document.write('<TD>To: <INPUT name=txtPriceTo></TD>')
			document.write('</TR></TBODY>')
			document.write('</TABLE>')
			document.write('</TD>')
			document.write('</TR>')
		}

		//facilities (optional)
		if (strFacilities=='yes') 
		{
			document.write('<TR>')
			document.write('<TD>Facilities:</TD>')
			document.write('<TD>')
			document.write('<TABLE border=1>')
			document.write('<TBODY>')
			document.write('<TR>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkAccess>Access for disabled</TD><TD>')
			document.write('<INPUT type=checkbox value=Y name=checkSmoke>No smoking in bedrooms</TD>')
			document.write('</TR>')
			document.write('<TR>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkBaby>Babysitting Facilities</TD>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkCot>Cot Available</TD>')
			document.write('</TR>')
			document.write('<TR>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkBedroom>Ground Floor Bedrooms')
			document.write('</TD>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkTV>Television in bedrooms')
			document.write('</TD>')
			document.write('</TR>')
			document.write('<TR>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkFamily>Family friendly</TD>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkPetsinside>Pets welcome inside</TD></TR>')
			document.write('<TR>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkPetsoutside>Pets welcome outside</TD>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkSwimming>Swimming pool on premises</TD></TR>')
			document.write('<TR>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkLeisure>Leisure complex on premises</TD>')
			document.write('<TD>')
			document.write('<INPUT type=checkbox value=Y name=checkPrivate>Private car parking</TD>')
			document.write('<TD>')
			document.write('<INPUT type=hidden name=strfacilities></TD></TR></TBODY>')
			document.write('</TABLE>')
			document.write('</TD>')
			document.write('</TR>')
		}
		document.write('<TR>')
		document.write('<TD align=center colspan=2>')
		document.write('</TD>')
		document.write('</TR>')
		document.write('<TR>')
		document.write('<TD align=center colspan=2>')
		document.write('</TD>')
		document.write('</TR>')
		document.write('<TR>')
		document.write('<TD align=center colspan=2>')
		document.write('</TD>')
		document.write('</TR>')
		document.write('<TR>')
		document.write('<TD align=center colspan=2>')
		document.write('</TD>')
		document.write('</TR>')

		document.write('<TR>')
		document.write('<TD align=center colspan=2>')
		
		document.write('<INPUT type=button id=Search_Button value = "Check Availability" alt="Check Availability" onclick="subx(document.CheckPremfrm.hdnLocation.value,document.CheckPremfrm.hdnTownLevel.value,document.CheckPremfrm.hdnPremType.value,document.CheckPremfrm.hdnSharing.value,document.CheckPremfrm.hdnPremName.value,document.CheckPremfrm.hdnGrade.value,document.CheckPremfrm.hdnPrice.value,document.CheckPremfrm.hdnFacilities.value)">')
		
		document.write('</TD>')
		document.write('</TR>')
	
		document.write('</TD>')
		document.write('</TR>')
		document.write('</table>')
		document.write('</TD>')
		document.write('</TR>')
		document.write('</table>')
		document.write('</form>')
	}


	function subx(strLocation,strTownLevel,strPremType,strSharing,strPremName,strGrade,strPrice,strFacilities)
	{
		
		//variable to hold our deepLink
		var deepLink

		if (( document.forms['CheckPremfrm'].hdnLocation.value == '' ))
			{
				alert('Please select a location.')
				document.forms['CheckPremfrm'].hdnLocation.focus();
				return;
			}
		

		//build the URL for deepLinking
		deepLink = document.forms['CheckPremfrm'].hdnBookingURL.value
		deepLink = deepLink + "?affiliatevisitid=1"
		deepLink = deepLink + "&affiliateid=" + document.forms['CheckPremfrm'].hdnAffiliateID.value
		deepLink = deepLink + "&ProvID=" + document.forms['CheckPremfrm'].hdnProviderID.value
		deepLink = deepLink + "&IsAdvanced=1" 
		deepLink = deepLink + "&selAccomType=" + document.forms['CheckPremfrm'].selAccomType.value
		deepLink = deepLink + "&selArriveDay=" + document.forms['CheckPremfrm'].selDays.value 
		deepLink = deepLink + "&selArriveMonth=" + document.forms['CheckPremfrm'].hdnSelectedMonth.value 
		deepLink = deepLink + "&selArriveYear=" + document.forms['CheckPremfrm'].hdnSelectedYear.value 
		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 + "&selNumNights=" + document.forms['CheckPremfrm'].selNumNights.value 
		
		if(strFacilities=='yes')
		{
			var s  = new String('');
			if ((document.forms['CheckPremfrm'].checkPrivate) && (document.forms['CheckPremfrm'].checkPrivate.checked))
				s += "PC,";
			if ((document.forms['CheckPremfrm'].checkLeisure) && (document.forms['CheckPremfrm'].checkLeisure.checked))
				s += "XO,";
			if ((document.forms['CheckPremfrm'].checkAccess) && (document.forms['CheckPremfrm'].checkAccess.checked))
				s += "AD,";
			if ((document.forms['CheckPremfrm'].checkSmoke) && (document.forms['CheckPremfrm'].checkSmoke.checked))
				s += "NS,";
			if ((document.forms['CheckPremfrm'].checkBaby) && (document.forms['CheckPremfrm'].checkBaby.checked))
				s += "BS,";
			if ((document.forms['CheckPremfrm'].checkCot) && (document.forms['CheckPremfrm'].checkCot.checked))
				s += "CA,";
			if ((document.forms['CheckPremfrm'].checkBedroom) && (document.forms['CheckPremfrm'].checkBedroom.checked))
				s += "GB,";
			if ((document.forms['CheckPremfrm'].checkTV) && (document.forms['CheckPremfrm'].checkTV.checked))
				s += "TV,";
			if ((document.forms['CheckPremfrm'].checkFamily) && (document.forms['CheckPremfrm'].checkFamily.checked))
				s += "FF,";
			if ((document.forms['CheckPremfrm'].checkPetsoutside) && (document.forms['CheckPremfrm'].checkPetsoutside.checked))
				s += "PW,";
			if ((document.forms['CheckPremfrm'].checkSwimming) && (document.forms['CheckPremfrm'].checkSwimming.checked))
				s += "SO,";
			if ((document.forms['CheckPremfrm'].checkVisa) && (document.forms['CheckPremfrm'].checkVisa.checked))
				s += "VB,";
			if ((document.forms['CheckPremfrm'].checkMaster) && (document.forms['CheckPremfrm'].checkMaster.checked))
				s += "AM,";
			if ((document.forms['CheckPremfrm'].checkAmex) && (document.forms['CheckPremfrm'].checkAmex.checked))
				s += "AE,";
			if ((document.forms['CheckPremfrm'].checkDiners) && (document.forms['CheckPremfrm'].checkDiners.checked))
				s += "DE,";

			if (s!='')
			{
				document.forms['CheckPremfrm'].strfacilities.value=s;
				deepLink = deepLink + "&strfacilities=" + document.forms['CheckPremfrm'].strfacilities.value
			}
		}
		
		if(strSharing=='yes')
		{	
			deepLink = deepLink + "&selSharing=" + document.forms['CheckPremfrm'].selSharing.value
		}
		
		if (window.ActiveXObject)
		{		
			if(strTownLevel=='yes' && document.forms['CheckPremfrm'].selTowns.value != '')
			{
				deepLink = deepLink + "&hdnLocation=" + document.forms['CheckPremfrm'].selTowns.value
			}
			else
			{
				deepLink = deepLink + "&hdnLocation=" + document.forms['CheckPremfrm'].hdnLocation.value
			}
		}

		else if (document.implementation &&
			document.implementation.createDocument)
		{
			if(strTownLevel=='yes' && document.forms['CheckPremfrm'].selTowns.value != 'please select')
			{
				deepLink = deepLink + "&hdnLocation=" + document.forms['CheckPremfrm'].selTowns.value
			}
			else
			{
				deepLink = deepLink + "&hdnLocation=" + document.forms['CheckPremfrm'].hdnLocation.value
			}
		}
		
		if(strPrice=='yes')
		{

			if(document.forms['CheckPremfrm'].txtPriceTo.value == '')
				{
					deepLink = deepLink + "&selPriceUpper=5000"
				}
			else
				{
					deepLink = deepLink + "&selPriceUpper=" + document.forms['CheckPremfrm'].txtPriceTo.value
				}

			if(document.forms['CheckPremfrm'].txtPriceFrom.value == '')
				{
					deepLink = deepLink + "&selPriceLower=0" 
				}
			else
				{
					deepLink = deepLink + "&selPriceLower=" + document.forms['CheckPremfrm'].txtPriceFrom.value
				}

		}

		if(strPremName=='yes' && document.forms['CheckPremfrm'].txtPremName.value!='')
		{
			deepLink = deepLink + "&txtPremName=" + document.forms['CheckPremfrm'].txtPremName.value
		}

		if(strGrade=='yes')
		{
			if (document.forms['CheckPremfrm'].chkGradeAll.checked){
				deepLink = deepLink + "&chkGradeAll=" + document.forms['CheckPremfrm'].chkGradeAll.value}
			else{deepLink = deepLink + "&chkGradeAll=N"}
			if (document.forms['CheckPremfrm'].chkGrade1.checked){
				deepLink = deepLink + "&chkGrade1=" + document.forms['CheckPremfrm'].chkGrade1.value}
			else{deepLink = deepLink + "&chkGrade1=N"}
			if (document.forms['CheckPremfrm'].chkGrade2.checked){
				deepLink = deepLink + "&chkGrade2=" + document.forms['CheckPremfrm'].chkGrade2.value}
			else{deepLink = deepLink + "&chkGrade2=N"}
			if (document.forms['CheckPremfrm'].chkGrade3.checked){
				deepLink = deepLink + "&chkGrade3=" + document.forms['CheckPremfrm'].chkGrade3.value}
			else{deepLink = deepLink + "&chkGrade3=N"}
			if (document.forms['CheckPremfrm'].chkGrade4.checked){
				deepLink = deepLink + "&chkGrade4=" + document.forms['CheckPremfrm'].chkGrade4.value}
			else{deepLink = deepLink + "&chkGrade4=N"}
			if (document.forms['CheckPremfrm'].chkGrade5.checked){
				deepLink = deepLink + "&chkGrade5=" + document.forms['CheckPremfrm'].chkGrade5.value}
			else{deepLink = deepLink + "&chkGrade5=N"}
		}
		
		deepLink = deepLink + "&strAction=" + "search"
		
		//redirect page to our deepLink URL
//		document.write(deepLink);
		window.location.href = deepLink;

	}



