function check() {
	if (document.sca.area.selectedIndex == 0 && document.sca.town.value == "")
		{alert('Please select an area  or town');
		return}
	var dnow = new Date()
	var bday = document.sca.day.selectedIndex + 1;
	var bmonth = document.sca.month.selectedIndex + 1;
	var byearind = document.sca.year.selectedIndex;
	var byear = document.sca.year.options[byearind].value;
	var bdate = new Date(byear,bmonth,bday);
	if (dnow.getTime() > bdate.getTime())
		{alert('Please select a date in the future');
		return}
	document.sca.submit();
}
function stats(stime) {
if (document.all) {
 if (statistics.innerHTML != "")  return; }
else
 if (document.getElementById("statistics").innerHTML != "")  return; 

var fsize = 10000;
stats += "&size=" + fsize;
var stats = "referrer=" + escape(window.document.referrer);
stats += "&agent=" + escape(navigator.userAgent);
stats += "&time=" + stime;
stats += "&size=" + fsize;
stats += "&url=" + location.href;
if (document.all) 
 statistics.innerHTML = '<img border=0 height=1 width=1 src="http://www.cornwall-cottages-hc.co.uk/awstats/cottagelog.asp?' + stats +'">';
else
 document.getElementById("statistics").innerHTML = '<img border=0 height=1 width=1 src="http://www.cornwall-cottages-hc.co.uk/awstats/cottagelog.asp?' + stats +'">';
}

function searchtext() {

document.write('<tr><td valign=top>');
document.write('<FORM action="http://affiliate.stilwell.co.uk/asp/results.asp" method=post name=sca>');
document.write('<INPUT type=hidden name=ac value=84>');
document.write('<INPUT type=hidden name=ad value="">');
document.write('<table border=0 cellpadding=1 cellspacing=0>');
document.write('<tr>');
document.write('<td align=center colspan=2><br>');
document.write('<h1>Self Catering in the UK</h1><B>1813 holiday cottages and counting..</b><br><br></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<Td align=right>Location&nbsp;</td><td><select name=area>');
document.write('<option value="">Select an area</option>');
document.write('<option value="coa">England - Cornwall</option>');
document.write('<option value="dea">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Devon</option>');
document.write('<option value="doa">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dorset</option>');
document.write('<option value="lda">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Lake District</option>');
document.write('<option value="nfa">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Norfolk</option>');
document.write('<option value="noa">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Northumbria</option>');
document.write('<option value="cha">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Peak District &amp; Central</option>');
document.write('<option value="sea">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;South East England</option>');
document.write('<option value="soa">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Somerset</option>');
document.write('<option value="yoa">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Yorkshire</option>');
document.write('<option value="sca">Scotland</option>');
document.write('<option value="sia">Ireland</option>');
document.write('<option value="waa">Wales</option>');
document.write('</select></td>');
document.write('</tr>');
document.write('<tr><Td align=right>Town&nbsp;</td><td><input type=text size=20 name=town value=""></td></tr>');
document.write('<Tr>');
document.write('<Td align=right>Start Date&nbsp;</td><td><SELECT name="day">');
document.write('<OPTION value=1 selected>1</OPTION>');
for (var i=1; i<32; i++) {
	document.write('<OPTION value=' + i + '>' + i + '</OPTION>');
}
document.write('</SELECT>&nbsp;<select name="month">');
var mydate=new Date()
var dVal=mydate.valueOf();
newDate=new Date(dVal+7776000000);
var thatmonth = newDate.getMonth();
var thisyear = mydate.getFullYear();
var thatyear = newDate.getFullYear();
var tmonths="January,February,March,April,May,June,July,August,September,October,November,December";
var amonth=tmonths.split(",");
for (i=0; i<12; i++) {
	document.write('<option value=' + amonth[i]);
	if (i == thatmonth)
		document.write (' selected');
	document.write('>' + amonth[i] + '</option>');
}
document.write('</select>&nbsp;<select name="year">');
for (i=thisyear; i<thisyear+2; i++) {
	document.write('<option value=' + i);
	if (i == thatyear)
		document.write (' selected');
	document.write('>' + i + '</option>');
}
document.write('</select>');
document.write('</td></tr>');
document.write('<tr>');
document.write('<Td align=right>How many beds?&nbsp;');
document.write('</td><Td colspan=2><select name=beds >');
document.write('<option value=0>Any</option>');
document.write('<option value=2>2 or more</option>');
document.write('<option value=3>3 or more</option>');
document.write('<option value=4 selected>4 or more</option>');
document.write('<option value=5>5 or more</option>');
document.write('<option value=6>6 or more</option>');
document.write('<option value=7>7 or more</option>');
document.write('<option value=8>8 or more</option>');
document.write('<option value=10>10 or more</option>');
document.write('<option value=12>12 or more</option>');
document.write('</select></td>');

document.write('</tr><tr>');
document.write('<Td align=right>How long?&nbsp;</td><Td colspan=2><select name=bend>');
document.write('<option value="">Not decided</option>');
document.write('<option value=2>2 days</option>');
document.write('<option value=3>3 days</option>');
document.write('<option value=4>4 days</option>');
document.write('<option value=5>5 days</option>');
document.write('<option value=6>6 days</option>');
document.write('<option value=7 selected>1 week</option>');
document.write('<option value=14>2 weeks</option>');
document.write('<option value=21>3 weeks</option>');
document.write('</select></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<Td align=right>Swimming Pool&nbsp;</td>');
document.write('<Td width=60%><input type=checkbox name=pool value="Y">&nbsp;<input type=checkbox name=fire value="Y">&nbsp;Open fire</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<Td align=right>Children&nbsp;friendly&nbsp;</td>');
document.write('<Td><input type=checkbox name=children value="Y">&nbsp;<input type=checkbox name=Smoking value="Y">&nbsp;Smoking&nbsp;permitted</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<Td align=right>Pets allowed&nbsp;</td>');
document.write('<Td><input type=checkbox name=pets value="Y">&nbsp;<input type=checkbox name=Disabled value="Y">&nbsp;Access&nbsp;for&nbsp;disabled</td>');
document.write('</tr><tr>');
document.write('<td colspan=2 align=center height=50 valign=middle>');
document.write('<a href="javascript:check()" class=avail>');
document.write('<font size=4>&nbsp;click here to search&nbsp;</font></a>');
document.write('</td>');
document.write('</tr>');

}

function sa(id) {
	window.open("http://www.ktleisure.com/BookingJourney1Calendar.aspx?source=anik&key=" + id + "&availability=Y&picture=" + id.substr(0,6) + "_main.jpg",'booking','top=50,left=50,scrollbars,resizable,width=600,height=630');
}
function pcmap(pc) {
	window.open("http://uk.multimap.com/p/browse.cgi?pc=" + pc + "&title=Cottage+Map&scale=500000",'images','top=50,left=50,scrollbars,resizable,width=800,height=600'); 
	void('');
}

var aff_Bargains = 'Yes';
var aff_Region;
var aff_Rows = 1;
var aff_Cols = 7;
var aff_ID = '84';
function GetAdvert()
{
document.write('<iframe SRC="http://www.stilwell.co.uk/affiliates/asp/advert.asp?LateBargains=' + aff_Bargains + '&Area=' + aff_Region + '&rows=' + aff_Rows + '&cols=' + aff_Cols + '&ID=' + aff_ID + '" width=' + aff_Cols * 110 + ' height=' + (aff_Rows * 115 + 20) + ' frameborder=0 border=0 ALIGN=CENTER SCROLLING="no"></iframe>'); 
}


