if (cookieEnabled) {
if (userName != null && userName != 'null') {
var the_region;
function getCounty() {
var countyCookie = getCookie('user');
if (countyCookie != null && countyCookie.length > 0) {
var indexOfFn = countyCookie.indexOf('COUNTY=');
if (indexOfFn >= 0) {
var indexOfNextAmp = countyCookie.indexOf('&', indexOfFn);
if (indexOfNextAmp >= 0) {
return countyCookie.substring(indexOfFn + 7, indexOfNextAmp);
}
}
} return null;
}
var userCounty = getCounty().toLowerCase();
var g=0;
var remws = new Array('county ','of ','and ','with ',' city','north ','south','east ','west ','isle','isles',' ');
for (var n = 0; n < remws.length; n++) {
userCounty = userCounty.replace(remws[n], "");
} var i=0;
var regions=new Array();
regions[i++]="Scottish *s1c* s *s1c* caithness,sutherland,ross,cromarty,inverness,nairn,elgin,banff,aberdeen,kincardine,forfar,perth,argyll,bute,ayr,renfrew,dumbarton,stirling,clackmannan,kinross,fife,linlithgow,edinburgh,haddington,berwick,roxburgh,dumfries,kirkcudbright,wigtown,lanark,selkirk,peebles,zetland,shetland,orkney,ross and cromarty,inverness-shire,nairnshire,moray,banffshire,aberdeenshire,kincardineshire,angus,forfarshire,perthshire,bute,ayrshire,renfrewshire,dunbartonshire,stirlingshire,clackmannanshire,kinross-shire,lothian,haddingtonshire,midlothian,edinburgh,lothian,linlithgowshire,lanarkshire,peeblesshire,selkirkshire,berwickshire,roxburghshire,dumfriesshire,kirkcudbrightshire,wigtownshire";
regions[i++]="North West *s1c* nw *s1c* cheshire,ellesmere port and neston,chester,crewe and nantwich,congleton,macclesfield,vale royal,warrington,halton,cumbria,barrow-in-furness,lakeland,copeland,allerdale,eden,carlisle,greater manchester,bolton,bury,manchester,oldham,rochdale,salford,stockport,tameside,trafford,wigan,lancashire,lancashire,chorley,ribble,fylde,preston,wyre,lancaster,ribble valley,pendle,burnley,rossendale,hyndburn,blackpool,blackburn with darwen,merseyside,knowsley,liverpool,st helens,sefton,wirral,wexham,convey,gwynedd,anglesey";
regions[i++]="North East *s1c* ne *s1c* northumberland,blyth valley,wansbeck,castle morpeth,tynedale,alnwick,berwick-upon-tweed,tyne and wear,newcastle upon tyne,gateshead, tyneside,tyneside,sunderland, durham,durham,durham,easington,sedgefield,teesdale,wear valley,derwentside,chester-le-street,darlington,stockton-on-tees,hartlepool,yorkshire,redcar and cleveland,middlesbrough";
regions[i++]="South West &amp; Wales *s1c* sww *s1c* anglesey,brecknockshire,caernarfonshire,cardiganshire,carmarthenshire,denbighshire,flintshire,glamorgan,merioneth,monmouthshire,montgomeryshire,pembrokeshire,radnorshire,merthyr tydfil,merthyr tudful,caerphilly,caerffili,blaenau gwent,torfaen,tor-faen,monmouthshire,sir fynwy,newport,casnewydd,cardiff,caerdydd,vale  glamorgan,bro morgannwg,bridgend,pen-y-bont ar ogwr,rhondda cynon taff,rhondda cynon tâf,neath port talbot,castell-nedd port talbot,swansea,abertawe,carmarthenshire,sir gaerfyrddin,ceredigion,powys,wrexham,wrecsam,flintshire,sir y fflint,denbighshire,sir ddinbych,conwy,ynys môn,pembrokeshire,sir benfro,gwent,glamorgan,de morgannwg,midglamorgan,morgannwg ganol,glamorgan,gorllewin morgannwg,dyfed,powys,clwyd,somerset,taunton deane,somerset,sedgemoor,mendip,stroud,wiltshire,kennet,wiltshire,weymouth and portland,dorset,dorset,purbeck,dorset,torbay,plymouth,scilly,cornwall,penwith,kerrier,carrick,restormel,caradon,cornwall,somerset,bath,gloucestershire,gloucestershire,gloucester,tewkesbury,cheltenham,cotswold,wiltshire,swindon,bristol";
regions[i++]="Yorkshire *s1c* y *s1c* yorkshire,sheffield,rotherham,barnsley,doncaster,wakefield,kirklees,calderdale,bradford,leeds,selby,harrogate,craven,richmondshire,hambleton,ryedale,scarborough,york,riding,yorkshire,kingston upon hull,lincolnshire,lincolnshire,lincoln";
regions[i++]="Midlands *s1c* m *s1c* herefordshire,shropshire,bridgnorth, shropshire,oswestry,shrewsbury and atcham,shropshire,telford and wrekin,staffordshire,cannock chase,staffordshire,lichfield,newcastle-under-lyme,staffordshire,stafford,staffordshire moorlands,tamworth,stoke-on-trent,warwickshire, warwickshire,nuneaton and bedworth,rugby,stratford-on-avon,warwick,midlands,birmingham,coventry,dudley,sandwell,solihull,walsall,wolverhampton,worcestershire,bromsgrove,malvern hills,redditch,worcester,wychavon,wyre forest,derbyshire,derbyshire,high peak,derbyshire dales,derbyshire,erewash,amber valley, derbyshire,chesterfield,bolsover,derby,nottinghamshire,nottinghamshire,rushcliffe,broxtowe,ashfield,gedling,newark and sherwood,mansfield,bassetlaw,nottingham,holland,boston,lindsey,lindsey,leicestershire,leicestershire,charnwood,melton,harborough,oadby and wigston,blaby,hinckley and bosworth,leicestershire,leicester,rutland,northamptonshire,northamptonshire,northampton,daventry,wellingborough,kettering,corby,northamptonshire";
regions[i++]="N. London &amp; East of England *s1c* nle *s1c* thurrock,southend-on-sea,essex,harlow,epping forest,brentwood,basildon,castle point,rochford,maldon,chelmsford,uttlesford,braintree,colchester,tendring,chelmsford,hertfordshire,three rivers,watford,hertsmere,welwyn hatfield,broxbourne,hertfordshire,stevenage,hertfordshire,st albans,dacorum,bedfordshire,luton,bedfordshire,bedford,mid bedfordshire,bedfordshire,   london, islington,camden, bexley,havering,barking dagenham,redbridge,newham,waltham forest,haringey,enfield,barnet,havering,lincolnshire, kesteven,kesteven, cambridgeshire,cambridge,cambridgeshire,huntingdonshire,fenland,cambridgeshire,peterborough,norfolk,norwich,norfolk,great yarmouth,broadland,norfolk,king's lynn and norfolk,breckland,suffolk,ipswich,suffolk coastal,waveney,mid suffolk,babergh,st edmundsbury,forest heath";
regions[i++]="S. London, Kent, Sussex *s1c* sl *s1c* putney,wandsworth,lambeth,southwark, merton,sutton,croydon,bromley,lewisham,greenwich,bexley, surrey,spelthorne,runnymede,surrey heath,woking,elmbridge,guildford,waverley,mole valley,epsom and ewell,reigate and banstead,tandridge,sussex,worthing,arun,chichester,horsham,crawley,mid sussex,adur,kent,dartford,gravesham,sevenoaks,tonbridge and malling,tunbridge wells,maidstone,swale,ashford,shepway,canterbury,dover,thanet,medway,sussex,sussex,hastings,rother,wealden,eastbourne,lewes,brighton & hove";
regions[i++]="Thames Valley &amp; Southern *s1c* tvs *s1c* buckinghamshire,bucks,chiltern,wycombe,aylesbury vale,milton keynes,berkshire,berkshire,reading,wokingham,bracknell forest,windsor and maidenhead,slough,oxfordshire,oxford,cherwell,oxfordshire,vale  white horse,oxfordshire   westminster,kensington and chelsea,hammersmith and fulham,islington,camden,brent,ealing,hounslow,richmond,kingston, harrow,hillingdon ealing,hounslow,hampshire,basingstoke and deane,hampshire,gosport,fareham,winchester,havant,hart,rushmoor,test valley,eastleigh,new forest,southampton,portsmouth,wight,salisbury christchurch,poole,bournemouth,devon,devon exeter,devon,mid devon,devon,torridge,devon,hams,teignbridge forest dean,pool,bournmouth";
regions[i++]="N. Ireland *s1c* ni *s1c* dun laoghaire-rathdown,fingal,dublin,wicklow,wexford,carlow,kildare,meath,strabane,derry ,limavady,coleraine,moyle,ballymoney,larne,omagh,magherafelt,cookstown,dungannon,fermanagh,ballymena,antrim,craigavon,armagh,newry and mourne,banbridge,down,ards,lisburn,carrickfergus,newton abbey,belfast ,down";
for (var j = 0; j < regions.length; j++) {
var findinregs=regions[j].split(" *s1c* ");
var intheplaces = findinregs[2];
if (intheplaces.indexOf(userCounty) !=-1) {
the_region = findinregs[0];
var dothisid = findinregs[1];
break;
} else {
the_region = 'Rep. of Ireland';
var dothisid = 'ri';
}
}
}
}