	function displaySearch(strBookingURL, strAffiliateID, strProviderID, strLocation, strLocationShowHide, strTownLevel,strPremType, strPremTypeShowHide, strSharing,strPremName,strGrade,strPrice,strFacilities,strOptional)
	{	
		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="hdnLocation2" value=' + strLocation + '>')
		document.write('<input type= "hidden" name="hdnLocation2" value=' + strLocation + '>')
		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('<input type= "hidden" name="hdnOptional" value=' + strOptional + '>')
		document.write('<input type= "hidden" name="hdnPremTypeShowHide" value=' + strPremTypeShowHide + '>')


		document.write('<TABLE width = 490 border = 1 cellpadding=0 cellspacing=0 class="searchStyle"><!--outer table for border-->')
		document.write('<TR>')
		document.write('<TD>')
		document.write('<TABLE width = "100%" border=0 cellpadding=0 cellspacing=0><!-- Location -->')
		document.write('<TBODY>')
		document.write('<TR>')
		document.write('<TD colspan=2>')
		document.write('</TD>')
		document.write('</TR>')

		if(strLocationShowHide=="show"){
		document.write('<TR>')
		document.write('<TD width="20%">Location:</TD>')
		document.write('<TD width="80%">')

		//location combo (mandatory)
		if(strTownLevel=="yes")
			{document.write('<SELECT style=WIDTH: 200px name=hdnLocation onchange=showTowns(this.value)>')}
		else
			{document.write('<SELECT style=WIDTH: 200px 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>')}
		else
		{
			document.write('<input type= "hidden" name="hdnLocation"  value=' + strLocation + '>')
		}
		if(strTownLevel=="yes"){
		//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 colspan=2>')
		document.write('<DIV id="txtTowns"></div>')
		document.write('</TD>')
		document.write('</TR>')}
		
		if(strPremTypeShowHide=="show"){
		//premises type combo (mandatory)
		document.write('<TR>')
		document.write('<TD width="20%">Property Type:</TD>')
		document.write('<TD width="80%">')
		document.write('<SELECT WIDTH=200px 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>')}
		else
		{
			document.write('<input type= "hidden" name="hdnPremType2"  value=' + strPremType + '>')
		}
		
		//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="20%">Party:</TD>')
		document.write('<TD width="80%"vAlign=top align=left>Adults')
		document.write('<SELECT 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('Children')
		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('Infants')
		//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('</TR><!-- Arrival Details -->')

		//Arrival Date (mandatory)
		document.write('<TR>')
		document.write('<TD vAlign=top width="20%">Arrival date:</TD>')
		document.write('<TD width="80%">')
		document.write('<INPUT style="WIDTH: 150px; CURSOR: hand" onclick="JavaScript:createCalendar(document.CheckPremfrm.selArriveMonth.value, 							document.CheckPremfrm.selArriveYear.value)" value="Click Here for Calendar" name=selCalendar>') 
		document.write('<input type="hidden" value="1" name="selArriveDay">')
		document.write('<input type="hidden" value="2" name="selArriveMonth">')
		document.write('<input type="hidden" value="2005" name="selArriveYear">')


		var today = new Date();
		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());
		if(strTownLevel=="yes"){
		showTowns(document.forms['CheckPremfrm'].hdnLocation.value);}
		document.write('</TD>')
		document.write('</TR><!-- Departure Details -->')
		
		//num nights (mandatory)
		document.write('<TR>')
		document.write('<TD vAlign=top width="20%">	Night(s):</TD>')
		document.write('<TD width="80%">')
		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=checkSpa>Spa</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=checkHenStag>Hen/Stag Welcome</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=checkConference>Conference Facilities')
			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=checkWIFI>WIFI Internet Access</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 Property</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=left colspan=2>')
		
		document.write('<INPUT type=button id=Search_Button value = "Search" alt="Check Availability" onclick="subx(document.CheckPremfrm.hdnLocation2.value,document.CheckPremfrm.hdnTownLevel.value,document.CheckPremfrm.hdnPremType.value,document.CheckPremfrm.hdnPremTypeShowHide.value,document.CheckPremfrm.hdnSharing.value,document.CheckPremfrm.hdnPremName.value,document.CheckPremfrm.hdnGrade.value,document.CheckPremfrm.hdnPrice.value,document.CheckPremfrm.hdnFacilities.value,document.CheckPremfrm.hdnOptional.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>')
	}


	function subx(strLocation,strTownLevel,strPremType,strPremTypeShowHide,strSharing,strPremName,strGrade,strPrice,strFacilities,strOptional) 
	{

		//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" 

		if(strPremTypeShowHide=="show"){
			deepLink = deepLink + "&selAccomType=" + document.forms['CheckPremfrm'].hdnPremType.value}
		else
		{			
			deepLink = deepLink + "&selAccomType=" + document.forms['CheckPremfrm'].hdnPremType2.value}
		deepLink = deepLink + "&selArriveDay=" + document.forms['CheckPremfrm'].selArriveDay.value 
		deepLink = deepLink + "&selArriveMonth=" + document.forms['CheckPremfrm'].selArriveMonth.value 
		deepLink = deepLink + "&selArriveYear=" + document.forms['CheckPremfrm'].selArriveYear.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 + "&selNumInfants=0"
		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'].checkSpa) && (document.forms['CheckPremfrm'].checkSpa.checked))
				s += "S2,";
			if ((document.forms['CheckPremfrm'].checkBaby) && (document.forms['CheckPremfrm'].checkBaby.checked))
				s += "BS,";
			if ((document.forms['CheckPremfrm'].checkHenStag) && (document.forms['CheckPremfrm'].checkHenStag.checked))
				s += "HW,";
			if ((document.forms['CheckPremfrm'].checkBedroom) && (document.forms['CheckPremfrm'].checkBedroom.checked))
				s += "GB,";
			if ((document.forms['CheckPremfrm'].checkConference) && (document.forms['CheckPremfrm'].checkConference.checked))
				s += "CF,";
			if ((document.forms['CheckPremfrm'].checkFamily) && (document.forms['CheckPremfrm'].checkFamily.checked))
				s += "FF,";
			if ((document.forms['CheckPremfrm'].checkWIFI) && (document.forms['CheckPremfrm'].checkWIFI.checked))
				s += "WI,";
			if ((document.forms['CheckPremfrm'].checkSwimming) && (document.forms['CheckPremfrm'].checkSwimming.checked))
				s += "SO,";
			if ((document.forms['CheckPremfrm'].checkPetsinside) && (document.forms['CheckPremfrm'].checkPetsinside.checked))
				s += "PW,";

			//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"}
		}
		if (strOptional!='')
		{
			deepLink = deepLink + "&" + strOptional
		}
		deepLink = deepLink + "&strAction=" + "search"
		
		//redirect page to our deepLink URL
		//document.write(deepLink);
		window.location.href = deepLink;

	}




