/* ---------------------------------------------------------------------------------------------------------------------------------------
OUTFIT STORE LOCATOR FUNCTIONS
 ------------------------------------------------------------------------------------------------------------------------------------------

Author:						Steve Fletcher
Created:					      03/08/2006
Version/s:						04/08/2006 [Beta]
							     04/08/2006 [Tested Pre-release Beta]
    						           07/08/2006 [1.0]
									   	18/04/2007 [2.0]
Last update:				    24/10/2007 by Adam Jefferson
								Modified code to remove unnecessary repetition.  Have tested and works fine, but have saved old version as 
								stores_old.js just in case.
 ------------------------------------------------------------------------------------------------------------------------------------------

OBJECTIVE
The store locator page allows users to select a town/city from a drop-down of locations where Outfit has stores.
 When the users selects from this list, the address/tel/fax values are passed to the page and displayed. Also,
 a list of stores available instore (at this location) is made visible, as is a map of the location and opening times for the store in question.
 
 Beneath this first part of the form, there is a drop-down which allows users to select brands they are interested in finding.
 When users select a brand, a list of locations where this brand is available is passed to a third drop-down. When users
select a location from this drop-down, it updates the first drop-down and address fields with the correct address
 and also updates both the brands available instore at this location and the location map / opening hours.

 ------------------------------------------------------------------------------------------------------------------------------------------
 FUNCTIONS: 
 ------------------------------------------------------------------------------------------------------------------------------------------
 1. passaddress(passedvalue)
 2. init()
 3. populate()
 ------------------------------------------------------------------------------------------------------------------------------------------

 ------------------------------------------------------------------------------------------------------------------------------------------
1. PASSADDRESS(PASSEDVALUE) 
 ------------------------------------------------------------------------------------------------------------------------------------------
 This function collects the selectedIndex.value from select name="locationoutfit"
 and then assigns stored address values to the text fields address1,2,3,4...
 
*Unfortunately, this method only allows 1 id at a time to be passed using getElementById()

It also uses the passed value to make the brands available instore [passedvalue=storename] display (visible)
 and makes all other brands available instore [passedvalue=storename(s)] display hidden.
 In addition, passedvalue is used to make the store [passedvalue=storename] map display (visible)
 and makes all other maps [passedvalue=storename/s] display hidden.
------------------------------------------------------------------------------------------------------------------------------------------*/

function passaddress(passedvalue) {
	
/* Initially hide all addresses */
     document.getElementById('aberdeen').style.display = "none";
	 document.getElementById('borehamwood').style.display = "none";
     document.getElementById('bradford').style.display = "none";     
	 document.getElementById('bristol_avon_meads').style.display = "none";
     document.getElementById('bristol_longwell_green').style.display = "none";
     document.getElementById('bromborough').style.display = "none";
     document.getElementById('chelmsford').style.display = "none";     
	 document.getElementById('cheshunt').style.display = "none";
     document.getElementById('chester').style.display = "none";
     document.getElementById('coventry').style.display = "none";
     document.getElementById('croydon').style.display = "none";
	 document.getElementById('farnborough').style.display = "none";
	 document.getElementById('great_yarmouth').style.display = "none";
     document.getElementById('greenford').style.display = "none";
     document.getElementById('greenwich').style.display = "none";
     document.getElementById('hull').style.display = "none";
     document.getElementById('inverness').style.display = "none";	 
	 document.getElementById('leamington_spa').style.display = "none";
	 document.getElementById('llandudno').style.display = "none";
	 document.getElementById('llanelli').style.display = "none";
     document.getElementById('llantrisant').style.display = "none";
	 document.getElementById('manchester').style.display = "none";
     document.getElementById('merthyr_tydfil').style.display = "none";
	 document.getElementById('middlesbrough').style.display = "none";
	 document.getElementById('middlesbrough_map').style.display = "none";
     document.getElementById('newbury').style.display = "none";     
	 document.getElementById('newcastle').style.display = "none";
	 document.getElementById('newport').style.display = "none";     
     document.getElementById('norwich').style.display = "none";
     document.getElementById('norwich').style.display = "none";
     document.getElementById('nottingham').style.display = "none";
     document.getElementById('peterborough').style.display = "none";
     document.getElementById('prescot').style.display = "none";
	 document.getElementById('preston').style.display = "none";
     document.getElementById('slough').style.display = "none";
     document.getElementById('southport').style.display = "none";
     document.getElementById('stoke_on_trent').style.display = "none";
	 document.getElementById('stratford_upon_avon').style.display = "none";
     document.getElementById('swansea_fforestfach').style.display = "none";
     document.getElementById('swansea_parc_tawe').style.display = "none";
     document.getElementById('teesside').style.display = "none";
	 document.getElementById('telford').style.display = "none";
	 document.getElementById('walsall').style.display = "none";
	 document.getElementById('washington').style.display = "none";
     document.getElementById('widnes').style.display = "none";
     document.getElementById('york').style.display = "none";
     document.getElementById('stoke_on_trent_map').style.display = "none";	 
     document.getElementById('aberdeen_map').style.display = "none";	 
     document.getElementById('borehamwood_map').style.display = "none";
     document.getElementById('united_kingdom_map').style.display = "none";
     document.getElementById('bradford_map').style.display = "none";     
	 document.getElementById('bristol_avon_meads_map').style.display = "none";
     document.getElementById('bristol_longwell_green_map').style.display = "none";
	 document.getElementById('bromborough_map').style.display = "none";
     document.getElementById('chelmsford_map').style.display = "none";  
     document.getElementById('cheshunt_map').style.display = "none";
	 document.getElementById('chester_map').style.display = "none";
     document.getElementById('coventry_map').style.display = "none";
     document.getElementById('croydon_map').style.display = "none";
	 document.getElementById('farnborough_map').style.display = "none";
	 document.getElementById('great_yarmouth_map').style.display = "none";
     document.getElementById('greenford_map').style.display = "none";
     document.getElementById('greenwich_map').style.display = "none";
     document.getElementById('hull_map').style.display = "none";
     document.getElementById('inverness_map').style.display = "none";
	 document.getElementById('leamington_spa_map').style.display = "none";
	 document.getElementById('leicester_map').style.display = "none";	 
	 document.getElementById('lincoln_map').style.display = "none";	
	 document.getElementById('llandudno_map').style.display = "none";
	 document.getElementById('llanelli_map').style.display = "none";
     document.getElementById('llantrisant_map').style.display = "none";
     document.getElementById('manchester_map').style.display = "none";
     document.getElementById('merthyr_tydfil_map').style.display = "none";
	 document.getElementById('middlesbrough_map').style.display = "none";
     document.getElementById('newbury_map').style.display = "none";     
	 document.getElementById('newcastle_map').style.display = "none";
	 document.getElementById('newport_map').style.display = "none";
     document.getElementById('norwich_map').style.display = "none";
	 document.getElementById('norwich').style.display = "none";
     document.getElementById('nottingham_map').style.display = "none";
     document.getElementById('peterborough_map').style.display = "none";
     document.getElementById('prescot_map').style.display = "none";
	 document.getElementById('preston_map').style.display = "none";
	  document.getElementById('slough_map').style.display = "none";
     document.getElementById('southport_map').style.display = "none";
	 document.getElementById('stratford_upon_avon_map').style.display = "none";
     document.getElementById('swansea_fforestfach_map').style.display = "none";
     document.getElementById('swansea_parc_tawe_map').style.display = "none";
     document.getElementById('teesside_map').style.display = "none";     
	 document.getElementById('telford_map').style.display = "none";
	 document.getElementById('walsall_map').style.display = "none";
	  document.getElementById('widnes_map').style.display = "none";
	 document.getElementById('washington_map').style.display = "none";
     document.getElementById('york_map').style.display = "none";
/* End of hide address section */

/* ABERDEEN */
  if (passedvalue == "Aberdeen") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Union Square Retail Park";
     document.getElementById('store_locator').address3.value = "Aberdeen";
     document.getElementById('store_locator').address4.value = "Scotland";
     document.getElementById('store_locator').postcode.value = "AB11 6PH";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01224 213 340";
     document.getElementById('store_locator').fax.value = "Fax: " +"01224 210 200";
 	/* show this address  */
     document.getElementById('aberdeen').style.display = "";
	 /* show this map  */
     document.getElementById('aberdeen_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/

/*BOREHAMWOOD*/
  if (passedvalue == "Borehamwood") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 4";
     document.getElementById('store_locator').address3.value = "Borehamwood Shopping Park";
     document.getElementById('store_locator').address4.value = "Theobald Street, Borehamwood";
     document.getElementById('store_locator').postcode.value = "WD6 4PR";
     document.getElementById('store_locator').telephone.value = "Tel: " +"020 8905 2475";
     document.getElementById('store_locator').fax.value = "Fax: " +"020 8953 9498";
 	/* show this address  */
     document.getElementById('borehamwood').style.display = "";
	 /* show this map  */
     document.getElementById('borehamwood_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
  /*BRADFORD*/
  else if (passedvalue == "Bradford") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 17/17A";
     document.getElementById('store_locator').address3.value = "Forster Square Retail Park";
     document.getElementById('store_locator').address4.value = "Bradford";
     document.getElementById('store_locator').postcode.value = "BD1 4RN";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01274 729 187";
     document.getElementById('store_locator').fax.value = "Fax: " +"01274 735 443";
 	/* show this address   */
     document.getElementById('bradford').style.display = "";
	 	 /* show this map   */
     document.getElementById('bradford_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*BRISTOL*/
  else if (passedvalue == "Bristol Avon Meads") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 4A";
     document.getElementById('store_locator').address3.value = "Avon Meads Shopping Park";
     document.getElementById('store_locator').address4.value = "Bristol";
     document.getElementById('store_locator').postcode.value = "BS2 0SP";
     document.getElementById('store_locator').telephone.value = "Tel: " +"0117 971 4821";
     document.getElementById('store_locator').fax.value = "Fax: " +"0117 971 5359";
 	/* show this address   */
     document.getElementById('bristol_avon_meads').style.display = "";
	 	 /* show this map   */
     document.getElementById('bristol_avon_meads_map').style.display = "";
  }
  
  /*__________________________________________________________________________________________________________________*/
    /*BRISTOL LONGWELL GREEN*/
  else if (passedvalue == "Bristol Longwell Green") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit E Gallagher Shopping Park";
     document.getElementById('store_locator').address3.value = "Aldermoor Way";
     document.getElementById('store_locator').address4.value = "Longwell Green, Bristol";
     document.getElementById('store_locator').postcode.value = "BS30 7DA";
     document.getElementById('store_locator').telephone.value = "Tel: 01179 678 698";
     document.getElementById('store_locator').fax.value = "Fax: 01179 678 699";
 	/* show this address   */
     document.getElementById('bristol_longwell_green').style.display = "";
	 /* show this map   */
     document.getElementById('bristol_longwell_green_map').style.display = "";
  }  
      /*__________________________________________________________________________________________________________________*/
    /*BROMBOROUGH*/
  else if (passedvalue == "Bromborough") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "The Croft Retail and Leisure Park";
     document.getElementById('store_locator').address3.value = "Welton Road";
     document.getElementById('store_locator').address4.value = "Bromborough";
     document.getElementById('store_locator').postcode.value = "CH62 3PN";
     document.getElementById('store_locator').telephone.value = "Tel: 01513 346 850";
     document.getElementById('store_locator').fax.value = "Fax: 01513 346 381";
 	/* show this address   */
     document.getElementById('bromborough').style.display = "";
	 /* show this map   */
     document.getElementById('bromborough_map').style.display = "";
  } 
  
  /*__________________________________________________________________________________________________________________*/
    /*CHELMSFORD*/
  else if (passedvalue == "Chelmsford") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Outfit";
     document.getElementById('store_locator').address3.value = "Chelmer Village Retail Park";
     document.getElementById('store_locator').address4.value = "Chelmsford, Essex";
     document.getElementById('store_locator').postcode.value = "CM2 6XE";
     document.getElementById('store_locator').telephone.value = "Tel: 01245 351 836";
     document.getElementById('store_locator').fax.value = "Fax: 01245 349 185";
 	/* show this address   */
     document.getElementById('chelmsford').style.display = "";
	 /* show this map   */
     document.getElementById('chelmsford_map').style.display = "";
  }
  
  /*__________________________________________________________________________________________________________________*/
    /*CHESHUNT*/
  else if (passedvalue == "Cheshunt") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 3 Brookfield Retail Park";
     document.getElementById('store_locator').address3.value = "Halfhide Lane";
     document.getElementById('store_locator').address4.value = "Cheshunt";
     document.getElementById('store_locator').postcode.value = "EN8 0QL";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01992 636 429";
     document.getElementById('store_locator').fax.value = "Fax: " +"01992 636 480";
 	/* show this address   */
     document.getElementById('cheshunt').style.display = "";
	 /* show this map   */
     document.getElementById('cheshunt_map').style.display = "";
  }
  
     /*__________________________________________________________________________________________________________________*/
    /*CHESTER*/
  else if (passedvalue == "Chester") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 5B, Chester Retail Park";
     document.getElementById('store_locator').address3.value = "Sealand Road";
     document.getElementById('store_locator').address4.value = "Chester";
     document.getElementById('store_locator').postcode.value = "CH1 4RY";
     document.getElementById('store_locator').telephone.value = "Tel: 01244 398590";
     document.getElementById('store_locator').fax.value = "Fax: 01244 381705";
 	/* show this address   */
     document.getElementById('chester').style.display = "";
	 /* show this map   */
     document.getElementById('chester_map').style.display = "";
  }
  
  /*__________________________________________________________________________________________________________________*/
    /*Middlesbrough*/
  else if (passedvalue == "Middlesbrough") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Cleveland Retail Park";
     document.getElementById('store_locator').address3.value = "Trunk Road";
     document.getElementById('store_locator').address4.value = "Middlesbrough";
     document.getElementById('store_locator').postcode.value = "TS6 6UB";
     document.getElementById('store_locator').telephone.value = "01642 462488";
     document.getElementById('store_locator').fax.value = "Fax: 01642 462702";
 	/* show this address   */
     document.getElementById('middlesbrough').style.display = "";
	 /* show this map   */
     document.getElementById('middlesbrough_map').style.display = "";
  }
  
    /*__________________________________________________________________________________________________________________*/
    /*COVENTRY*/
  else if (passedvalue == "Coventry") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Central Six Retail Park";
     document.getElementById('store_locator').address3.value = "Warwick Road";
     document.getElementById('store_locator').address4.value = "Coventry";
     document.getElementById('store_locator').postcode.value = "CV3 6TA";
     document.getElementById('store_locator').telephone.value = "Tel: " +"02476 225 857";
     document.getElementById('store_locator').fax.value = "Fax: " +"02476 225 875";
 	/* show this address   */
     document.getElementById('coventry').style.display = "";
	 /* show this map   */
     document.getElementById('coventry_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*CROYDON*/
  else if (passedvalue == "Croydon") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit D, 14 Daniell Way";
     document.getElementById('store_locator').address3.value = "Valley Park";
     document.getElementById('store_locator').address4.value = "Croydon";
     document.getElementById('store_locator').postcode.value = "CRO 4YJ";
     document.getElementById('store_locator').telephone.value = "Tel: " +"0208 760 0314";
     document.getElementById('store_locator').fax.value = "Fax: " +"0208 686 8121";
 	/* show this address   */
     document.getElementById('croydon').style.display = "";
	 /* show this map   */
     document.getElementById('croydon_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*FARNBOROUGH*/
  else if (passedvalue == "Farnborough") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Farnborough Gate Retail Park";
     document.getElementById('store_locator').address3.value = "Farnborough";
     document.getElementById('store_locator').address4.value = "";
     document.getElementById('store_locator').postcode.value = "GU14 8BL";
     document.getElementById('store_locator').telephone.value = "Tel: 01252 513 932";
     document.getElementById('store_locator').fax.value = "Fax: 01525 512 439";
 	/* show this address   */
     document.getElementById('farnborough').style.display = "";
	 /* show this map   */
     document.getElementById('farnborough_map').style.display = "";
  }
/* GREAT YARMOUTH */
  if (passedvalue == "Great Yarmouth") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Outfit, Unit C1";
     document.getElementById('store_locator').address3.value = "Gapton Retail Park";
     document.getElementById('store_locator').address4.value = "Great Yarmouth";
     document.getElementById('store_locator').postcode.value = "NR31 ONB";
     document.getElementById('store_locator').telephone.value = "Tel: 01493 650 713";
     document.getElementById('store_locator').fax.value = "";
 	/* show this address  */
     document.getElementById('great_yarmouth').style.display = "";
	 /* show this map  */
     document.getElementById('great_yarmouth_map').style.display = "";
  }
/*__________________________________________________________________________________________________________________*/
 
    /*GREENFORD*/
  else if (passedvalue == "Greenford") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 8";
     document.getElementById('store_locator').address3.value = "West Way Cross";
     document.getElementById('store_locator').address4.value = "Greenford, Middlesex";
     document.getElementById('store_locator').postcode.value = "UB6 0UW";
     document.getElementById('store_locator').telephone.value = "Tel: " +"0208 813 0829";
     document.getElementById('store_locator').fax.value = "Fax: " +"0208 813 1420";
 	/* show this address   */
     document.getElementById('greenford').style.display = "";
	 /* show this map   */
     document.getElementById('greenford_map').style.display = "";
  }
  /*__________________________________________________________________________________________________________________*/
    /*GREENWICH*/
  else if (passedvalue == "Greenwich") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 9-10 Greenwich Shopping Park";
     document.getElementById('store_locator').address3.value = "Bugsby's Way";
     document.getElementById('store_locator').address4.value = "Charlton";
     document.getElementById('store_locator').postcode.value = "SE7 7SR";
     document.getElementById('store_locator').telephone.value = "Tel: " +"0208 293 9562";
     document.getElementById('store_locator').fax.value = "Fax: " +"0208 269 2517";
 	/* show this address   */
     document.getElementById('greenwich').style.display = "";
	 /* show this map   */
     document.getElementById('greenwich_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*HULL*/
  else if (passedvalue == "Hull") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 2 B Kingston Street";
     document.getElementById('store_locator').address3.value = "Kingston Retail Park";
     document.getElementById('store_locator').address4.value = "Hull";
     document.getElementById('store_locator').postcode.value = "HU1 2TX";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01482 320 390";
     document.getElementById('store_locator').fax.value = "Fax: " +"01482 320 405";
 	/* show this address   */
     document.getElementById('hull').style.display = "";
	 /* show this map   */
     document.getElementById('hull_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/

/*INVERNESS*/
  else if (passedvalue == "Inverness") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 1C";
     document.getElementById('store_locator').address3.value = "Inverness Retail & Business Park";
     document.getElementById('store_locator').address4.value = "Eastfield Way, Inverness";
     document.getElementById('store_locator').postcode.value = "IV2 7GD";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01463 716 649";
     document.getElementById('store_locator').fax.value = "Fax: " +"01463 716 671";
 	/* show this address   */
     document.getElementById('inverness').style.display = "";
	 /* show this map   */
     document.getElementById('inverness_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/

  /* LEAMINGTON SPA */
  else if (passedvalue == "Leamington Spa") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "The Shires Retail Park";
     document.getElementById('store_locator').address3.value = "Leamington Spa";
     document.getElementById('store_locator').address4.value = "Warwickshire";
     document.getElementById('store_locator').postcode.value = "CV34 6RH";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01926 432 841";
     document.getElementById('store_locator').fax.value = "Fax: " +"01926 430 621";
 	/* show this address   */
     document.getElementById('leamington_spa').style.display = "";
	 /* show this map   */
     document.getElementById('leamington_spa_map').style.display = "";
  }
  
/*_________________________________________________________________________________________________________________*/

/*LEICESTER*/
  else if (passedvalue == "Leicester") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 3 Thurmaston Shopping Centre";
     document.getElementById('store_locator').address3.value = "Barkby Thorpe Lane";
     document.getElementById('store_locator').address4.value = "Thurmaston";
     document.getElementById('store_locator').postcode.value = "LE4 8GP";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01162 698114";
     document.getElementById('store_locator').fax.value = "Fax: " +"01162 698931";
 	/* show this address   */
     document.getElementById('leicester').style.display = "";
	 /* show this map   */
     document.getElementById('leicester_map').style.display = "";
  }
  
/*_________________________________________________________________________________________________________________*/

    /*LlANDUDNO*/
  else if (passedvalue == "Llandudno") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 6";
     document.getElementById('store_locator').address3.value = "Llandudno Retail Park";
     document.getElementById('store_locator').address4.value = "Llandudno, Conwy, Wales";
     document.getElementById('store_locator').postcode.value = "LL30 1PJ";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01492 873 552";
     document.getElementById('store_locator').fax.value = "Fax: " +"01492 872 936";
 	/* show this address   */
     document.getElementById('llandudno').style.display = "";
	 /* show this map   */
     document.getElementById('llandudno_map').style.display = "";
  }

/*__________________________________________________________________________________________________________________*/
    /*LlANELLI*/
  else if (passedvalue == "Llanelli") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 2B"; 
     document.getElementById('store_locator').address3.value = "Parc Trostre Retail Park"; 
     document.getElementById('store_locator').address4.value = "Llanelli, Dyfed"; 
     document.getElementById('store_locator').postcode.value = "SA14 9UY"; /*  */
     document.getElementById('store_locator').telephone.value = "Tel: " +"01554 774126"; /*  */
     document.getElementById('store_locator').fax.value = "Fax: " +"01554 741273"; /*  */
 	/* show this address   */
     document.getElementById('llanelli').style.display = "";
	 /* show this map   */
     document.getElementById('llanelli_map').style.display = "";
  }
 
    /*__________________________________________________________________________________________________________________*/
    /*LLANTRISANT*/
  else if (passedvalue == "Llantrisant") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 2 Talbot Green Retail Park";
     document.getElementById('store_locator').address3.value = "Llantrisant";
     document.getElementById('store_locator').address4.value = "Rhondda Cyon Taf, Wales";
     document.getElementById('store_locator').postcode.value = "CF72 8LW";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01443 228 926";
     document.getElementById('store_locator').fax.value = "Fax: " +"01443 239 181";
 	/* show this address   */
     document.getElementById('llantrisant').style.display = "";
	 /* show this map   */
     document.getElementById('llantrisant_map').style.display = "";
  }

/*__________________________________________________________________________________________________________________*/
	
    /*MANCHESTER*/
  else if (passedvalue == "Manchester") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Manchester Fort Shopping Park";
     document.getElementById('store_locator').address3.value = "Cheetham Hill Road";
     document.getElementById('store_locator').address4.value = "Manchester";
     document.getElementById('store_locator').postcode.value = "M8 8EP";
     document.getElementById('store_locator').telephone.value = "Tel: " +"0161 831 7579";
     document.getElementById('store_locator').fax.value = "Fax: " +"0161 832 9505";
 	/* show this address   */
     document.getElementById('manchester').style.display = "";
	 /* show this map   */
     document.getElementById('manchester_map').style.display = "";
  }

/*__________________________________________________________________________________________________________________*/
	
    /*MERTHYR TYDFIL*/
  else if (passedvalue == "Merthyr Tydfil") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 9C Cyfartha Retail Park";
     document.getElementById('store_locator').address3.value = "Swansea Road";
     document.getElementById('store_locator').address4.value = "Merthyr Tydfil, Wales";
     document.getElementById('store_locator').postcode.value = "CF48 1HY";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01685 383187";
     document.getElementById('store_locator').fax.value = "Fax: " +"01685 389365";
 	/* show this address   */
     document.getElementById('merthyr_tydfil').style.display = "";
	 /* show this map   */
     document.getElementById('merthyr_tydfil_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*NEWBURY*/
  else if (passedvalue == "Newbury") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 13 Newbury Retail Park";
     document.getElementById('store_locator').address3.value = "Off Pinchington Lane";
     document.getElementById('store_locator').address4.value = "Newbury, Berkshire";
     document.getElementById('store_locator').postcode.value = "RG14 7HU";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01635 47458";
     document.getElementById('store_locator').fax.value = "Fax: " +"01635 237853";
 	/* show this address   */
     document.getElementById('newbury').style.display = "";
	 /* show this map   */
     document.getElementById('newbury_map').style.display = "";
  }
    
/*__________________________________________________________________________________________________________________*/
    /*NEWCASTLE*/
  else if (passedvalue == "Newcastle") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit B1 Silverlink Retail Park";
     document.getElementById('store_locator').address3.value = "Wallsend";
     document.getElementById('store_locator').address4.value = "Tyne & Wear";
     document.getElementById('store_locator').postcode.value = "NE28 9ND";
     document.getElementById('store_locator').telephone.value = "Tel: " +"0191 263 2701";
     document.getElementById('store_locator').fax.value = "Fax: " +"0191 263 4808";
 	/* show this address   */
     document.getElementById('newcastle').style.display = "";
	 /* show this map   */
     document.getElementById('newcastle_map').style.display = "";
  }
 
/*__________________________________________________________________________________________________________________*/
    /*NEWPORT*/
  else if (passedvalue == "Newport") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 5, Newport Retail park";
     document.getElementById('store_locator').address3.value = "Spytty Road";
     document.getElementById('store_locator').address4.value = "Newport";
     document.getElementById('store_locator').postcode.value = "NP19 4QQ";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01633 282174";
     document.getElementById('store_locator').fax.value = "Fax: " +"01633 290692";
 	/* show this address   */
     document.getElementById('newport').style.display = "";
	 /* show this map   */
     document.getElementById('newport_map').style.display = "";
  }
  
/*__________________________________________________________________________________________________________________*/
    /*NORWICH*/
  else if (passedvalue == "Norwich") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 6B";
     document.getElementById('store_locator').address3.value = "Riverside Retail Park";
     document.getElementById('store_locator').address4.value = "Norwich";
     document.getElementById('store_locator').postcode.value = "NR1 1WR";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01603 611 947";
     document.getElementById('store_locator').fax.value = "Fax: " +"01603 612 917";
 	/* show this address   */
     document.getElementById('norwich').style.display = "";
	 /* show this map   */
     document.getElementById('norwich_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*NOTTINGHAM*/
  else if (passedvalue == "Nottingham") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit E Riverside Retail Park";
     document.getElementById('store_locator').address3.value = "Queens Drive";
     document.getElementById('store_locator').address4.value = "Nottingham";
     document.getElementById('store_locator').postcode.value = "NG2 1RU";
     document.getElementById('store_locator').telephone.value = "Tel: " +"0115 985 1234";
     document.getElementById('store_locator').fax.value = "Fax: " +"0115 985 0237";
 	/* show this address   */
     document.getElementById('nottingham').style.display = "";
	 /* show this map   */
     document.getElementById('nottingham_map').style.display = "";
  }
/*__________________________________________________________________________________________________________________*/	
 /*NOTTINGHAM*/
  else if (passedvalue == "Nottingham") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit E Riverside Retail Park";
     document.getElementById('store_locator').address3.value = "Queens Drive";
     document.getElementById('store_locator').address4.value = "Nottingham";
     document.getElementById('store_locator').postcode.value = "NG2 1RU";
     document.getElementById('store_locator').telephone.value = "Tel: " +"0115 985 1234";
     document.getElementById('store_locator').fax.value = "Fax: " +"0115 985 0237";
 	/* show this address   */
     document.getElementById('nottingham').style.display = "";
	 /* show this map   */
     document.getElementById('nottingham_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/

    /*PETERBOROUGH*/
  else if (passedvalue == "Peterborough") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 21";
     document.getElementById('store_locator').address3.value = "Serpentine Green";
     document.getElementById('store_locator').address4.value = "Peterborough";
     document.getElementById('store_locator').postcode.value = "PE7 8QZ";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01733 565 019";
     document.getElementById('store_locator').fax.value = "Fax: " +"01733 894 503";
 	/* show this address   */
     document.getElementById('peterborough').style.display = "";
	 /* show this map   */
     document.getElementById('peterborough_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*PRESCOT*/
  else if (passedvalue == "Prescot") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 3";
     document.getElementById('store_locator').address3.value = "Cables Retail Park, Steley Way";
     document.getElementById('store_locator').address4.value = "Prescot";
     document.getElementById('store_locator').postcode.value = "L34 5NQ";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01514 930 614";
     document.getElementById('store_locator').fax.value = "Fax: " +"01514 932 032";
 	/* show this address   */
     document.getElementById('prescot').style.display = "";
	 /* show this map   */
     document.getElementById('prescot_map').style.display = "";
  }
  
  /*__________________________________________________________________________________________________________________*/
    /*PRESTON*/
  else if (passedvalue == "Preston") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit D1 Deepdale Retail Park";
     document.getElementById('store_locator').address3.value = "Preston";
     document.getElementById('store_locator').address4.value = "Lancashire";
     document.getElementById('store_locator').postcode.value = "PR1 6AF";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01772 701 843";
     document.getElementById('store_locator').fax.value = "Fax: " +"01772 701 854";
 	/* show this address   */
     document.getElementById('preston').style.display = "";
	 /* show this map   */
     document.getElementById('preston_map').style.display = "";
  }
  
  /*__________________________________________________________________________________________________________________*/
    /*SLOUGH*/
  else if (passedvalue == "Slough") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Outfit";
     document.getElementById('store_locator').address3.value = "Bath Road Retail Park, Bath Road";
     document.getElementById('store_locator').address4.value = "Slough, Windsor and Maidenhead";
     document.getElementById('store_locator').postcode.value = "SL1 4DX";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01753 570 059";
     document.getElementById('store_locator').fax.value = "Fax: " +"01753 535 146";
 	/* show this address   */
     document.getElementById('slough').style.display = "";
	 /* show this map   */
     document.getElementById('slough_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*SOUTHPORT*/
  else if (passedvalue == "Southport") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 1 Central 12 Retail Park";
     document.getElementById('store_locator').address3.value = "Derby Road";
     document.getElementById('store_locator').address4.value = "Southport";
     document.getElementById('store_locator').postcode.value = "PR9 0TQ";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01704 534 411";
     document.getElementById('store_locator').fax.value = "Fax: " +"01704 540 253";
 	/* show this address   */
     document.getElementById('southport').style.display = "";
	 /* show this map   */
     document.getElementById('southport_map').style.display = "";
  }
/* STOKE ON TRENT */
  if (passedvalue == "Stoke On Trent") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Festival Retail Park";
     document.getElementById('store_locator').address3.value = "Stoke on Trent";
     document.getElementById('store_locator').address4.value = "Staffordshire";
     document.getElementById('store_locator').postcode.value = "ST1 5SD";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01782 209316";
     document.getElementById('store_locator').fax.value = "Fax: " +"01782 205812";
 	/* show this address  */
     document.getElementById('stoke_on_trent').style.display = "";
	 /* show this map  */
     document.getElementById('stoke_on_trent_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
	
	/* STRATFORD UPON AVON */
  else if (passedvalue == "Stratford Upon Avon") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Maybird Retail Park";
     document.getElementById('store_locator').address3.value = "Stratford Upon Avon";
     document.getElementById('store_locator').address4.value = "Warwickshire";
     document.getElementById('store_locator').postcode.value = "CV37 0HZ";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01789 209205";
     document.getElementById('store_locator').fax.value = "Fax: " +"01789 266625";
 	/* show this address   */
     document.getElementById('stratford_upon_avon').style.display = "";
	 /* show this map   */
     document.getElementById('stratford_upon_avon_map').style.display = "";
  }
       /*__________________________________________________________________________________________________________________*/
	
	
	
    /*SWANSEA_FFORESTFACH*/
  else if (passedvalue == "Swansea Fforestfach") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 15 Parc Fforestfach";
     document.getElementById('store_locator').address3.value = "Pontardulais Road";
     document.getElementById('store_locator').address4.value = "Swansea";
     document.getElementById('store_locator').postcode.value = "SA5 4BA";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01792 588 189";
     document.getElementById('store_locator').fax.value = "Fax: " +"01792 588 333";
 	/* show this address   */
     document.getElementById('swansea_fforestfach').style.display = "";
	 /* show this map   */
     document.getElementById('swansea_fforestfach_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*SWANSEA_PARC_TAWE*/
  else if (passedvalue == "Swansea Parc Tawe") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 3";
     document.getElementById('store_locator').address3.value = "Parc Tawe";
     document.getElementById('store_locator').address4.value = "Swansea";
     document.getElementById('store_locator').postcode.value = "SA1 2AA";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01792 461 499";
     document.getElementById('store_locator').fax.value = "Fax: " +"01792 461 506";
 	/* show this address   */
     document.getElementById('swansea_parc_tawe').style.display = "";
	 /* show this map   */
     document.getElementById('swansea_parc_tawe_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*TEESSIDE*/
  else if (passedvalue == "Teesside") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 13 Goodwood Square";
     document.getElementById('store_locator').address3.value = "Teesside Retail Park";
     document.getElementById('store_locator').address4.value = "Stockton-on-Tees";
     document.getElementById('store_locator').postcode.value = "TS17 7BW";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01642 671 824";
     document.getElementById('store_locator').fax.value = "Fax: " +"01642 677 930";
 	/* show this address   */
     document.getElementById('teesside').style.display = "";
	 /* show this map   */
     document.getElementById('teesside_map').style.display = "";
  }
    /*__________________________________________________________________________________________________________________*/
    /*TELFORD*/
  else if (passedvalue == "Telford") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 14 C-D Collier Way";
     document.getElementById('store_locator').address3.value = "Forge Retail Park";
     document.getElementById('store_locator').address4.value = "Telford, Shropshire";
     document.getElementById('store_locator').postcode.value = "TF3 4AJ";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01952 290 643";
     document.getElementById('store_locator').fax.value = "Fax: " +"01952 290 530";
 	/* show this address   */
     document.getElementById('telford').style.display = "";
	 /* show this map   */
     document.getElementById('telford_map').style.display = "";
  }

    /*__________________________________________________________________________________________________________________*/
    /*WALSALL*/
  else if (passedvalue == "Walsall") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Units 9 & 10";
     document.getElementById('store_locator').address3.value = "Crown Wharf Retail Park";
     document.getElementById('store_locator').address4.value = "Wolverhampton Street, Walsall";
     document.getElementById('store_locator').postcode.value = "WS2 8LL";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01922 724 210";
     document.getElementById('store_locator').fax.value = "Fax: " +"01922 643 643";
 	/* show this address   */
     document.getElementById('walsall').style.display = "";
	 /* show this map   */
     document.getElementById('walsall_map').style.display = "";
  }

    /*__________________________________________________________________________________________________________________*/
	
    /*WASHINGTON*/
  else if (passedvalue == "Washington") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "The Galleries";
     document.getElementById('store_locator').address3.value = "Washington";
     document.getElementById('store_locator').address4.value = "Tyne & Wear";
     document.getElementById('store_locator').postcode.value = "NE38 7RW";
     document.getElementById('store_locator').telephone.value = "Tel: "+"01914 193 732";
     document.getElementById('store_locator').fax.value = "Fax: "+"01914 168 423";
 	/* show this address   */
     document.getElementById('washington').style.display = "";
	 /* show this map   */
     document.getElementById('washington_map').style.display = "";
  }
  
  /*__________________________________________________________________________________________________________________*/
    /*WIDNES*/
  else if (passedvalue == "Widnes") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Widnes Shopping Park";
     document.getElementById('store_locator').address3.value = "Lugsdale Road";
     document.getElementById('store_locator').address4.value = "Widnes";
     document.getElementById('store_locator').postcode.value = "WA8 7TN";
     document.getElementById('store_locator').telephone.value = "Tel: "+"01514 203 959";
     document.getElementById('store_locator').fax.value = "Fax: "+"01514 228 092";
 	/* show this address   */
     document.getElementById('widnes').style.display = "";
	 /* show this map   */
     document.getElementById('widnes_map').style.display = "";
  }
   
  /*__________________________________________________________________________________________________________________*/
	
	
    /*YORK*/
  else if (passedvalue == "York") {
     document.getElementById('store_locator').address1.value = passedvalue;
     document.getElementById('store_locator').address2.value = "Unit 10-10a";
     document.getElementById('store_locator').address3.value = "Monks Cross";
     document.getElementById('store_locator').address4.value = "York";
     document.getElementById('store_locator').postcode.value = "YO32 9GX";
     document.getElementById('store_locator').telephone.value = "Tel: " +"01904 622 788";
     document.getElementById('store_locator').fax.value = "Fax: " +"01904 621 266";
 	/* show this address   */
     document.getElementById('york').style.display = "";
	 /* show this map   */
     document.getElementById('york_map').style.display = "";
  }    
  return false;
}


/* ------------------------------------------------------------------------------------------------------------------------------------------
2 & 3 - explanations below. 
 ------------------------------------------------------------------------------------------------------------------------------------------
First of all, create some arrays that hold the options. Options are stored in name/value pairs.

Please note that the number of the array corresponds with the value of the option: Burton has value 0 and if it's 
selected it writes store[0] into the second select box.
------------------------------------------------------------------------------------------------------------------------------------------*/

var store = new Array();	

/*Burton*/
store[0] = new Array(
'Available \in','',
'Aberdeen','Aberdeen',
'Borehamwood','Borehamwood',
'Bradford','Bradford',
'Bristol Avon Meads','Bristol Avon Meads',
'Bristol Longwell Green','Bristol Longwell Green',
'Bromborough','Bromborough',
'Chelmsford','Chelmsford',
'Cheshunt','Cheshunt',
'Chester','Chester',
'Coventry','Coventry',
'Croydon','Croydon',
'Farnborough','Farnborough',
'Great Yarmouth','Great Yarmouth',
'Greenford','Greenford',
'Greenwich','Greenwich',
'Hull','Hull',
'Inverness','Inverness',
'Leamington Spa','Leamington Spa',
'Leicester','Leicester',
'Llandudno','Llandudno',
'Llanelli','Llanelli',
'Llantrisant','Llantrisant',
'Manchester','Manchester',
'Merthyr Tydfil','Merthyr Tydfil',
'Middlesbrough','Middlesbrough',
'Newbury','Newbury',
'Newcastle','Newcastle',
'Newport','Newport',
'Norwich','Norwich',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Preston','Preston',
'Southport','Southport',
'Stoke On Trent','Stoke On Trent',
'Stratford Upon Avon','Stratford Upon Avon',
'Swansea Fforestfach','Swansea Fforestfach',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Teesside','Teesside',
'Telford','Telford',
'Washington','Washington',
'York','York'
);
/*Dorothy Perkins*/
store[1] = new Array(
'Available \in','',
'Aberdeen','Aberdeen',
'Borehamwood','Borehamwood',
'Bradford','Bradford',
'Bristol Avon Meads','Bristol Avon Meads',
'Bristol Longwell Green','Bristol Longwell Green',
'Bromborough','Bromborough',
'Cheshunt','Cheshunt',
'Chester','Chester',
'Coventry','Coventry',
'Croydon','Croydon',
'Farnborough','Farnborough',
'Great Yarmouth', 'Great Yarmouth',
'Greenford','Greenford',
'Greenwich','Greenwich',
'Hull','Hull',
'Inverness','Inverness',
'Leamington Spa','Leamington Spa',
'Leicester','Leicester',
'Llandudno','Llandudno',
'Llanelli','Llanelli',
'Llantrisant','Llantrisant',
'Manchester','Manchester',
'Merthyr Tydfil','Merthyr Tydfil',
'Newbury','Newbury',
'Newcastle','Newcastle',
'Newport','Newport',
'Norwich','Norwich',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Preston','Preston',
'Southport','Southport',
'Stoke On Trent','Stoke On Trent',
'Stratford Upon Avon','Stratford Upon Avon',
'Swansea Fforestfach','Swansea Fforestfach',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Teesside','Teesside',
'Telford','Telford',
'Washington','Washington',
'York','York'
);
/*Evans*/
store[2] = new Array(
'Available \in','',
'Aberdeen','Aberdeen',
'Borehamwood','Borehamwood',
'Bristol Avon Meads','Bristol Avon Meads',
'Bristol Longwell Green','Bristol Longwell Green',
'Bromborough','Bromborough',
'Cheshunt','Cheshunt',
'Chester','Chester',
'Coventry','Coventry',
'Croydon','Croydon',
'Farnborough','Farnborough',
'Great Yarmouth','Great Yarmouth',
'Greenford','Greenford',
'Greenwich','Greenwich',
'Leamington Spa','Leamington Spa',
'Leicester','Leicester',
'Llandudno','Llandudno',
'Llanelli','Llanelli',
'Manchester','Manchester',
'Merthyr Tydfil','Merthyr Tydfil',
'Newport','Newport',
'Norwich','Norwich',
'Nottingham','Nottingham',
'Preston','Preston',
'Stoke On Trent','Stoke On Trent',
'Stratford Upon Avon','Stratford Upon Avon',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Telford','Telford',
'Washington','Washington'
);
/*Miss Selfridge*/
store[3] = new Array(
'Available \in','',
'Aberdeen','Aberdeen',
'Borehamwood','Borehamwood',
'Bradford','Bradford',
'Bristol Avon Meads','Bristol Avon Meads',
'Bristol Longwell Green','Bristol Longwell Green',
'Bromborough','Bromborough',
'Cheshunt','Cheshunt',
'Coventry','Coventry',
'Croydon','Croydon',
'Farnborough','Farnborough',
'Great Yarmouth','Great Yarmouth',
'Greenford','Greenford',
'Greenwich','Greenwich',
'Hull','Hull',
'Inverness','Inverness',
'Leamington Spa','Leamington Spa',
'Leicester','Leicester',
'Llandudno','Llandudno',
'Llanelli','Llanelli',
'Llantrisant','Llantrisant',
'Manchester','Manchester',
'Merthyr Tydfil','Merthyr Tydfil',
'Newbury','Newbury',
'Newcastle','Newcastle',
'Newport','Newport',
'Norwich','Norwich',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Preston','Preston',
'Southport','Southport',
'Stoke On Trent','Stoke On Trent',
'Stratford Upon Avon','Stratford Upon Avon',
'Swansea Fforestfach','Swansea Fforestfach',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Teesside','Teesside',
'Telford','Telford',
'Washington','Washington'
);
/*Topshop*/
store[4] = new Array(
'Available \in','',
'Bradford','Bradford',
'Bristol','Bristol',
'Bromborough','Bromborough',
'Cheshunt','Cheshunt',
'Chester','Chester',
'Coventry','Coventry',
'Croydon','Croydon',
'Greenford','Greenford',
'Greenwich','Greenwich',
'Hull','Hull',
'Inverness','Inverness',
'Llantrisant','Llantrisant',
'Merthyr Tydfil','Merthyr Tydfil',
'Newcastle','Newcastle',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Preston','Preston',
'Southport','Southport',
'Swansea Fforestfach','Swansea Fforestfach',
'Teesside','Teesside',
'Telford','Telford',
'Washington','Washington'
);
/*Topman*/
store[5] = new Array(
'Available \in','',
'Coventry','Coventry',
'Cheshunt','Cheshunt',
'Greenwich','Greenwich',
'Inverness','Inverness',
'Llandudno','Llandudno',
'Llantrisant','Llantrisant',
'Newcastle','Newcastle',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Teesside','Teesside'
);
/*Wallis*/
store[6] = new Array(
'Available \in','',
'Aberdeen','Aberdeen',
'Borehamwood','Borehamwood',
'Bradford','Bradford',
'Bristol Avon Meads','Bristol Avon Meads',
'Bristol Longwell Green','Bristol Longwell Green',
'Bromborough','Bromborough',
'Cheshunt','Cheshunt',
'Chester','Chester',
'Coventry','Coventry',
'Croydon','Croydon',
'Farnborough','Farnborough',
'Great Yarmouth','Great Yarmouth',
'Greenford','Greenford',
'Greenwich','Greenwich',
'Hull','Hull',
'Inverness','Inverness',
'Leamington Spa','Leamington Spa',
'Leicester','Leicester',
'Llandudno','Llandudno',
'Llanelli','Llanelli',
'Llantrisant','Llantrisant',
'Manchester','Manchester',
'Merthyr Tydfil','Merthyr Tydfil',
'Newbury','Newbury',
'Newcastle','Newcastle',
'Newport','Newport',
'Norwich','Norwich',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Preston','Preston',
'Southport','Southport',
'Stoke On Trent','Stoke On Trent',
'Stratford Upon Avon','Stratford Upon Avon',
'Swansea Fforestfach','Swansea Fforestfach',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Teesside','Teesside',
'Telford','Telford',
'Washington','Washington',
'York','York'
);
/*Warehouse*/
store[7] = new Array(
'Available \in','',
'Aberdeen','Aberdeen',
'Borehamwood','Borehamwood',
'Bradford','Bradford',
'Bristol Avon Meads','Bristol Avon Meads',
'Bristol Longwell Green','Bristol Longwell Green',
'Bromborough','Bromborough',
'Cheshunt','Cheshunt',
'Chester','Chester',
'Coventry','Coventry',
'Croydon','Croydon',
'Farnborough','Farnborough',
'Great Yarmouth','Great Yarmouth',
'Greenford','Greenford',
'Greenwich','Greenwich',
'Hull','Hull',
'Inverness','Inverness',
'Leamington Spa','Leamington Spa',
'Leicester','Leicester',
'Llandudno','Llandudno',
'Llanelli','Llanelli',
'Llantrisant','Llantrisant',
'Manchester','Manchester',
'Merthyr Tydfil','Merthyr Tydfil',
'Newbury','Newbury',
'Newcastle','Newcastle',
'Newport','Newport',
'Norwich','Norwich',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Preston','Preston',
'Southport','Southport',
'Stoke On Trent','Stoke On Trent',
'Stratford Upon Avon','Stratford Upon Avon',
'Swansea Fforestfach','Swansea Fforestfach',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Teesside','Teesside',
'Telford','Telford',
'York','York'
);
/*Principles
store[8] = new Array(
'Available \in','',
'Cheshunt','Cheshunt',
'Coventry','Coventry',
'Croydon','Croydon',
'Greenford','Greenford',
'Hull','Hull',
'Llantrisant','Llantrisant',
'Newcastle','Newcastle',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Preston','Preston',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Teesside','Teesside',
'York','York'
);*/
/*Bhs Cafe*/
store[9] = new Array(
'Available \in','',
'Nottingham','Nottingham'
);
/*Playboy
store[10] = new Array(
'Available \in','',
'Borehamwood','Borehamwood',
'Bradford','Bradford',
'Cheshunt','Cheshunt',
'Coventry','Coventry',
'Croydon','Croydon',
'Greenford','Greenford',
'Inverness','Inverness',
'Leicester','Leicester',
'Llantrisant','Llantrisant',
'Merthyr Tydfil','Merthyr Tydfil',
'Newcastle','Newcastle',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Preston','Preston',
'Southport','Southport',
'Swansea Fforestfach','Swansea Fforestfach',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Teesside','Teesside',
'Telford','Telford',
'York','York'
);*/
/*Ben Sherman*/
store[11] = new Array(
'Available \in','',
'Bristol Avon Meads','Bristol Avon Meads',
'Bristol Longwell Green','Bristol Longwell Green',
'Cheshunt','Cheshunt',
'Coventry','Coventry',
'Croydon','Croydon',
'Greenford','Greenford',
'Hull','Hull',
'Leicester','Leicester',
'Merthyr Tydfil','Merthyr Tydfil',
'Newcastle','Newcastle',
'Norwich','Norwich',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Teesside','Teesside',
'Washington','Washington',
'York','York'

);
/*Roxy*/
store[12] = new Array(
'Available \in','',
'Cheshunt','Cheshunt',
'Llandudno','Llandudno',
'Llantrisant','Llantrisant',
'Merthyr Tydfil','Merthyr Tydfil',
'Nottingham','Nottingham',
'Swansea Fforestfach','Swansea Fforestfach',
'York','York'
);
/*Quiksilver*/
store[13] = new Array(
'Available \in','',
'Bristol Avon Meads','Bristol Avon Meads',
'Bristol Longwell Green','Bristol Longwell Green',
'Llandudno','Llandudno',
'Llantrisant','Llantrisant',
'Merthyr Tydfil','Merthyr Tydfil',
'Newbury','Newbury',
'Newcastle','Newcastle',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Swansea Fforestfach','Swansea Fforestfach',
'Swansea Parc Tawe','Swansea Parc Tawe',
'York','York'
);
/*Nickleson*/
store[14] = new Array(
'Available \in','',
'Coventry','Coventry',
'Nottingham','Nottingham',
'Peterborough','Peterborough'
);
/*tammy*/
store[15] = new Array(
'Available \in','',
'Aberdeen','Aberdeen',
'Borehamwood','Borehamwood',
'Bradford','Bradford',
'Bristol Avon Meads','Bristol Avon Meads',
'Cheshunt','Cheshunt',
'Coventry','Coventry',
'Croydon','Croydon',
'Greenford','Greenford',
'Merthyr Tydfil','Merthyr Tydfil',
'Newbury','Newbury',
'Newport','Newport',
'Norwich','Norwich',
'Nottingham','Nottingham',
'Peterborough','Peterborough',
'Stratford Upon Avon','Stratford Upon Avon',
'Swansea Parc Tawe','Swansea Parc Tawe',
'Telford','Telford',
'York','York'
);
/*Flipback*/
store[16] = new Array(
'Available \in','',
'Bradford','Bradford',
'Coventry','Coventry',
'Swansea Parc Tawe','Swansea Parc Tawe',
'York','York'

);

/* ---------------------------------------------------------------------------------------------------------------------------------------
2.  INIT() 
 ------------------------------------------------------------------------------------------------------------------------------------------
To access options in a select box, you use the following code: document.forms['testform'].testselect.options[i]
where i is the number of the option you want to access. 

Remember that the first option is options[0], the second one is options[1] etc.

Now if you want to delete the option, do: document.forms['testform'].testselect.options[i] = null;
By making it null, the option is completely removed from the list. Note that this also affects the numbering of the options. 
Suppose you remove option[1] from the example above, the old option[2] ('Third option') becomes option[1] etc.

To create a new option, do: document.forms['testform'].testselect.options[i] = new Option('new text','new value');
where new text is the text the user sees and new value is the VALUE of the new option, 
the bit that's sent to the server when the form is submitted. Of course the new option overwrites the old one.
To completely clear a select box, do: document.forms['testform'].testselect.options.length = 0;

OBJECT DETECTION
<OPTION>Your browser can't handle this script</OPTION> - This for object detection.
One big problem is that you cannot create or delete options in some browsers. Therefore we have to do some object detection to find out if the browser can handle everything.

This is more difficult than usual because the option object itself is supported by all browsers. 
What we want to know here is if we can add or remove option objects. 
The trick is to put one extra option in one select box. A script called onLoad tries to remove this option. If, after that, the option's still there the browser has failed its support detect.

This script performs the detect and gives a variable optionTest. If it's false the browser can't handle dynamic options and you should not execute the scripts.
If you select the place of the test option wisely, the text Your browser can't handle this script informs people with old browsers that they can't use this select box script, while users
with modern browsers never see the option since it's removed quickly.
 ------------------------------------------------------------------------------------------------------------------------------------------*/

function init()
{
	optionTest = true;
	lgth = document.forms[0].brand_locations.options.length - 1;
	// To delete the option
	document.forms[0].brand_locations.options[lgth] = null;
	if (document.forms[0].brand_locations.options[lgth]) optionTest = false;
}

/* ------------------------------------------------------------------------------------------------------------------------------------------
3.  POPULATE() 
------------------------------------------------------------------------------------------------------------------------------------------*/

function populate() {
	// First check if optionTest is false, if so the script is not executed.
	if (!optionTest) return;
	// Get the value of the selected option. This should be a number.
	var box = document.forms[0].outfit_brands;
	var number = box.options[box.selectedIndex].value;
	// If for some reason it doesn't exist, end the function. This gives you the freedom to put empty options in the select boxes (like Select Town/City).
	if (!number) return;
	// Get the correct option list store[number] and put it in list[]. Then access the second select box.
	var list = store[number];
	var box2 = document.forms[0].brand_locations;
	// Clear the second select box.
	box2.options.length = 0;
	// Finally, go through the correct list of name/value pairs and make each of them a new option in the second select box.
	for(i=0;i<list.length;i+=2)	{
		box2.options[i/2] = new Option(list[i],list[i+1]);
		}
	// Make the value of the top drop-down and the address fields null or they will retain user-selected value from previous selection
	document.forms[0].locationoutfit.value = 'town';
	document.forms[0].address1.value = '';
      document.forms[0].address2.value = '';
      document.forms[0].address3.value = '';
      document.forms[0].address4.value = '';
      document.forms[0].postcode.value = '';
      document.forms[0].telephone.value = '';
      document.forms[0].fax.value = '';
}




