
function formHandler() {

if (document.myform.town.value != "")
{

var town = document.myform.town.value;
    
var fld = town;
var res = "";
var c = 0;
for (i=0; i<fld.length; i++) {
  if (fld.charAt(i) != " " || c > 0) {
    res += fld.charAt(i);
    if (fld.charAt(i) != " ") c = res.length;
    }
  }
var temp0 = res.substr(0,c);

var myRegExp;

myRegExp = /'s/g;
temp0 = temp0.replace(myRegExp, "s");

myRegExp = /'/g;
temp0 = temp0.replace(myRegExp, " ");

myRegExp = /"/g;
temp0 = temp0.replace(myRegExp, " ");

myRegExp = /\./g;
temp0 = temp0.replace(myRegExp, " ");

myRegExp = /\,/g;
temp0 = temp0.replace(myRegExp, " ");

myRegExp = /\+/g;
temp0 = temp0.replace(myRegExp, " ");

myRegExp = /\//g;
temp0 = temp0.replace(myRegExp, " ");

myRegExp = /-/g;
temp0 = temp0.replace(myRegExp, " ");

fld = temp0;
res = "";
c = 0;
for (i=0; i<fld.length; i++) {
  if (fld.charAt(i) != " " || c > 0) {
    res += fld.charAt(i);
    if (fld.charAt(i) != " ") c = res.length;
    }
  }
temp0 = res.substr(0,c);

myRegExp = / {2,}/g;
temp0 = temp0.replace(myRegExp, " ");

myRegExp = / /g;
place = temp0.replace(myRegExp, "-");


var placelower = place.toLowerCase();

if (placelower == "hull")              {placelower = "kingston-upon-hull";}
if (placelower == "gorleston")         {placelower = "gorleston-on-sea";}
if (placelower == "southend")          {placelower = "southend-on-sea";}
if (placelower == "conway")            {placelower = "conwy";}
if (placelower == "clacton")           {placelower = "clacton-on-sea";}
if (placelower == "newcastle")         {placelower = "newcastle-upon-tyne";}
if (placelower == "canvey")            {placelower = "canvey-island";}
if (placelower == "lee-on-solent")     {placelower = "lee-on-the-solent";}
if (placelower == "stoke")             {placelower = "stoke-on-trent";}
if (placelower == "bentham")           {placelower = "high-bentham";}
if (placelower == "burton-on-trent")   {placelower = "burton-upon-trent";}
if (placelower == "kirby-lonsdale")    {placelower = "kirkby-lonsdale";}
if (placelower == "west-byfleet")      {placelower = "byfleet";}
if (placelower == "bognor")            {placelower = "bognor-regis";}
if (placelower == "romney")            {placelower = "new-romney";}
if (placelower == "upton-on-severn")   {placelower = "upton-upon-severn";}
if (placelower == "marske-by-sea")     {placelower = "marske-by-the-sea";}
if (placelower == "lytham")            {placelower = "lytham-st-annes";}
if (placelower == "stansted")          {placelower = "stansted-mountfitchet";}
if (placelower == "ashfield")          {placelower = "kirkby-in-ashfield";}
if (placelower == "merthyr")           {placelower = "merthyr-tydfil";}
if (placelower == "newark")            {placelower = "newark-on-trent";}
if (placelower == "stourport")         {placelower = "stourport-on-severn";}
if (placelower == "stratford-on-avon") {placelower = "stratford-upon-avon";}
if (placelower == "st-ives-cambs")     {placelower = "st-ives-cambridgeshire";}
if (placelower == "wath-on-dearne")    {placelower = "wath-upon-dearne";}
if (placelower == "dereham")           {placelower = "east-dereham";}
if (placelower == "bracklesham")       {placelower = "bracklesham-bay";}
if (placelower == "st-annes")          {placelower = "lytham-st-annes";}
if (placelower == "st-annes-on-sea")   {placelower = "lytham-st-annes";}
if (placelower == "berwick-on-tweed")  {placelower = "berwick-upon-tweed";}
if (placelower == "penrhyn")           {placelower = "penrhyn-bay";}




if (placelower == "royal-leamington")      {placelower = "leamington-spa";}
if (placelower == "royal-leamington-spa")  {placelower = "leamington-spa";}
if (placelower == "anglesey")              {placelower = "holyhead";}
if (placelower == "barry-island")          {placelower = "barry";}
if (placelower == "romney-marsh")          {placelower = "new-romney";}
if (placelower == "woburn-abbey")          {placelower = "woburn";}
if (placelower == "preston-lancashire")    {placelower = "preston";}
if (placelower == "ash-vale")              {placelower = "ash";}
if (placelower == "great-malvern")         {placelower = "malvern";}
if (placelower == "royal-tunbridge-wells") {placelower = "tunbridge-wells";}
if (placelower == "jaywick-sands")         {placelower = "jaywick";}
if (placelower == "new-rossington")        {placelower = "rossington";}
if (placelower == "gornal-wood")           {placelower = "gornal";}
if (placelower == "upper-gornal")          {placelower = "gornal";}
if (placelower == "lower-gornal")          {placelower = "gornal";}







if (placelower == "kenfighill")            {placelower = "kenfig-hill";}
if (placelower == "whaleybridge")          {placelower = "whaley-bridge";}
if (placelower == "north-allerton")        {placelower = "northallerton";}
if (placelower == "narbeth")               {placelower = "narberth";}
if (placelower == "wisbeech")              {placelower = "wisbech";}
if (placelower == "bridgenorth")           {placelower = "bridgnorth";}
if (placelower == "porchester")            {placelower = "portchester";}



var validtowns = {
'aberaeron': 1,
'abercynon': 1,
'aberdare': 1,
'abergavenny': 1,
'abergele': 1,
'abertillery': 1,
'aberystwyth': 1,
'abingdon': 1,
'accrington': 1,
'acle': 1,
'addlestone': 1,
'ainsdale': 1,
'albrighton': 1,
'alcester': 1,
'aldeburgh': 1,
'alderley-edge': 1,
'aldershot': 1,
'aldridge': 1,
'alford': 1,
'alfreton': 1,
'alnwick': 1,
'alresford': 1,
'alsager': 1,
'alton': 1,
'altrincham': 1,
'alvechurch': 1,
'amble': 1,
'ambleside': 1,
'amersham': 1,
'amesbury': 1,
'amlwch': 1,
'ammanford': 1,
'ampthill': 1,
'andover': 1,
'appleby': 1,
'armthorpe': 1,
'arnold': 1,
'arnside': 1,
'arundel': 1,
'ascot': 1,
'ash': 1,
'ashbourne': 1,
'ashburton': 1,
'ashby-de-la-zouch': 1,
'ashford': 1,
'ashington': 1,
'ashton-in-makerfield': 1,
'ashton-under-lyne': 1,
'aston-clinton': 1,
'astwood-bank': 1,
'atherstone': 1,
'attleborough': 1,
'axbridge': 1,
'axminster': 1,
'aylesbury': 1,
'aylesford': 1,
'backwell': 1,
'bacup': 1,
'bagshot': 1,
'baildon': 1,
'bakewell': 1,
'baldock': 1,
'balsall': 1,
'bampton': 1,
'banbury': 1,
'bangor': 1,
'banstead': 1,
'bargoed': 1,
'barking': 1,
'barmouth': 1,
'barnard-castle': 1,
'barnet': 1,
'barnham': 1,
'barnoldswick': 1,
'barnsley': 1,
'barnstaple': 1,
'barnt-green': 1,
'barrow-in-furness': 1,
'barrow-upon-soar': 1,
'barrowford': 1,
'barry': 1,
'barton-le-clay': 1,
'barton-upon-humber': 1,
'basildon': 1,
'basingstoke': 1,
'bath': 1,
'battle': 1,
'bawtry': 1,
'beaconsfield': 1,
'beaminster': 1,
'beaumaris': 1,
'bebington': 1,
'beccles': 1,
'bedale': 1,
'bedford': 1,
'bedlington': 1,
'bedminster': 1,
'bedworth': 1,
'beer': 1,
'beeston': 1,
'belper': 1,
'bembridge': 1,
'benfleet': 1,
'benllech': 1,
'benson': 1,
'bentley': 1,
'berkhamsted': 1,
'berwick-upon-tweed': 1,
'bessacarr': 1,
'beverley': 1,
'bewdley': 1,
'bexhill': 1,
'bexley': 1,
'bicester': 1,
'biddulph': 1,
'bideford': 1,
'bidford-on-avon': 1,
'biggin-hill': 1,
'biggleswade': 1,
'billericay': 1,
'billinge': 1,
'billingham': 1,
'billingshurst': 1,
'bingham': 1,
'bingley': 1,
'birkenhead': 1,
'birmingham': 1,
'bishop-auckland': 1,
'bishops-castle': 1,
'bishops-cleeve': 1,
'bishops-stortford': 1,
'bishops-waltham': 1,
'blaby': 1,
'blackburn': 1,
'blackley': 1,
'blackpool': 1,
'blackwood': 1,
'blaenau-ffestiniog': 1,
'blaenavon': 1,
'blandford-forum': 1,
'bletchingley': 1,
'bletchley': 1,
'blyth': 1,
'bodmin': 1,
'bognor-regis': 1,
'boldon': 1,
'bollington': 1,
'bolsover': 1,
'bolton-le-sands': 1,
'bolton': 1,
'bootle': 1,
'bordon': 1,
'borehamwood': 1,
'borough-green': 1,
'boroughbridge': 1,
'borrowash': 1,
'bosham': 1,
'boston': 1,
'botley': 1,
'bourne-end': 1,
'bourne': 1,
'bournemouth': 1,
'bournville': 1,
'bourton-on-the-water': 1,
'bovey-tracey': 1,
'bovingdon': 1,
'brackley': 1,
'bracknell': 1,
'bradford-on-avon': 1,
'bradford': 1,
'bradley-stoke': 1,
'braintree': 1,
'bramhall': 1,
'bramhope': 1,
'brampton': 1,
'brandon': 1,
'bransgore': 1,
'braunton': 1,
'breaston': 1,
'brecon': 1,
'brentwood': 1,
'bridgend': 1,
'bridgnorth': 1,
'bridgwater': 1,
'bridlington': 1,
'bridport': 1,
'brierley-hill': 1,
'brigg': 1,
'brighouse': 1,
'brightlingsea': 1,
'brighton': 1,
'bristol': 1,
'brixham': 1,
'brixworth': 1,
'broadstairs': 1,
'broadway': 1,
'brockenhurst': 1,
'bromley-cross': 1,
'bromley': 1,
'bromsgrove': 1,
'bromyard': 1,
'broseley': 1,
'brough': 1,
'broughton-astley': 1,
'brownhills': 1,
'broxbourne': 1,
'brundall': 1,
'bruton': 1,
'brynmawr': 1,
'buckfastleigh': 1,
'buckingham': 1,
'buckley': 1,
'bude': 1,
'budleigh-salterton': 1,
'builth-wells': 1,
'bulkington': 1,
'bungay': 1,
'buntingford': 1,
'burgess-hill': 1,
'burgh-le-marsh': 1,
'burghfield-common': 1,
'burley-in-wharfedale': 1,
'burnham-market': 1,
'burnham-on-crouch': 1,
'burnham-on-sea': 1,
'burnley': 1,
'burntwood': 1,
'burscough': 1,
'bursledon': 1,
'burton-joyce': 1,
'burton-latimer': 1,
'burton-upon-trent': 1,
'burwell': 1,
'bury-st-edmunds': 1,
'bury': 1,
'bushey': 1,
'buxton': 1,
'byfleet': 1,
'cadishead': 1,
'caerleon': 1,
'caernarfon': 1,
'caerphilly': 1,
'caldicot': 1,
'callington': 1,
'calverton': 1,
'camberley': 1,
'camborne': 1,
'cambridge': 1,
'camden': 1,
'camelford': 1,
'cannock': 1,
'canterbury': 1,
'canvey-island': 1,
'cardiff': 1,
'cardigan': 1,
'carlisle': 1,
'carlton': 1,
'carmarthen': 1,
'carnforth': 1,
'carterton': 1,
'castle-bromwich': 1,
'castle-cary': 1,
'castle-hedingham': 1,
'castleford': 1,
'caterham': 1,
'catterick': 1,
'chadderton': 1,
'chaddeton': 1,
'chalfont-st-giles': 1,
'chalfont-st-peter': 1,
'chapel-allerton': 1,
'chapel-en-le-frith': 1,
'chapeltown': 1,
'chard': 1,
'charlbury': 1,
'charlton-kings': 1,
'chatham': 1,
'chatteris': 1,
'cheadle-hulme': 1,
'cheadle': 1,
'cheadle-staffordshire': 1,
'cheddar': 1,
'chellaston': 1,
'chelmsford': 1,
'chelsea': 1,
'cheltenham': 1,
'chepstow': 1,
'chertsey': 1,
'chesham': 1,
'cheshunt': 1,
'chester-le-street': 1,
'chester': 1,
'chesterfield': 1,
'chichester': 1,
'chigwell': 1,
'chinnor': 1,
'chippenham': 1,
'chipping-campden': 1,
'chipping-norton': 1,
'chipping-ongar': 1,
'chipping-sodbury': 1,
'chobham': 1,
'choppington': 1,
'chorley': 1,
'chorleywood': 1,
'chorlton': 1,
'christchurch': 1,
'chudleigh': 1,
'chulmleigh': 1,
'church-stretton': 1,
'cinderford': 1,
'cirencester': 1,
'clacton-on-sea': 1,
'clare': 1,
'clay-cross': 1,
'claydon': 1,
'cleckheaton': 1,
'cleethorpes': 1,
'cleobury-mortimer': 1,
'clevedon': 1,
'cleveleys': 1,
'clitheroe': 1,
'coalville': 1,
'cobham': 1,
'cockermouth': 1,
'codsall': 1,
'colchester': 1,
'coleford': 1,
'coleshill': 1,
'colne': 1,
'colwyn-bay': 1,
'colyton': 1,
'congleton': 1,
'congresbury': 1,
'consett': 1,
'conwy': 1,
'cookham': 1,
'corbridge': 1,
'corby': 1,
'corsham': 1,
'cosham': 1,
'coventry': 1,
'cowbridge': 1,
'cowes': 1,
'coxheath': 1,
'cramlington': 1,
'cranbrook': 1,
'cranfield': 1,
'cranleigh': 1,
'craven-arms': 1,
'crawley-down': 1,
'crawley': 1,
'crediton': 1,
'crewe': 1,
'crewkerne': 1,
'criccieth': 1,
'cricklade': 1,
'cromer': 1,
'crook': 1,
'crosby': 1,
'cross-hands': 1,
'crossgates': 1,
'croston': 1,
'crowborough': 1,
'crowland': 1,
'crowle': 1,
'crowthorne': 1,
'croydon': 1,
'crystal-peaks': 1,
'cuckfield': 1,
'cuddington': 1,
'culcheth': 1,
'cullompton': 1,
'cwmbran': 1,
'dagenham': 1,
'dalton-in-furness': 1,
'danbury': 1,
'darlington': 1,
'dartford': 1,
'dartmouth': 1,
'darwen': 1,
'datchet': 1,
'davenham': 1,
'davenport': 1,
'daventry': 1,
'dawlish': 1,
'deal': 1,
'dearne': 1,
'debenham': 1,
'deddington': 1,
'dedham': 1,
'denbigh': 1,
'denham': 1,
'denmead': 1,
'denton': 1,
'derby': 1,
'dersingham': 1,
'desborough': 1,
'devizes': 1,
'dewsbury': 1,
'didcot': 1,
'digswell': 1,
'dinas-powys': 1,
'dinnington': 1,
'disley': 1,
'diss': 1,
'docklands': 1,
'doddinghurst': 1,
'dolgellau': 1,
'doncaster': 1,
'dorchester': 1,
'dorking': 1,
'dover': 1,
'downend': 1,
'downham-market': 1,
'drayton': 1,
'driffield': 1,
'droitwich': 1,
'dronfield': 1,
'droylsden': 1,
'dudley': 1,
'dunnington': 1,
'dunstable': 1,
'durham': 1,
'durrington': 1,
'dymchurch': 1,
'ealing': 1,
'earl-shilton': 1,
'earls-barton': 1,
'earls-colne': 1,
'easingwold': 1,
'east-dereham': 1,
'east-grinstead': 1,
'east-ham': 1,
'east-horsley': 1,
'east-kilbride': 1,
'east-leake': 1,
'east-peckham': 1,
'east-wittering': 1,
'eastbourne': 1,
'eastleigh': 1,
'eastwood': 1,
'eaton-bray': 1,
'ebbw-vale': 1,
'eccles': 1,
'eccleshall': 1,
'edenbridge': 1,
'edgbaston': 1,
'edgeley': 1,
'edgworth': 1,
'egham': 1,
'elland': 1,
'ellesmere-port': 1,
'ellesmere': 1,
'elstree': 1,
'ely': 1,
'emsworth': 1,
'enfield': 1,
'epping': 1,
'epsom': 1,
'epworth': 1,
'esher': 1,
'eston': 1,
'evesham': 1,
'ewell': 1,
'exeter': 1,
'exminster': 1,
'exmouth': 1,
'eye': 1,
'eynsham': 1,
'failsworth': 1,
'fair-oak': 1,
'fairford': 1,
'fakenham': 1,
'falmouth': 1,
'fareham': 1,
'faringdon': 1,
'farnborough': 1,
'farnham': 1,
'farnsfield': 1,
'farnworth': 1,
'faversham': 1,
'felixstowe': 1,
'ferndown': 1,
'ferryhill': 1,
'filey': 1,
'fishguard': 1,
'fleckney': 1,
'fleet': 1,
'fleetwood': 1,
'flint': 1,
'flitwick': 1,
'folkestone': 1,
'fordingbridge': 1,
'forest-row': 1,
'formby': 1,
'fowey': 1,
'framlingham': 1,
'freckleton': 1,
'freshwater': 1,
'frimley': 1,
'frinton-on-sea': 1,
'frodsham': 1,
'frome': 1,
'fulham': 1,
'gainsborough': 1,
'gamlingay': 1,
'garforth': 1,
'garstang': 1,
'gateshead': 1,
'gatley': 1,
'gerrards-cross': 1,
'gillingham-dorset': 1,
'gillingham': 1,
'glasgow': 1,
'glastonbury': 1,
'glossop': 1,
'gloucester': 1,
'godalming': 1,
'godmanchester': 1,
'godstone': 1,
'golborne': 1,
'goldthorpe': 1,
'goole': 1,
'goostrey': 1,
'goring-on-thames': 1,
'gorleston-on-sea': 1,
'gorseinon': 1,
'gosforth': 1,
'gosport': 1,
'grange-over-sands': 1,
'grantham': 1,
'gravesend': 1,
'grays': 1,
'greasby': 1,
'great-dunmow': 1,
'great-harwood': 1,
'great-malvern': 1,
'great-missenden': 1,
'great-wyrley': 1,
'great-yarmouth': 1,
'greenwich': 1,
'grimsby': 1,
'guildford': 1,
'guisborough': 1,
'guiseley': 1,
'hackney': 1,
'haddenham': 1,
'hadleigh': 1,
'hadlow': 1,
'hailsham': 1,
'hale': 1,
'halesowen': 1,
'halesworth': 1,
'halifax': 1,
'halstead': 1,
'haltwhistle': 1,
'hamble': 1,
'hammersmith': 1,
'harborne': 1,
'hardingtown': 1,
'harefield': 1,
'haringey': 1,
'harlech': 1,
'harlington': 1,
'harlow': 1,
'harpenden': 1,
'harrogate': 1,
'harrow': 1,
'hartlepool': 1,
'hartley-wintney': 1,
'harwich': 1,
'haslemere': 1,
'hastings': 1,
'hatfield': 1,
'hathersage': 1,
'havant': 1,
'haverfordwest': 1,
'haverhill': 1,
'hawarden': 1,
'hawkhurst': 1,
'hawkinge': 1,
'haxby': 1,
'haxey': 1,
'hay-on-wye': 1,
'hayle': 1,
'hayling-island': 1,
'haywards-heath': 1,
'hazel-grove': 1,
'heacham': 1,
'headcorn': 1,
'headingley': 1,
'heanor': 1,
'heathfield': 1,
'hebburn': 1,
'hebden-bridge': 1,
'heckmondwike': 1,
'hedge-end': 1,
'hedon': 1,
'helmsley': 1,
'helston': 1,
'hemel-hempstead': 1,
'hemsworth': 1,
'henfield': 1,
'henley-in-arden': 1,
'henley-on-thames': 1,
'henlow': 1,
'hereford': 1,
'herne-bay': 1,
'hertford': 1,
'heswall': 1,
'hexham': 1,
'heywood': 1,
'high-bentham': 1,
'high-etherley': 1,
'high-lane': 1,
'high-wycombe': 1,
'higham-ferrers': 1,
'highworth': 1,
'hinckley': 1,
'hindhead': 1,
'hindley': 1,
'histon': 1,
'hitchin': 1,
'hockley-heath': 1,
'hockley': 1,
'hoddesdon': 1,
'holbeach': 1,
'holmes-chapel': 1,
'holmfirth': 1,
'holsworthy': 1,
'holt': 1,
'holyhead': 1,
'holywell': 1,
'honiton': 1,
'hoo': 1,
'hook': 1,
'horbury': 1,
'horley': 1,
'horncastle': 1,
'hornchurch': 1,
'hornsea': 1,
'horsforth': 1,
'horsham': 1,
'horwich': 1,
'houghton-le-spring': 1,
'hounslow': 1,
'hove': 1,
'hoveton': 1,
'howden': 1,
'hoylake': 1,
'hucknall': 1,
'huddersfield': 1,
'hungerford': 1,
'hunstanton': 1,
'huntingdon': 1,
'hurstpierpoint': 1,
'huyton': 1,
'hyde': 1,
'hythe-southampton': 1,
'hythe': 1,
'ilford': 1,
'ilfracombe': 1,
'ilkeston': 1,
'ilkley': 1,
'ilminster': 1,
'immingham': 1,
'ingatestone': 1,
'ingleby-barwick': 1,
'ipswich': 1,
'irchester': 1,
'irlam': 1,
'ironbridge': 1,
'islington': 1,
'iver': 1,
'ivybridge': 1,
'jacksdale': 1,
'jarrow': 1,
'keighley': 1,
'kelvedon-hatch': 1,
'kelvedon': 1,
'kempston': 1,
'kendal': 1,
'kenfig-hill': 1,
'kenilworth': 1,
'kensington': 1,
'kessingland': 1,
'keswick': 1,
'kettering': 1,
'keynsham': 1,
'keyworth': 1,
'kibworth': 1,
'kidderminster': 1,
'kidlington': 1,
'kidsgrove': 1,
'killamarsh': 1,
'killingworth': 1,
'kings-heath': 1,
'kings-hill': 1,
'kings-langley': 1,
'kings-lynn': 1,
'kingsbridge': 1,
'kingsbury': 1,
'kingsclere': 1,
'kingskerswell': 1,
'kingsland': 1,
'kingsteignton': 1,
'kingston-upon-hull': 1,
'kingston-upon-thames': 1,
'kingswood': 1,
'kington': 1,
'kintbury': 1,
'kinver': 1,
'kirkby-lonsdale': 1,
'kirkburton': 1,
'kirkby-in-ashfield': 1,
'kirkby-stephen': 1,
'kirkby': 1,
'kirkbymoorside': 1,
'kirkham': 1,
'kiveton-park': 1,
'knaresborough': 1,
'knebworth': 1,
'knighton': 1,
'knott-end-on-sea': 1,
'knotty-ash': 1,
'knowle': 1,
'knutsford': 1,
'lakenheath': 1,
'lambeth': 1,
'lambourn': 1,
'lampeter': 1,
'lancaster': 1,
'lancing': 1,
'langley': 1,
'langport': 1,
'launceston': 1,
'leamington-spa': 1,
'leatherhead': 1,
'lechlade': 1,
'ledbury': 1,
'lee-on-the-solent': 1,
'leeds': 1,
'leek': 1,
'leicester': 1,
'leigh': 1,
'leighton-buzzard': 1,
'leiston': 1,
'lenham': 1,
'leominster': 1,
'letchworth': 1,
'lewes': 1,
'lewisham': 1,
'leyburn': 1,
'leyland': 1,
'lichfield': 1,
'lightwater': 1,
'lincoln': 1,
'lingfield': 1,
'liphook': 1,
'liskeard': 1,
'liss': 1,
'little-lever': 1,
'littleborough': 1,
'littlehampton': 1,
'littleport': 1,
'liverpool': 1,
'llandeilo': 1,
'llandovery': 1,
'llandrindod-wells': 1,
'llandudno': 1,
'llanelli': 1,
'llanfairfechan': 1,
'llangefni': 1,
'llangollen': 1,
'llanidloes': 1,
'llanrwst': 1,
'llantwit-major': 1,
'locks-heath': 1,
'loddon': 1,
'loftus': 1,
'london': 1,
'long-ashton': 1,
'long-buckby': 1,
'long-eaton': 1,
'long-hanborough': 1,
'long-melford': 1,
'long-stratton': 1,
'long-sutton': 1,
'longfield': 1,
'longridge': 1,
'longton': 1,
'longton-staffordshire': 1,
'longtown': 1,
'longwell-green': 1,
'looe': 1,
'lostwithiel': 1,
'loughborough': 1,
'loughton': 1,
'louth': 1,
'lowestoft': 1,
'ludgershall': 1,
'ludlow': 1,
'luton': 1,
'lutterworth': 1,
'lydd': 1,
'lydney': 1,
'lyme-regis': 1,
'lyminge': 1,
'lymington': 1,
'lymm': 1,
'lyndhurst': 1,
'lynton': 1,
'lytchett-matravers': 1,
'lytham-st-annes': 1,
'mablethorpe': 1,
'macclesfield': 1,
'machynlleth': 1,
'maesteg': 1,
'maghull': 1,
'magor': 1,
'maidenhead': 1,
'maidstone': 1,
'maldon': 1,
'malmesbury': 1,
'malton': 1,
'manchester': 1,
'manningtree': 1,
'mansfield-woodhouse': 1,
'mansfield': 1,
'marazion': 1,
'march': 1,
'marchwood': 1,
'margate': 1,
'market-bosworth': 1,
'market-deeping': 1,
'market-drayton': 1,
'market-harborough': 1,
'market-rasen': 1,
'market-weighton': 1,
'marlborough': 1,
'marlow': 1,
'marple': 1,
'marsden': 1,
'marske-by-the-sea': 1,
'martham': 1,
'martlesham-heath': 1,
'martock': 1,
'marylebone': 1,
'maryport': 1,
'matlock': 1,
'mattishall': 1,
'mayfield': 1,
'maylandsea': 1,
'melbourn': 1,
'melbourne': 1,
'melksham': 1,
'melton-mowbray': 1,
'menai-bridge': 1,
'meopham': 1,
'mere': 1,
'meriden': 1,
'merthyr-tydfil': 1,
'merton': 1,
'mevagissey': 1,
'mexborough': 1,
'mickleover': 1,
'middlesbrough': 1,
'middleton': 1,
'middlewich': 1,
'midhurst': 1,
'midsomer-norton': 1,
'mildenhall': 1,
'milford-haven': 1,
'milford-on-sea': 1,
'millbrook': 1,
'milnrow': 1,
'milton-keynes': 1,
'milton-under-wychwood': 1,
'minchinhampton': 1,
'minehead': 1,
'minsterley': 1,
'mirfield': 1,
'mitcheldean': 1,
'modbury': 1,
'mold': 1,
'monmouth': 1,
'morecambe': 1,
'moreton-in-marsh': 1,
'moreton': 1,
'morley': 1,
'morpeth': 1,
'mortimer': 1,
'mosborough': 1,
'moston': 1,
'mountain-ash': 1,
'mousehole': 1,
'much-wenlock': 1,
'mullion': 1,
'mumbles': 1,
'mundesley': 1,
'nailsea': 1,
'nailsworth': 1,
'nantwich': 1,
'naphill': 1,
'narberth': 1,
'narborough': 1,
'neath': 1,
'needham-market': 1,
'nelson': 1,
'neston': 1,
'nether-stowey': 1,
'netley': 1,
'new-mills': 1,
'new-milton': 1,
'new-ollerton': 1,
'new-romney': 1,
'newark-on-trent': 1,
'newbridge': 1,
'newbury': 1,
'newcastle-emlyn': 1,
'newcastle-under-lyme': 1,
'newcastle-upon-tyne': 1,
'newent': 1,
'newhaven': 1,
'newick': 1,
'newlyn': 1,
'newmarket': 1,
'newport-iow': 1,
'newport-pagnell': 1,
'newport-shropshire': 1,
'newport': 1,
'newquay': 1,
'newton-abbot': 1,
'newton-aycliffe': 1,
'newton-le-willows': 1,
'newtown': 1,
'normanton': 1,
'north-baddesley': 1,
'north-cave': 1,
'north-shields': 1,
'north-walsham': 1,
'northallerton': 1,
'northampton': 1,
'northfleet': 1,
'northiam': 1,
'northleach': 1,
'northwich': 1,
'norwich': 1,
'nottingham': 1,
'nuneaton': 1,
'oadby': 1,
'oakengates': 1,
'oakham': 1,
'oakley': 1,
'odiham': 1,
'offerton': 1,
'okehampton': 1,
'old-windsor': 1,
'oldham': 1,
'olney': 1,
'ormskirk': 1,
'orrell': 1,
'ossett': 1,
'oswaldtwistle': 1,
'oswestry': 1,
'otford': 1,
'otley': 1,
'ottershaw': 1,
'ottery-st-mary': 1,
'oundle': 1,
'overton': 1,
'oxford': 1,
'oxted': 1,
'paddington': 1,
'paddock-wood': 1,
'padiham': 1,
'padstow': 1,
'paignton': 1,
'painswick': 1,
'pangbourne': 1,
'par': 1,
'parbold': 1,
'park-gate': 1,
'parkgate': 1,
'partington': 1,
'patchway': 1,
'paulton': 1,
'peacehaven': 1,
'pelsall': 1,
'pembroke': 1,
'penarth': 1,
'pencoed': 1,
'penistone': 1,
'penketh': 1,
'penkridge': 1,
'penmaenmawr': 1,
'penn': 1,
'penrith': 1,
'penryn': 1,
'penzance': 1,
'perranporth': 1,
'pershore': 1,
'peterborough': 1,
'peterlee': 1,
'petersfield': 1,
'petworth': 1,
'pevensey-bay': 1,
'pewsey': 1,
'pickering': 1,
'pill': 1,
'plymouth': 1,
'plymstock': 1,
'pocklington': 1,
'polesworth': 1,
'pontardawe': 1,
'pontarddulais': 1,
'pontardulais': 1,
'pontefract': 1,
'ponteland': 1,
'pontypool': 1,
'pontypridd': 1,
'poole': 1,
'poppleton': 1,
'poringland': 1,
'portchester': 1,
'port-isaac': 1,
'port-talbot': 1,
'porthcawl': 1,
'porthmadog': 1,
'portishead': 1,
'portland': 1,
'portslade': 1,
'portsmouth': 1,
'potters-bar': 1,
'poulton-le-fylde': 1,
'poynton': 1,
'prescot': 1,
'prestatyn': 1,
'prestbury': 1,
'presteigne': 1,
'preston-dorset': 1,
'preston': 1,
'prestwich': 1,
'prestwood': 1,
'princes-risborough': 1,
'prudhoe': 1,
'pudsey': 1,
'pulborough': 1,
'putney': 1,
'pwllheli': 1,
'queensbury': 1,
'quorn': 1,
'radcliffe-on-trent': 1,
'radcliffe': 1,
'radlett': 1,
'rainford': 1,
'rainham': 1,
'ramsbottom': 1,
'ramsden-bellhouse': 1,
'ramsey': 1,
'ramsgate': 1,
'raunds': 1,
'rayleigh': 1,
'reading': 1,
'redbourn': 1,
'redcar': 1,
'redditch': 1,
'redhill': 1,
'reigate': 1,
'retford': 1,
'rhayader': 1,
'rhoose': 1,
'rhos-on-sea': 1,
'rhyl': 1,
'richmond-upon-thames': 1,
'richmond': 1,
'rickmansworth': 1,
'ringmer': 1,
'ringwood': 1,
'ripley': 1,
'ripon': 1,
'ripponden': 1,
'risca': 1,
'robertsbridge': 1,
'robertsville': 1,
'rochdale': 1,
'rochester': 1,
'rock': 1,
'rockcliffe': 1,
'romford': 1,
'romiley': 1,
'romsey': 1,
'ross-on-wye': 1,
'rossendale': 1,
'rothbury': 1,
'rotherfield': 1,
'rotherham': 1,
'rothwell': 1,
'rottingdean': 1,
'rowlands-gill': 1,
'royal-tunbridge-wells': 1,
'royston': 1,
'royton': 1,
'ruddington': 1,
'rugby': 1,
'rugeley': 1,
'runcorn': 1,
'rushden': 1,
'ruthin': 1,
'ryde': 1,
'rye': 1,
'ryton': 1,
'saffron-walden': 1,
'salcombe': 1,
'sale': 1,
'salford': 1,
'salisbury': 1,
'saltash': 1,
'saltburn-by-the-sea': 1,
'saltdean': 1,
'saltford': 1,
'sandbach': 1,
'sandhurst': 1,
'sandiacre': 1,
'sandown': 1,
'sandwich': 1,
'sandy': 1,
'saundersfoot': 1,
'sawbridgeworth': 1,
'sawston': 1,
'sawtry': 1,
'saxmundham': 1,
'scarborough': 1,
'scunthorpe': 1,
'seaford': 1,
'seaham': 1,
'seaton-delaval': 1,
'seaton': 1,
'seaview': 1,
'sedgefield': 1,
'selby': 1,
'selly-oak': 1,
'selsey': 1,
'send': 1,
'settle': 1,
'sevenoaks': 1,
'shaftesbury': 1,
'shaldon': 1,
'shanklin': 1,
'shaw': 1,
'sheerness': 1,
'sheffield': 1,
'shelf': 1,
'shenley': 1,
'shepperton': 1,
'shepshed': 1,
'shepton-mallet': 1,
'sherborne': 1,
'sherburn-in-elmet': 1,
'sheringham': 1,
'shevington': 1,
'shifnal': 1,
'shildon': 1,
'shinfield': 1,
'shipley': 1,
'shipston-on-stour': 1,
'shirley': 1,
'shoreham-by-sea': 1,
'shotton': 1,
'shrewsbury': 1,
'shrivenham': 1,
'sidmouth': 1,
'sileby': 1,
'silloth': 1,
'silsden': 1,
'silsoe': 1,
'sittingbourne': 1,
'skegness': 1,
'skelmanthorpe': 1,
'skelmersdale': 1,
'skipton': 1,
'sleaford': 1,
'slough': 1,
'small-heath': 1,
'smethwick': 1,
'snaith': 1,
'snodland': 1,
'soham': 1,
'solihull': 1,
'somerton': 1,
'sonning-common': 1,
'south-brent': 1,
'south-elmsall': 1,
'south-molton': 1,
'south-ockendon': 1,
'south-petherton': 1,
'south-shields': 1,
'south-woodham-ferrers': 1,
'southam': 1,
'southampton': 1,
'southend-on-sea': 1,
'southport': 1,
'southsea': 1,
'southwark': 1,
'southwater': 1,
'southwell': 1,
'southwick': 1,
'southwold': 1,
'spalding': 1,
'sparkbrook': 1,
'spencers-wood': 1,
'spennymoor': 1,
'spilsby': 1,
'st-agnes': 1,
'st-albans': 1,
'st-austell': 1,
'st-clears': 1,
'st-columb-major': 1,
'st-helens': 1,
'st-ives-cambridgeshire': 1,
'st-ives': 1,
'st-just': 1,
'st-margarets-at-cliffe': 1,
'st-mawes': 1,
'st-neots': 1,
'st-osyth': 1,
'stafford': 1,
'staines': 1,
'stalham': 1,
'stalybridge': 1,
'stamford': 1,
'standish': 1,
'stanford-le-hope': 1,
'stanhope': 1,
'stanley': 1,
'stansted-mountfitchet': 1,
'stapleford': 1,
'staplehurst': 1,
'stevenage': 1,
'stewkley': 1,
'steyning': 1,
'stockport': 1,
'stocksbridge': 1,
'stockton-heath': 1,
'stockton-on-tees': 1,
'stoke-on-trent': 1,
'stokenchurch': 1,
'stokesley': 1,
'stone': 1,
'stonehouse': 1,
'stony-stratford': 1,
'storrington': 1,
'stotfold': 1,
'stourport-on-severn': 1,
'stow-on-the-wold': 1,
'stowmarket': 1,
'stratford-upon-avon': 1,
'street': 1,
'stretford': 1,
'strood': 1,
'stroud': 1,
'studley': 1,
'sturminster-newton': 1,
'sudbury': 1,
'sunbury-on-thames': 1,
'sunderland': 1,
'sunningdale': 1,
'sunninghill': 1,
'sutton-at-hone': 1,
'sutton-coldfield': 1,
'sutton-in-ashfield': 1,
'sutton-on-sea': 1,
'sutton': 1,
'swadlincote': 1,
'swaffham': 1,
'swallownest': 1,
'swanage': 1,
'swanland': 1,
'swanley': 1,
'swanscombe': 1,
'swansea': 1,
'sway': 1,
'swindon': 1,
'swinton': 1,
'syston': 1,
'tadcaster': 1,
'tadley': 1,
'taffs-well': 1,
'talbot-green': 1,
'tamworth': 1,
'tarleton': 1,
'tarporley': 1,
'taunton': 1,
'taverham': 1,
'tavistock': 1,
'teignmouth': 1,
'telford': 1,
'tenbury-wells': 1,
'tenby': 1,
'tenterden': 1,
'terrington-st-clement': 1,
'tetbury': 1,
'tewkesbury': 1,
'thame': 1,
'thatcham': 1,
'thaxted': 1,
'thetford': 1,
'theydon-bois': 1,
'thirsk': 1,
'thornbury': 1,
'thorne': 1,
'thornton-cleveleys': 1,
'thrapston': 1,
'tilbury': 1,
'tisbury': 1,
'tiverton': 1,
'toddington': 1,
'todmorden': 1,
'tollesbury': 1,
'tonbridge': 1,
'tongwynlais': 1,
'tonteg': 1,
'tonypandy': 1,
'topsham': 1,
'torpoint': 1,
'torquay': 1,
'torrington': 1,
'totnes': 1,
'tottington': 1,
'totton': 1,
'towcester': 1,
'tower-hamlets': 1,
'tredegar': 1,
'tring': 1,
'trowbridge': 1,
'truro': 1,
'tutbury': 1,
'twyford': 1,
'tyldesley': 1,
'tynemouth': 1,
'tywyn': 1,
'uckfield': 1,
'ulverston': 1,
'uppermill': 1,
'uppingham': 1,
'upton-upon-severn': 1,
'urmston': 1,
'usk': 1,
'uttoxeter': 1,
'uxbridge': 1,
'ventnor': 1,
'verwood': 1,
'virginia-water': 1,
'waddesdon': 1,
'wadebridge': 1,
'wadhurst': 1,
'wainfleet-all-saints': 1,
'wakefield': 1,
'walberton': 1,
'walkden': 1,
'wallasey': 1,
'wallingford': 1,
'wallsend': 1,
'walsall': 1,
'waltham-abbey': 1,
'waltham-forest': 1,
'walton-on-thames': 1,
'wandsworth': 1,
'wantage': 1,
'ware': 1,
'wareham': 1,
'wargrave': 1,
'warminster': 1,
'warrington': 1,
'warwick': 1,
'washington': 1,
'watchet': 1,
'wateringbury': 1,
'waterlooville': 1,
'watford': 1,
'watlington': 1,
'watton': 1,
'weedon': 1,
'wellesbourne': 1,
'wellingborough': 1,
'wellington-telford': 1,
'wellington': 1,
'wells-next-the-sea': 1,
'wells': 1,
'welshpool': 1,
'welwyn-garden-city': 1,
'welwyn': 1,
'wem': 1,
'wembley': 1,
'wendover': 1,
'weobley': 1,
'west-bridgford': 1,
'west-bromwich': 1,
'west-end': 1,
'west-hill': 1,
'west-kingsdown': 1,
'west-kirby': 1,
'west-malling': 1,
'west-mersea': 1,
'westerham': 1,
'westgate-on-sea': 1,
'westhoughton': 1,
'weston-super-mare': 1,
'wetherby': 1,
'weybridge': 1,
'weymouth': 1,
'whaley-bridge': 1,
'whalley': 1,
'wheathampstead': 1,
'wheatley': 1,
'whickham': 1,
'whitby': 1,
'whitchurch-hampshire': 1,
'whitchurch': 1,
'whitefield': 1,
'whitehaven': 1,
'whiteley': 1,
'whitley-bay': 1,
'whitstable': 1,
'whittlesey': 1,
'whitworth': 1,
'wickford': 1,
'wickham-market': 1,
'wickham': 1,
'widdrington-station': 1,
'widnes': 1,
'wigan': 1,
'wigston': 1,
'wigton': 1,
'willington': 1,
'williton': 1,
'wilmslow': 1,
'wilpshire': 1,
'wimborne-minster': 1,
'wincanton': 1,
'winchcombe': 1,
'winchester': 1,
'windermere': 1,
'windlesham': 1,
'windsor': 1,
'wing': 1,
'wingham': 1,
'winlaton': 1,
'winscombe': 1,
'winsford': 1,
'winslow': 1,
'wirksworth': 1,
'wisbech': 1,
'witham': 1,
'withernsea': 1,
'witney': 1,
'wiveliscombe': 1,
'wivenhoe': 1,
'woburn-sands': 1,
'woking': 1,
'wokingham': 1,
'wollaston': 1,
'wolverhampton': 1,
'wolverton': 1,
'wombourne': 1,
'wombwell': 1,
'woodbridge': 1,
'woodhall-spa': 1,
'woodley': 1,
'woodstock': 1,
'wooler': 1,
'woolpit': 1,
'woolton': 1,
'wootton-bassett': 1,
'wootton': 1,
'worcester': 1,
'workington': 1,
'worksop': 1,
'worsley': 1,
'worthing': 1,
'wotton-under-edge': 1,
'wrexham': 1,
'wrington': 1,
'wroughton': 1,
'wroxham': 1,
'wye': 1,
'wymondham': 1,
'yapton': 1,
'yate': 1,
'yateley': 1,
'yaxley': 1,
'yealmpton': 1,
'yelverton': 1,
'yeovil': 1,
'york': 1,
'ystrad-mynach': 1,
'ystradgynlais': 1,


'bridge': 1,
'llandudno-junction': 1,
'middleton-on-sea': 1,
'orpington': 1,
'prenton': 1,
'ruislip': 1,
'sandgate': 1,
'st-leonards-on-sea': 1,
'stubbington': 1,
'waterloo': 1,
'litherland': 1,
'old-colwyn': 1,
'rustington': 1,
'stratford': 1,
'thornton': 1,
'churchdown': 1,
'bromborough': 1,
'redruth': 1,
'stradbroke': 1,
'radyr': 1,
'eckington': 1,
'rumney': 1,
'st-marys': 1,
'woolacombe': 1,
'ash-kent': 1,
'cliftonville': 1,
'ollerton': 1,
'cowplain': 1,
'worle': 1,
'abersoch': 1,
'cambourne': 1,
'haydock': 1,
'edgware': 1,
'blythe-bridge': 1,
'carbis-bay': 1,
'bloxwich': 1,
'hagley': 1,
'woburn': 1,
'malvern': 1,
'rainworth': 1,
'low-fell': 1,
'ashtead': 1,
'over-hulton': 1,
'walthamstow': 1,
'chingford': 1,
'wraysbury': 1,
'aylsham': 1,
'rawtenstall': 1,
'filton': 1,
'burford': 1,
'saltaire': 1,
'ashington-sussex': 1,
'ripley-surrey': 1,
'north-ferriby': 1,
'wath-upon-dearne': 1,
'knaphill': 1,
'heaton': 1,
'st-davids': 1,
'clanfield': 1,
'little-sutton': 1,
'crickhowell': 1,
'stourbridge': 1,
'clifton': 1,
'marston-green': 1,
'radstock': 1,
'rainham-essex': 1,
'west-wittering': 1,
'bracklesham-bay': 1,
'woodley-reading': 1,
'beckenham': 1,
'bitterne': 1,
'chandlers-ford': 1,
'titchfield': 1,
'birkdale': 1,
'knowle-bristol': 1,
'raddish': 1,
'tunstall': 1,
'cowley': 1,
'didsbury': 1,
'erdington': 1,
'four-oaks': 1,
'great-barr': 1,
'rainhill': 1,
'allerton': 1,
'mossley-hill': 1,
'purley': 1,
'bamber-bridge': 1,
'westbury-on-trym': 1,
'pembroke-dock': 1,
'tilehurst': 1,
'surbiton': 1,
'wimbledon': 1,
'sidcup': 1,
'mayfair': 1,
'claughton': 1,
'acton': 1,
'balham': 1,
'barnes': 1,
'barons-court': 1,
'battersea': 1,
'bayswater': 1,
'blackheath': 1,
'bow': 1,
'brentford': 1,
'chessington': 1,
'felpham': 1,
'rowlands-castle': 1,
'yatton': 1,
'chew-magna': 1,
'moretonhampstead': 1,
'binfield': 1,
'wolsingham': 1,
'grayshott': 1,
'montgomery': 1,
'hazlemere': 1,
'appleby-in-westmorland': 1,
'tunbridge-wells': 1,
'brackla': 1,
'birstall': 1,
'brackla': 1,
'bere-alston': 1,
'jaywick': 1,
'coulsdon': 1,
'yarm': 1,
'hassocks': 1,
'bala': 1,
'stoke-gifford': 1,
'rhuddlan': 1,
'grassington': 1,
'castle-donington': 1,
'leckhampton': 1,
'llanybydder': 1,
'kippax': 1,
'lavenham': 1,
'wedmore': 1,
'dulverton': 1,
'west-drayton': 1,
'harleston': 1,
'tipton': 1,
'shoeburyness': 1,
'westcliff-on-sea': 1,
'leigh-on-sea': 1,
'thorpe-bay': 1,
'aberdovey': 1,
'aldwick': 1,
'sowerby-bridge': 1,
'penrhyn-bay': 1,
'birchington': 1,
'rossington': 1,
'carcroft': 1,
'cheriton': 1,
'dereham': 1,
'deganwy': 1,
'yarmouth': 1,
'haslingden': 1,
'kegworth': 1,
'sedgley': 1,
'gornal': 1,
'herstmonceux': 1,
'coningsby': 1,
'calne': 1,
'pateley-bridge': 1,
'st-keverne': 1,
'husbands-bosworth': 1,
'slaithwaite': 1,
'hadnall': 1,
'bearsted': 1,
'port-solent': 1,
'kimbolton': 1,
'farsley': 1,
'frimley-green': 1,
'polperro': 1,
'west-wickham': 1,
'mytholmroyd': 1,
'london-colney': 1,







'wirral': 1,


'dunfermline': 1,
'annan': 1,
'stirling': 1,

'last-one-has-no-comma': 1
};



if (validtowns[placelower] == 1)
{

  //if (window.location.href == "http://www.estate.orangehome.co.uk/estate-agents-" + placelower + ".htm")
  //{
  // write email if town entered is same as current town and redirect to current town 

//write email if town is valid
//document.form1.town.value = "OK " + town + " OK " + window.location.href;
//document.form1.success.value = "http://www.estate.orangehome.co.uk/estate-agents-" + placelower + ".htm";
//document.form1.submit();

  // alert user that town entered is current town
  //var val = placelower;
  //var newVal = '';
  //val = val.split(' ');
  //for(var c=0; c < val.length; c++)
  //{newVal += val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length) + ' ';}
  //var obj = newVal;
  //alert("Please click on the name of an agent to go to their website.\r\rOr try another town?");
  //}

  // if town entered is not same as current town redirect to town entered 
  //else {window.location.href = "http://www.estate.orangehome.co.uk/estate-agents-" + placelower + ".htm";}

window.location.href = "http://www.estate.orangehome.co.uk/estate-agents-" + placelower + ".htm";

}


else
{
alert("Sorry, we do not have a town called  '" + town + "'  listed.");

//document.form1.success.value = "http://www.estate.orangehome.co.uk/estate-agents-in.htm";
//document.form1.town.value = "$ " + town + " $ " + window.location.href;
//document.form1.submit();

//window.location.href = "http://www.estate.orangehome.co.uk/estate-agents-in.htm";
window.location.href = "http://www.estate.orangehome.co.uk/index.htm";
}


}
                                                          
else  {alert("Please enter a town");}
}
