<!-- Hide code from older browsers

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN)
	}
	
	document.onmousedown=CaptureMouseDown

// Function to display the date
 
 	d = new Array(
	"Sunday",
	"Monday",
	"Tuesday",
	"Wednesday",
	"Thursday",
	"Friday",
	"Saturday"
	);
	m = new Array(
	"January",
	"February",
	"March",
	"April",
	"May",
	"June",
	"July",
	"August",
	"September",
	"October",
	"November",
	"December"
	);
 
 
function DisplaytheDate() {
	
	today = new Date();
	day = today.getDate();
	year = today.getYear();
	
	if (year < 2000)    // Y2K Fix, Isaac Powell
	year = year + 1900; // http://onyx.idbsu.edu/~ipowell
	
	end = "th";
	if (day==1 || day==21 || day==31) end="st";
	if (day==2 || day==22) end="nd";
	if (day==3 || day==23) end="rd";
	day+=end;
		document.write(day+" "); document.write(m[today.getMonth()]+" " + year)+"&nbsp;&nbsp;";
	
} 

// Function to move to a new page from a combo box
function jump_page(newLoc) {

	newPage = newLoc.options[newLoc.selectedIndex].value;

	if (newPage != "") {
		document.location.href = newPage;
	}
}

//
// send email avoiding loads of spam
//
function event_mailme() {
var name = "contact";
var domain = "tavistockonline.co.uk";
var fulldomain = "tavistockonline.co.uk?subject=Suggest an Event - I am authorised to provide details of this event";
document.write('<a href=\"mailto:' + name + '@' + fulldomain + '\">Send details of the event by email');
document.write('</a>');
}

//
// send email avoiding loads of spam
//
function attraction_mailme() {
var name = "contact";
var domain = "tavistockonline.co.uk";
var fulldomain = "tavistockonline.co.uk?subject=Suggest an Attraction";
document.write('<a href=\"mailto:' + name + '@' + fulldomain + '\">Send details of the attraction by email');
document.write('</a>');
}

//
// send email avoiding loads of spam
//
function mailme() {
var name = "contact";
var domain = "tavistockonline.co.uk";
var fulldomain = "tavistockonline.co.uk?subject=Online Enquiry";
document.write('<a href=\"mailto:' + name + '@' + fulldomain + '\">Contact us by email');
document.write('</a>');
}


// Function to process the capturing of mouse events and reduce copying of images

function CaptureMouseDown(evt) {
	if (evt)  {
		mouseClick = evt.which
	}
	else {
		mouseClick = window.event.button
	}

	if (mouseClick==2 || mouseClick==3) {
		alert("Sorry, the menu is currently unavailable")
		return false;
	}
}

// Function to add a URL to the Favourites

function add_favourites() {

	mURL="http://www.tavistockonline.co.uk";
	mDesc="Tavistockonline - For information about Tavistock, Devon";
	if (mURL !== "location.href") {
		mURL = "'"+mURL+"'";
	}
	mystr = "window.external.AddFavorite("+mURL+",'"+mDesc+"')";
	eval(mystr);
} 

function blank_it(){
if (document.frm.srchval.value == "Enter a Keyword")
	document.frm.srchval.value = "";
}


// Function to search keywords and identify selected pages to display

var item = new Array();

// "Many,Key,Words","Page Name"

c=0; item[c]=new Array("Mansbridge,Balment","mansbridge_balment.htm");
c++; item[c]=new Array("Ward,Chowen,livestock,auction","ward_chowen.htm");
c++; item[c]=new Array("maintenance","rm_propertyhealthcheck.htm");
c++; item[c]=new Array("estate,agent,agents,chartered,surveyor,surveyors,auctioneer,auctioneers","estate_agents.htm");
c++; item[c]=new Array("folletts,follett,cane,mahogany,yew,pouffes,seating,chairs,chair","folletts.htm");
c++; item[c]=new Array("bounce2hire,bounce,bouncy,Inflatable,Inflatables,Helium,Assault,slide,slides,castles,castle","bounce2hire.htm");
c++; item[c]=new Array("fireplace,stove,fires,fire,woodburner,woodburners,burner","fireplace_stovecentre.htm");
c++; item[c]=new Array("kendlebell,telephone,phone,messaging,messages,answering,answer","kendlebell.htm");
c++; item[c]=new Array("kaleidoscope,Games,Outdoor,Fancy","kaleidoscope_toys.htm");
c++; item[c]=new Array("gifts,gift,toys,toy","gifts_toys.htm");
c++; item[c]=new Array("child,children,childrens,baby,startrite,start-rite,ben,sherman,bench,mayoral,gro-bags,grobags,berlingot,lilly,kelly","mini_me.htm");
c++; item[c]=new Array("vaughans,vaughan,hair,stylist,stylists","vaughans.htm");
c++; item[c]=new Array("mvb,barnes,engineer,boiler,boilers,repair,repairs,painter,paint,decorator,build,builder,building,buildings,builders,conversion,driveways,patios","property_services.htm");
c++; item[c]=new Array("art,antique,antiques","art_antiques.htm");
c++; item[c]=new Array("gas","gas_search_results.htm");
c++; item[c]=new Array("wedding,weddings","wedding_planning.htm");
c++; item[c]=new Array("church,churches,pray,worship,prayer,jesus,god","community/worship.htm");

c++; item[c]=new Array("doctor,doctors,surgery,surgeries,ill,sick,sickness,wharfside,abbey,stannary","community/health.htm");
c++; item[c]=new Array("youth,luke,lukes,care,oxfam,charity,charities,giving,woodside,animal,ymca,volunteer,cvs,inner,city,lupus,blind,volunteer,volunteers","community/charities.htm");
c++; item[c]=new Array("cricket,football,soccer,ball,golf,rugby,crowndale,sports,sport,club,clubs","community/sport.htm");
c++; item[c]=new Array("school,schools,primary,secondary,college,infant,infants,Rumon,rumons,junior,juniors","community/education.htm");
c++; item[c]=new Array("council,councils,births,deaths,marriages,registration,government","community/government.htm");
c++; item[c]=new Array("holiday,france,hols,away,weekend","days_away.htm");
c++; item[c]=new Array("furniture","furniture_search_results.htm");
c++; item[c]=new Array("shop,shops,retail","retail_park.htm");
c++; item[c]=new Array("marketing,web","marketing_search_results.htm");
c++; item[c]=new Array("business,ecommerce,planning,financial,accountant,accountants,accounting,internet,net,google,yahoo","business_services.htm");

c++; item[c]=new Array("parking","parking.htm");
c++; item[c]=new Array("taxi,taxis","taxi.htm");
c++; item[c]=new Array("night,out","night_out.htm");
c++; item[c]=new Array("food,restaurants,restaurant,eating,meals,meal","restaurants.htm");
c++; item[c]=new Array("pub,pubs,bar,bars,beer,drink,drinks,inn","pubs.htm");
c++; item[c]=new Array("license,off,hamper,hampers,wine,wines,cheese,meat,meats,whiskey,whisky,delicatessen,creber,crebers","creber.htm");
c++; item[c]=new Array("designer,evening,wear,clothes,fashion,clothing,dresses,dress,ladies,outerwear,gents,men,mens,gent,lady,top,tops,skirt,skirts,trousers,trouser,tshirts,tshirt,sock,socks","fashion.htm");
c++; item[c]=new Array("morris,burial,burials,funeral,cremation,cremations,Limousine,Limousines,flowers,flower,funerals","morris_bros.htm");
c++; item[c]=new Array("georgina,georginas,pet,pets,feed,cats,cat,dog,dogs,rabbit,rabbits,reptiles,fish,hamster,hamsters,tropical,animal,supplies","pet_supplies.htm");

c++; item[c]=new Array("orchard,plastic,fascias,fascia,guttering","orchard_conservatories.htm");
c++; item[c]=new Array("english,heritage,national,trust","days_out.htm");
c++; item[c]=new Array("conservatories,conservatory,window,windows,upvc,pvcu,glazing","orchard_conservatories.htm");
c++; item[c]=new Array("motor,motors,car,van,vehicle,vehicles,cars,vans","motor_services.htm");
c++; item[c]=new Array("viking,prestivo,toyo,tyre,tyres,pirelli,tsw,michelin,bridgestone,exhaust,exhausts","tyremarksoftavistock.htm");
c++; item[c]=new Array("venue,hall,Receptions,Seminars,Luncheons,Conferences,Reception,Seminar,Luncheon,Conference","town_hall.htm");
c++; item[c]=new Array("pannier,market","pannier_market.htm");
c++; item[c]=new Array("lions,lion","community/lions.htm");
c++; item[c]=new Array("Carpentry,Plastering,Extensions,Alterations,construction,,houses,house,contractors,loft,renovations,renovation","construction.htm");

c++; item[c]=new Array("walke,citreon,citroen,peugeot","richard_walke.htm");
c++; item[c]=new Array("greening,greenings,master,federation,refurbishment","e_l_greening.htm");
c++; item[c]=new Array("letting,lets,rent,rental","property_letting.htm");
c++; item[c]=new Array("gb,management,flat,bungalow","gb_property_management.htm");
c++; item[c]=new Array("event,events","events.htm");
c++; item[c]=new Array("christmas,cafe,playbox,salvation,army","events_supplementary.htm");
c++; item[c]=new Array("basler,marcona,fisser,michele,gardeur","la_cache.htm");

c++; item[c]=new Array("Party,parties","event_planning.htm");
c++; item[c]=new Array("wharf,coffee,film,cinema,fotw","the_wharf.htm");
c++; item[c]=new Array("chamber,commerce","tavistock_chamber.htm");
c++; item[c]=new Array("tourist,information","tourist_info.htm");
c++; item[c]=new Array("delivery","pet_supplies.htm");
c++; item[c]=new Array("property,home,second,holiday","property_search_results.htm");
c++; item[c]=new Array("travel,cruise,airport,cruises,flight,flights,tour,tours,package,australia,canada,independent","travel_search_results.htm");
c++; item[c]=new Array("colin,smith,insurance,mortgage,mortgages,loan,loans","colin_smith.htm");
c++; item[c]=new Array("rdl,automotive,auto,mirrors,paint","rdlautosupplies.htm");

c++; item[c]=new Array("remote,electronic,shutters,shutter,roller,automation,gate,gates","tavistock_garage_doors.htm");
c++; item[c]=new Array("mot","mot_search_results.htm");
c++; item[c]=new Array("garage,service","garage_search_results.htm");
c++; item[c]=new Array("door,doors","door_search_results.htm");
c++; item[c]=new Array("book,keeping,taxation,tax,self-assessment,vat","professional_services.htm");
c++; item[c]=new Array("health","local_health.htm");
c++; item[c]=new Array("hearing,aid,audiology,physiotherapy,clinic,reflexology,aromatherapy,massage,therapy,shiatsu,therapeutic,clinical,hypnotherapist,personal,relationship","local_health.htm");

// more community section keywords
c++; item[c]=new Array("camera,pigeon,clay,gliding,robey","community/sigs.htm");
c++; item[c]=new Array("athletics,tennis,squash,hockey,hash,harriers,archers,archery,bowls","community/sport.htm");
c++; item[c]=new Array("band,blow,zone,flute","community/music.htm");
c++; item[c]=new Array("history","community/history.htm");
c++; item[c]=new Array("aspiring,writers,poetry,poem,writer,write","community/literature.htm");
c++; item[c]=new Array("rotary,lions","community/organisations.htm");
c++; item[c]=new Array("tavonians,musical,theatre","community/theatre.htm");
c++; item[c]=new Array("abbey,safety","abbeygarden.htm");
c++; item[c]=new Array("hire","hire_search_results.htm");
c++; item[c]=new Array("restoration,restore","restore_search_results.htm");
//
c++; item[c]=new Array("williams","bs_js_williams.htm");
c++; item[c]=new Array("police,Alcoholics,Anonymous,Childline,NHS,NSPCC,RSPCA,Samaritans,Aid,Rail,bus,buses,brittany,ferries,library","useful_contacts.htm");
c++; item[c]=new Array("shoe,shoes","mini_me.htm");
c++; item[c]=new Array("kung,fu,japanese,exercise","community/kung-fu-tavistock.htm");
c++; item[c]=new Array("tai,chi,japanese,exercise","community/tai-chi-tavistock.htm");

c++; item[c]=new Array("moorland,french,polish,polishing,re-upholstery,reupholstery","moorland_furniture.htm");
c++; item[c]=new Array("ganges","ganges.htm");
c++; item[c]=new Array("tandoori,indian,takeaway,cuisine,banquet,spice,spicey","ganges.htm");
c++; item[c]=new Array("diggers,digger,scaffold,scaffolding,towers,tower,power,toilet","tavistockhirecentre.htm");
c++; item[c]=new Array("tool,tools","tools_search_results.htm");
c++; item[c]=new Array("lawn,lawnmower,mower,garden,gardens,gardening","garden_search_results.htm");
c++; item[c]=new Array("rob,moule","rm_builders.htm");
c++; item[c]=new Array("greener,way","greener_way_construction.htm");
c++; item[c]=new Array("rose,optician,opticians,glasses,sunglasses,optometrist,eye,test,spectacles,contact,len,lens,spectacle","rose_opticians.htm");
c++; item[c]=new Array("active,Cross,Spikes,Country,Trail,Cross,Beach,Footwear,Training,Road,Running,sports,wear,adidas,puma,mitre,nike,reebok,umbro","active_co.htm");
c++; item[c]=new Array("prim,homespun,fabric,fabrics,tinware,mats,mat,candle,candles","thehomespunloft.htm");
c++; item[c]=new Array("men,seasons,fencing,tree,felling,hedge,trimming,clearance","menforallseasons.htm");
// c++; item[c]=new Array("quinn,quinns,joules","quinns_menswear.htm");
c++; item[c]=new Array("Design,Logo,advertising,Literature,Printing,Branding,Graphic","w2jconsulting.htm");

var lower=0;
var upper=item.length; // number of items in total 100


function  prod_search(sval) {

	txt = sval.split(" ");
	// review each entry typed in the search box
	for (k = 0; k < txt.length; k++) {

		// check every keyword for each entry in the table
		 for (i = lower; i < upper; i++) {
		
			// split the keywords and search for the first chrs being the same
			keytxt = item[i][0].split(",");		
		
			// check each keyword for being the same as the entered strings
			for (m=0; m < keytxt.length; m++) {
				if (txt[k] != "") {
					if (keytxt[m].toLowerCase() == txt[k].toLowerCase()) {
						// display the page for the keyword identified, if any
						window.location=item[i][1];
						return false;
					}
				}
			}
		}
	}
	// display the null page
	window.location="no_search_results.htm";
	return false;
}


// Stop hiding code -->



