	// alter the list of classifications to choose from based upon the other classifications chosen
	function update_classification_fields (formObject, marketSegmentFieldname, classificationFieldname, subClassificationFieldname, functionsFieldName, areaFieldname, addNullEntry) {

// classifications
var c = new Array ();
c[31] = "Account & Relationship Management";
c[30] = "Account & Relationship Management";
c[1] = "Accounting";
c[32] = "Accounts Officers/Clerks";
c[33] = "Accounts Payable";
c[34] = "Accounts Receivable/Credit Control";
c[35] = "Actuarial";
c[2] = "Administration & Office Support";
c[36] = "Administrative Assistants";
c[3] = "Advertising, Arts & Media";
c[37] = "Aerospace Engineering";
c[38] = "Aged & Disability Support";
c[39] = "Agency Account Management";
c[40] = "Agronomy & Farm Services";
c[41] = "Air Conditioning & Refrigeration";
c[42] = "Air Force";
c[43] = "Airlines";
c[44] = "Ambulance/Paramedics";
c[48] = "Analysis & Reporting";
c[47] = "Analysis & Reporting";
c[46] = "Analysis & Reporting";
c[45] = "Analysis & Reporting";
c[49] = "Analysis & Reporting";
c[50] = "Analysts";
c[51] = "Analysts";
c[52] = "Architects";
c[53] = "Architectural Drafting";
c[54] = "Architecture";
c[55] = "Army";
c[56] = "Art Direction";
c[57] = "Assembly & Process Work";
c[58] = "Assessment";
c[59] = "Assistant Accountants";
c[60] = "Audit - External";
c[61] = "Audit - Internal";
c[62] = "Automotive Engineering";
c[63] = "Automotive Trades";
c[64] = "Aviation Services";
c[65] = "Bakers & Pastry Chefs";
c[66] = "Banking & Finance Law";
c[4] = "Banking & Financial Services";
c[67] = "Banking - Business";
c[68] = "Banking - Corporate & Institutional";
c[69] = "Banking - Retail/Branch";
c[70] = "Bar & Beverage Staff";
c[71] = "Biological & Biomedical Sciences";
c[72] = "Biotechnology & Genetics";
c[73] = "Body Corporate & Facilities Management";
c[74] = "Bookkeeping & Small Practice Accounting";
c[75] = "Brand Management";
c[76] = "Brokerage";
c[77] = "Building Services Engineering";
c[78] = "Building Trades";
c[79] = "Business Services & Corporate Advisory";
c[80] = "Business/Systems Analysts";
c[81] = "Butchers";
c[82] = "Buying";
c[5] = "Call Centre & Customer Service";
c[83] = "Carpentry & Cabinet Making";
c[84] = "Chefs/Cooks";
c[85] = "Chemical Engineering";
c[86] = "Chemistry & Physics";
c[87] = "Child Welfare, Youth & Family Services";
c[88] = "Childcare & Outside School Hours Care";
c[89] = "Chiropractic & Osteopathic";
c[90] = "Civil/Structural Engineering";
c[91] = "Claims";
c[92] = "Cleaning Services";
c[93] = "Client & Sales Administration";
c[94] = "Client Services";
c[95] = "Clinical/Medical Research";
c[96] = "Coaching & Instruction";
c[97] = "Collections";
c[98] = "Commercial Sales & Leasing";
c[99] = "Community Development";
c[6] = "Community Services & Development";
c[100] = "Company Secretaries";
c[101] = "Compliance & Risk";
c[102] = "Compliance & Risk";
c[103] = "Computer Operators";
c[104] = "Conservation, Parks & Wildlife";
c[7] = "Construction";
c[105] = "Construction Law";
c[106] = "Consultants";
c[107] = "Consulting & Generalist HR";
c[8] = "Consulting & Strategy";
c[108] = "Contracts Administration";
c[109] = "Contracts Management";
c[110] = "Corporate & Commercial Law";
c[111] = "Corporate Development";
c[112] = "Corporate Finance & Investment Banking";
c[113] = "Cost Accounting";
c[114] = "Courier, Delivery & Postal Services";
c[115] = "Credit";
c[116] = "Criminal & Civil Law";
c[117] = "Customer Service - Call Centre";
c[118] = "Customer Service - Customer Facing";
c[119] = "Data Entry & Word Processing";
c[120] = "Database Development & Administration";
c[121] = "Dental";
c[9] = "Design & Architecture";
c[122] = "Developers/Programmers";
c[123] = "Dieticians";
c[124] = "Digital & Search Marketing";
c[125] = "Direct Marketing & CRM";
c[126] = "Editing & Publishing";
c[10] = "Education & Training";
c[127] = "Electrical/Electronic Engineering";
c[128] = "Electricians";
c[129] = "Emergency Services";
c[130] = "Employment Services";
c[11] = "Engineering";
c[131] = "Engineering - Hardware";
c[132] = "Engineering - Network";
c[133] = "Engineering - Software";
c[134] = "Engineering Drafting";
c[135] = "Environment & Planning Law";
c[136] = "Environment & Sustainability Consulting";
c[137] = "Environmental Engineering";
c[138] = "Environmental Services";
c[139] = "Environmental, Earth & Geosciences";
c[140] = "Estimating";
c[142] = "Event Management";
c[141] = "Event Management";
c[143] = "Family Law";
c[144] = "Farm Labour";
c[145] = "Farm Management";
c[12] = "Farming, Animals & Conservation";
c[146] = "Fashion & Textile Design";
c[147] = "Field Engineering";
c[148] = "Financial Accounting & Reporting";
c[149] = "Financial Managers & Controllers";
c[150] = "Financial Planning";
c[151] = "Fishing & Aquaculture";
c[152] = "Fitness & Personal Training";
c[153] = "Fitters, Turners & Machinists";
c[154] = "Fleet Management";
c[155] = "Floristry";
c[156] = "Food Technology & Safety";
c[157] = "Forensic Accounting & Investigation";
c[158] = "Foreperson/Supervisors";
c[159] = "Freight/Cargo Forwarding";
c[160] = "Front Office & Guest Services";
c[161] = "Fund Administration";
c[162] = "Fundraising";
c[163] = "Funds Management";
c[164] = "Gaming";
c[165] = "Gardening & Landscaping";
c[166] = "General Practitioners";
c[167] = "Generalists - In-house";
c[168] = "Generalists - Law Firm";
c[169] = "Government";
c[13] = "Government & Defence";
c[170] = "Government - Federal";
c[171] = "Government - Local";
c[172] = "Government - State";
c[173] = "Graphic Design";
c[174] = "Hair & Beauty Services";
c[176] = "Health, Safety & Environment";
c[175] = "Health, Safety & Environment";
c[14] = "Healthcare & Medical";
c[177] = "Help Desk & IT Support";
c[178] = "Horticulture";
c[15] = "Hospitality & Tourism";
c[179] = "Housekeeping";
c[180] = "Housing & Homelessness Services";
c[16] = "Human Resources & Recruitment";
c[181] = "Illustration & Animation";
c[182] = "Import/Export & Customs";
c[183] = "Indigenous & Multicultural Services";
c[184] = "Industrial & Employee Relations";
c[185] = "Industrial Design";
c[186] = "Industrial Engineering";
c[187] = "Industrial Relations & Employment Law";
c[17] = "Information & Communication Technology";
c[188] = "Insolvency & Corporate Recovery";
c[18] = "Insurance & Superannuation";
c[189] = "Insurance & Superannuation Law";
c[190] = "Intellectual Property Law";
c[191] = "Interior Design";
c[192] = "Internal Communications";
c[193] = "Inventory & Fixed Assets";
c[194] = "Journalism & Writing";
c[195] = "Kitchen & Sandwich Hands";
c[196] = "Laboratory & Technical Services";
c[197] = "Labourers";
c[198] = "Landscape Architecture";
c[199] = "Law Clerks & Paralegals";
c[19] = "Legal";
c[200] = "Legal Practice Management";
c[201] = "Legal Secretaries";
c[202] = "Library Services & Information Management";
c[203] = "Litigation & Dispute Resolution";
c[204] = "Local Government";
c[205] = "Locksmiths";
c[206] = "Machine Operators";
c[207] = "Maintenance";
c[208] = "Maintenance & Handyperson Services";
c[213] = "Management";
c[215] = "Management";
c[214] = "Management";
c[217] = "Management";
c[218] = "Management";
c[219] = "Management";
c[220] = "Management";
c[221] = "Management";
c[222] = "Management";
c[223] = "Management";
c[216] = "Management";
c[212] = "Management";
c[211] = "Management";
c[210] = "Management";
c[209] = "Management";
c[224] = "Management & Change Consulting";
c[225] = "Management & Support";
c[226] = "Management - Agency";
c[227] = "Management - Area/Multi-site";
c[228] = "Management - Department/Assistant";
c[229] = "Management - Internal";
c[230] = "Management - Schools";
c[231] = "Management - Store";
c[232] = "Management - Universities";
c[233] = "Management - Vocational";
c[234] = "Management Accounting & Budgeting";
c[235] = "Market Research & Analysis";
c[20] = "Marketing & Communications";
c[236] = "Marketing Assistants/Coordinators";
c[237] = "Marketing Communications";
c[238] = "Materials Handling Engineering";
c[239] = "Materials Sciences";
c[240] = "Mathematics, Statistics & Information Sciences";
c[241] = "Mechanical Engineering";
c[242] = "Media Strategy, Planning & Buying";
c[243] = "Medical Administration";
c[244] = "Medical Imaging";
c[245] = "Medical Specialists";
c[246] = "Merchandisers";
c[247] = "Mining - Drill & Blast";
c[248] = "Mining - Engineering & Maintenance";
c[249] = "Mining - Exploration & Geoscience";
c[250] = "Mining - Operations";
c[251] = "Mining - Processing";
c[252] = "Modelling & Simulation";
c[253] = "Mortgages";
c[254] = "Nannies & Babysitters";
c[255] = "Natural Resources & Water";
c[256] = "Natural Therapies & Alternative Medicine";
c[257] = "Navy";
c[258] = "Networks & Systems Administration";
c[259] = "New Business Development";
c[260] = "Nursing - A&E, Critical Care & ICU";
c[261] = "Nursing - Aged Care";
c[262] = "Nursing - Community, Maternal & Child Health";
c[263] = "Nursing - Educators & Facilitators";
c[264] = "Nursing - General Medical & Surgical";
c[265] = "Nursing - High Acuity";
c[266] = "Nursing - Management";
c[267] = "Nursing - Midwifery, Neo-Natal, SCN & NICU";
c[268] = "Nursing - Paediatric & PICU";
c[269] = "Nursing - Psych, Forensic & Correctional Health";
c[270] = "Nursing - Theatre & Recovery";
c[271] = "Occupational Health & Safety";
c[272] = "Office Management";
c[273] = "Oil & Gas - Drilling";
c[274] = "Oil & Gas - Engineering & Maintenance";
c[275] = "Oil & Gas - Exploration & Geoscience";
c[276] = "Oil & Gas - Operations";
c[277] = "Oil & Gas - Production & Refinement";
c[278] = "Optical";
c[279] = "Organisational Development";
c[296] = "Other";
c[295] = "Other";
c[294] = "Other";
c[293] = "Other";
c[292] = "Other";
c[291] = "Other";
c[290] = "Other";
c[297] = "Other";
c[299] = "Other";
c[301] = "Other";
c[302] = "Other";
c[303] = "Other";
c[298] = "Other";
c[304] = "Other";
c[305] = "Other";
c[306] = "Other";
c[307] = "Other";
c[289] = "Other";
c[288] = "Other";
c[300] = "Other";
c[280] = "Other";
c[281] = "Other";
c[282] = "Other";
c[283] = "Other";
c[284] = "Other";
c[285] = "Other";
c[286] = "Other";
c[287] = "Other";
c[308] = "PA, EA & Secretarial";
c[309] = "Painters & Sign Writers";
c[310] = "Pathology";
c[311] = "Pattern Makers & Garment Technicians";
c[312] = "Payroll";
c[313] = "Performing Arts";
c[314] = "Personal Injury Law";
c[315] = "Pharmaceuticals & Medical Devices";
c[316] = "Pharmacy";
c[317] = "Photography";
c[318] = "Physiotherapy, OT & Rehabilitation";
c[319] = "Pickers & Packers";
c[320] = "Planning";
c[321] = "Planning & Scheduling";
c[322] = "Plant & Machinery Operators";
c[323] = "Plumbers";
c[324] = "Police & Corrections";
c[325] = "Policy";
c[326] = "Policy, Planning & Regulation";
c[327] = "Power Generation & Distribution";
c[328] = "Printing & Publishing Services";
c[329] = "Process Engineering";
c[330] = "Procurement & Inventory";
c[21] = "Procurement, Manufacturing & Transport";
c[331] = "Product Management & Development";
c[332] = "Product Management & Development";
c[333] = "Production, Planning & Scheduling";
c[334] = "Programme & Project Management";
c[335] = "Programming & Production";
c[336] = "Project Engineering";
c[338] = "Project Management";
c[337] = "Project Management";
c[339] = "Promotions";
c[340] = "Property Law";
c[341] = "Psychology, Counselling & Social Work";
c[342] = "Public Relations & Corporate Affairs";
c[343] = "Public Transport & Taxi Services";
c[344] = "Quality Assurance & Control";
c[345] = "Quality Assurance & Control";
c[346] = "Quality Assurance & Control";
c[347] = "Rail & Maritime Transport";
c[22] = "Real Estate & Property";
c[348] = "Receptionists";
c[349] = "Records Management & Document Control";
c[350] = "Recruitment - Agency";
c[351] = "Recruitment - Internal";
c[352] = "Regional Council";
c[353] = "Remuneration & Benefits";
c[354] = "Research & Fellowships";
c[355] = "Reservations";
c[356] = "Residential Leasing & Property Management";
c[357] = "Residential Sales";
c[23] = "Resources & Energy";
c[24] = "Retail & Consumer Products";
c[358] = "Retail & Property Development";
c[359] = "Retail Assistants";
c[360] = "Risk Consulting";
c[361] = "Road Transport";
c[25] = "Sales";
c[362] = "Sales";
c[363] = "Sales - Inbound";
c[364] = "Sales - Outbound";
c[365] = "Sales - Pre & Post";
c[366] = "Sales Coordinators";
c[367] = "Sales Representatives/Consultants";
c[26] = "Science & Technology";
c[368] = "Security";
c[369] = "Security Services";
c[27] = "Self Employment";
c[370] = "Self Employment";
c[371] = "Settlements";
c[372] = "Speech Therapy";
c[28] = "Sport & Recreation";
c[373] = "Stockbroking & Trading";
c[374] = "Strategy & Planning";
c[375] = "Strategy & Planning";
c[376] = "Student Services";
c[377] = "Superannuation";
c[378] = "Supervisors";
c[379] = "Supervisors/Team Leaders";
c[381] = "Surveying";
c[380] = "Surveying";
c[382] = "Systems Accounting & IT Audit";
c[383] = "Systems Engineering";
c[384] = "Tailors & Dressmakers";
c[385] = "Tax Law";
c[386] = "Taxation";
c[387] = "Teaching - Early Childhood";
c[388] = "Teaching - Primary";
c[389] = "Teaching - Secondary";
c[390] = "Teaching - Tertiary";
c[391] = "Teaching - Vocational";
c[392] = "Teaching Aides & Special Needs";
c[393] = "Team Leaders";
c[394] = "Team Leaders/Supervisors";
c[395] = "Technical Writing";
c[396] = "Technicians";
c[397] = "Telecommunications";
c[398] = "Testing & Quality Assurance";
c[399] = "Tour Guides";
c[400] = "Trade Marketing";
c[29] = "Trades & Services";
c[401] = "Training & Development";
c[402] = "Travel Agents/Consultants";
c[403] = "Treasury";
c[404] = "Treasury";
c[405] = "Tutoring";
c[406] = "Underwriting";
c[407] = "Urban Design & Planning";
c[408] = "Valuation";
c[409] = "Veterinary Services & Animal Welfare";
c[410] = "Volunteer Coordination & Support";
c[411] = "Waiting Staff";
c[412] = "Warehousing, Storage & Distribution";
c[413] = "Water & Waste Engineering";
c[414] = "Web & Interaction Design";
c[415] = "Web Development & Production";
c[416] = "Welders & Boilermakers";
c[417] = "Winery & Viticulture";
c[418] = "Workers\' Compensation";
c[419] = "Workplace Training & Assessment";

// a list of links between classifications,  sub-classifications and specialisations/skills
var ln = new Array ();
ln[1] = [32,33,34,47,59,60,61,74,79,100,101,113,148,149,157,188,193,213,234,302,312,374,382,386,403];
ln[2] = [36,93,108,119,272,299,308,348,349];
ln[3] = [39,56,126,142,194,223,242,285,313,317,335,339];
ln[4] = [30,46,67,68,69,94,102,112,115,150,163,211,253,300,371,373,404];
ln[5] = [97,117,118,225,306,363,364,379];
ln[6] = [38,87,99,130,162,180,183,212,303,410];
ln[7] = [109,140,158,176,217,304,321,322,338,344,381];
ln[8] = [50,111,136,224,294,325,375];
ln[9] = [53,54,146,173,181,185,191,198,281,407,414];
ln[10] = [88,202,230,232,233,305,354,376,387,388,389,390,391,392,405,419];
ln[11] = [37,62,77,85,90,127,134,137,147,186,207,214,238,241,292,329,336,337,378,383,413];
ln[12] = [40,104,144,145,151,178,296,409,417];
ln[13] = [42,55,129,169,170,171,172,204,257,284,324,326,352];
ln[14] = [44,89,95,121,123,138,166,221,243,244,245,256,260,261,262,263,264,265,266,267,268,269,270,278,283,310,315,316,318,341,362,372];
ln[15] = [43,70,84,160,164,179,195,218,289,355,399,402,411];
ln[16] = [107,184,226,229,271,279,286,350,351,353,401];
ln[17] = [52,80,103,106,120,122,131,132,133,177,209,258,282,331,334,365,368,393,395,397,398,415];
ln[18] = [35,58,76,91,161,222,280,360,377,406,418];
ln[19] = [66,105,110,116,135,143,167,168,187,189,190,199,200,201,203,301,314,340,385];
ln[20] = [75,124,125,141,192,215,235,236,237,291,332,342,400];
ln[21] = [49,57,64,114,154,159,182,206,216,307,311,319,330,333,343,345,347,361,394,412];
ln[22] = [51,73,98,290,356,357,358,408];
ln[23] = [48,175,219,247,248,249,250,251,255,273,274,275,276,277,293,327,380];
ln[24] = [82,227,228,231,246,288,320,359];
ln[25] = [31,45,220,259,287,366,367];
ln[26] = [71,72,86,139,156,196,239,240,252,297,346];
ln[27] = [370];
ln[28] = [96,152,210,295];
ln[29] = [41,63,65,78,81,83,92,128,153,155,165,174,197,205,208,254,298,309,323,328,369,384,396,416];

// the list of classifications that are allowed based upon the market segment field name
var ln2 = new Array ();
ln2[2] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29];
ln2[1] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29];
ln2[5] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29];
ln2[3] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29];
ln2[4] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29];

// market segments
var marketSegments = new Array ();
marketSegments[1] = "Main";
marketSegments[2] = "Exec";
marketSegments[3] = "Campus";
marketSegments[4] = "Main Exec";
marketSegments[5] = "Main Campus";

		// find the marketSegment object
		eval ("marketSegmentObject = formObject." + marketSegmentFieldname + ";");
		// find the classification object
		eval ("classificationObject = formObject." + classificationFieldname + ";");
		// find the sub-classification object
		eval ("subClassificationObject = formObject." + subClassificationFieldname + ";");
		// find the specialisation object
		eval ("functionObject = formObject." + functionsFieldName + ";");
		// find the area object
		eval ("areaObject = formObject." + areaFieldname + ";");

		// find out the currently selected marketSegmentId
		marketSegmentId = marketSegmentObject.options[marketSegmentObject.selectedIndex].value;
		// find out the currently selected classificationId
		classificationId = classificationObject.options[classificationObject.selectedIndex].value;
		// find out the currently selected subClassificationId
		subClassificationId = subClassificationObject.options[subClassificationObject.selectedIndex].value;

		// check to see if the classificationId is allowed based on the marketSegmentId
		classificationValid = false;
		if (typeof(ln2[marketSegmentId]) != 'undefined') {
			for (count = 0; count < ln2[marketSegmentId].length; count++) {
				if (ln2[marketSegmentId][count] == classificationId)
					classificationValid = true;
			}
		}
		// if the category doesn't belong to this market segment then
		if (!classificationValid)
			classificationId = "";

		// check to see if the subClassificationId is allowed based on the classifiationId
		subClassificationValid = false;
		if (typeof(ln[classificationId]) != 'undefined') {
			for (count = 0; count < ln[classificationId].length; count++) {
				if (ln[classificationId][count] == subClassificationId)
					subClassificationValid = true;
			}
		}
		// if the sub-category doesn't belong to this category then
		if (!subClassificationValid)
			subClassificationId = "";

		// empty the list of classifications
		classificationObject.length = 0;
		// add the "select -" entry to the list
		if (addNullEntry) {
			var value = "Select -";
			var index = "";
			var newOption = new Option (value, index, false, false);
			var currentLength = classificationObject.length;
			classificationObject.options[currentLength] = newOption;
		}
		classificationObject.selectedIndex = 0;
		// re-populate the classification list if necessary
		if (typeof(ln2[marketSegmentId]) != 'undefined') {
			for (count = 0; count < ln2[marketSegmentId].length; count++) {
				var value = c[ln2[marketSegmentId][count]];
				var index = ln2[marketSegmentId][count];
				var newOption = new Option (value, index, false, false);
				var currentLength = classificationObject.length;
				classificationObject.options[currentLength] = newOption;
				if (classificationId == index) {
					classificationObject.selectedIndex = count;
					if (addNullEntry)
						classificationObject.selectedIndex += 1;
				}
			}
		}
		if (classificationObject.length == 1)
			disable_input (classificationFieldname);
		else
			enable_input (classificationFieldname);

		// empty the list of sub-classifications
		subClassificationObject.length = 0;
		// add the "select -" entry to the list
		if (addNullEntry) {
			var value = "Select -";
			var index = "";
			var newOption = new Option (value, index, false, false);
			var currentLength = subClassificationObject.length;
			subClassificationObject.options[currentLength] = newOption;
		}
		subClassificationObject.selectedIndex = 0;
		// re-populate the sub-classification list if necessary
		if (typeof(ln[classificationId]) != 'undefined') {
			for (count = 0; count < ln[classificationId].length; count++) {
				var value = c[ln[classificationId][count]];
				var index = ln[classificationId][count];
				var newOption = new Option (value, index, false, false);
				var currentLength = subClassificationObject.length;
				subClassificationObject.options[currentLength] = newOption;
				if (subClassificationId == index) {
					subClassificationObject.selectedIndex = count;
					if (addNullEntry)
						subClassificationObject.selectedIndex += 1;
				}
			}
		}
		if (subClassificationObject.length == 1)
			disable_input (subClassificationFieldname);
		else
			enable_input (subClassificationFieldname);

		if ((marketSegmentId == "2") || (marketSegmentId == "4"))
			enable_input (functionsFieldName);
		else {
			disable_input (functionsFieldName);
			functionObject.selectedIndex = 0;
		}

		if ((marketSegmentId == "1") || (marketSegmentId == "3") || (marketSegmentId == "5"))
			enable_input (areaFieldname);
		else {
			disable_input (areaFieldname);
			areaObject.selectedIndex = 0;
		}
	}




	// alter the list of areas to choose from based upon the location chosen
	function update_location_fields (formObject, marketSegmentFieldname, locationFieldname, areaFieldname, addNullEntry) {

// locations
var locations = new Array ();
locations[1] = "ACT";
locations[2] = "Adelaide";
locations[3] = "Adelaide Hills & Barossa";
locations[4] = "Albany & Great Southern";
locations[5] = "Albury Wodonga & Murray";
locations[6] = "Alice Springs & Central Australia";
locations[7] = "Americas";
locations[8] = "Asia Pacific";
locations[9] = "Auckland";
locations[10] = "Bairnsdale & Gippsland";
locations[11] = "Ballarat & Central Highlands";
locations[12] = "Bay of Plenty";
locations[13] = "Bendigo, Goldfields & Macedon Ranges";
locations[14] = "Blue Mountains & Central West";
locations[15] = "Brisbane";
locations[16] = "Broome & Kimberley";
locations[17] = "Bunbury & South West";
locations[18] = "Bundaberg & Wide Bay Burnett";
locations[19] = "Cairns & Far North";
locations[20] = "Canterbury";
locations[21] = "Central & South East";
locations[22] = "Coffs Harbour & North Coast";
locations[23] = "Coober Pedy & Outback SA";
locations[24] = "Darwin";
locations[25] = "Devonport & North West";
locations[26] = "Dubbo & Central NSW";
locations[27] = "Europe & Russia";
locations[28] = "Far West & North Central NSW";
locations[29] = "Fleurieu Peninsula & Kangaroo Island";
locations[30] = "Geelong & Great Ocean Road";
locations[31] = "Geraldton, Gascoyne & Midwest";
locations[32] = "Gisborne";
locations[33] = "Gladstone & Central QLD";
locations[34] = "Gold Coast";
locations[35] = "Gosford & Central Coast";
locations[36] = "Goulburn & Southern Tablelands";
locations[37] = "Hawkes Bay";
locations[38] = "Hervey Bay & Fraser Coast";
locations[39] = "Hobart";
locations[40] = "Horsham & Grampians";
locations[41] = "Kalgoorlie, Goldfields & Esperance";
locations[42] = "Katherine & Northern Australia";
locations[43] = "Launceston & North East";
locations[44] = "Lismore & Far North Coast";
locations[45] = "London";
locations[46] = "Mackay & Coalfields";
locations[47] = "Manawatu";
locations[48] = "Mandurah & Peel";
locations[49] = "Marlborough";
locations[50] = "Melbourne";
locations[51] = "Middle East & Africa";
locations[52] = "Mildura & Murray";
locations[53] = "Mornington Peninsula & Bass Coast";
locations[54] = "Mt Gambier & Limestone Coast";
locations[55] = "Mt Isa & Western QLD";
locations[56] = "Newcastle, Maitland & Hunter";
locations[57] = "Northam & Wheatbelt";
locations[58] = "Northland";
locations[59] = "Otago";
locations[60] = "Perth";
locations[61] = "Port Hedland & Pilbara";
locations[62] = "Port Macquarie & Mid North Coast";
locations[63] = "Rest of the UK";
locations[64] = "Richmond & Hawkesbury";
locations[65] = "Riverland & Murray Mallee";
locations[66] = "Rockhampton & Capricorn Coast";
locations[67] = "Shepparton & Goulburn Valley";
locations[68] = "Somerset & Lockyer";
locations[69] = "Southland";
locations[70] = "Sunshine Coast";
locations[71] = "Sydney";
locations[72] = "Tamworth & North West NSW";
locations[73] = "Taranaki";
locations[74] = "Tasman";
locations[75] = "Toowoomba & Darling Downs";
locations[76] = "Townsville & Northern QLD";
locations[77] = "Traralgon & La Trobe Valley";
locations[78] = "Tumut, Southern Highlands & Snowy";
locations[79] = "Wagga Wagga & Riverina";
locations[80] = "Waikato";
locations[81] = "Wellington";
locations[82] = "West Coast";
locations[83] = "Whyalla & Eyre Peninsula";
locations[84] = "Wollongong, Illawarra & South Coast";
locations[85] = "Yarra Valley & High Country";
locations[86] = "York Peninsula & Clare Valley";
locations[87] = "Bayside & Eastern Suburbs";
locations[88] = "Bayside & South Eastern Suburbs";
locations[89] = "Blenheim";
locations[90] = "Caribbean, Central & South America";
locations[91] = "CBD & Inner Suburbs";
locations[92] = "CBD & Inner Suburbs";
locations[93] = "CBD, Inner & Western Suburbs";
locations[94] = "CBD, Inner West & Eastern Suburbs";
locations[95] = "Central Asia";
locations[96] = "Channel Islands";
locations[97] = "China, Hong Kong & Taiwan";
locations[98] = "Christchurch";
locations[99] = "Dunedin";
locations[100] = "Eastern Suburbs";
locations[101] = "Eastern Suburbs";
locations[102] = "Fremantle & Southern Suburbs";
locations[103] = "Gisborne";
locations[104] = "Greymouth";
locations[105] = "Hamilton";
locations[106] = "Hastings";
locations[107] = "Hutt Valley";
locations[108] = "India & South Asia";
locations[109] = "Invercargill";
locations[110] = "Japan & Korea";
locations[111] = "Manukau & East Auckland";
locations[112] = "Middle East & North Africa";
locations[113] = "Midlands";
locations[114] = "Napier";
locations[115] = "Nelson";
locations[116] = "New Plymouth";
locations[117] = "North Canterbury";
locations[118] = "North Shore & Northern Beaches";
locations[119] = "North West & Hills District";
locations[120] = "North West England";
locations[121] = "Northern England";
locations[122] = "Northern Ireland";
locations[123] = "Northern Suburbs";
locations[124] = "Northern Suburbs";
locations[125] = "Northern Suburbs & Joondalup";
locations[126] = "Palmerston North";
locations[127] = "Papakura & Franklin";
locations[128] = "Parramatta & Western Suburbs";
locations[129] = "PNG & Pacific Islands";
locations[130] = "Porirua & Kapiti Coast";
locations[131] = "Queenstown & Wanaka";
locations[132] = "Rest of Bay of Plenty";
locations[133] = "Rest of Canterbury";
locations[134] = "Rest of Gisborne";
locations[135] = "Rest of Hawkes Bay";
locations[136] = "Rest of Manawatu";
locations[137] = "Rest of Marlborough";
locations[138] = "Rest of Northland";
locations[139] = "Rest of Otago";
locations[140] = "Rest of Southland";
locations[141] = "Rest of Taranaki";
locations[142] = "Rest of Tasman";
locations[143] = "Rest of Waikato";
locations[144] = "Rest of Wellington Region";
locations[145] = "Rest of West Coast";
locations[146] = "Rockingham & Kwinana";
locations[147] = "Rodney & North Shore";
locations[148] = "Rotorua";
locations[149] = "Russia & Eastern Europe";
locations[150] = "Ryde & Macquarie Park";
locations[151] = "Scotland";
locations[152] = "South East & Home Counties";
locations[153] = "South West & M5 Corridor";
locations[154] = "South West England";
locations[155] = "South-East Asia";
locations[156] = "Southern Suburbs & Logan";
locations[157] = "Southern Suburbs & Sutherland Shire";
locations[158] = "Sub-Saharan Africa";
locations[159] = "Taupo";
locations[160] = "Tauranga";
locations[161] = "Thames & Coromandel";
locations[162] = "Thames Valley & Oxford";
locations[163] = "Timaru & South Canterbury";
locations[164] = "USA & Canada";
locations[165] = "Waitakere & West Auckland";
locations[166] = "Wales";
locations[167] = "Wanganui";
locations[168] = "Wellington Central";
locations[169] = "Western Europe";
locations[170] = "Western Suburbs";
locations[171] = "Western Suburbs & Ipswich";
locations[172] = "Whangarei";

// a list of links between locations
var ln = new Array ();
ln[7] = [90,164];
ln[8] = [95,97,108,110,129,155];
ln[9] = [111,127,147,165];
ln[12] = [132,148,160];
ln[15] = [87,92,123,156,171];
ln[20] = [98,117,133,163];
ln[27] = [149,169];
ln[32] = [103,134];
ln[37] = [106,114,135];
ln[47] = [126,136,167];
ln[49] = [89,137];
ln[50] = [88,91,101,124,170];
ln[51] = [112,158];
ln[58] = [138,172];
ln[59] = [99,131,139];
ln[60] = [93,100,102,125,146];
ln[63] = [96,113,120,121,122,151,152,154,162,166];
ln[69] = [109,140];
ln[71] = [94,118,119,128,150,153,157];
ln[73] = [116,141];
ln[74] = [115,142];
ln[80] = [105,143,159,161];
ln[81] = [107,130,144,168];
ln[82] = [104,145];

		// find the marketSegment object
		eval ("marketSegmentObject = formObject." + marketSegmentFieldname + ";");
		// find the location object
		eval ("locationObject = formObject." + locationFieldname + ";");
		// find the area object
		eval ("areaObject = formObject." + areaFieldname + ";");

		// find out the currently selected marketSegmentId
		marketSegmentId = marketSegmentObject.options[marketSegmentObject.selectedIndex].value;
		// find out the currently selected locationId
		locationId = locationObject.options[locationObject.selectedIndex].value;
		// find out the currently selected areaId
		areaId = areaObject.options[areaObject.selectedIndex].value;

		// check to see if the areaId is allowed based on the locationId
		areaValid = false;
		if (typeof(ln[locationId]) != 'undefined') {
			for (count = 0; count < ln[locationId].length; count++) {
				if (ln[locationId][count] == areaId)
					areaValid = true;
			}
		}
		// if the area doesn't belong to this location then
		if (!areaValid)
			areaId = "";

		// empty the list of areas
		areaObject.length = 0;
		// add the "select -" entry to the list
		if (addNullEntry) {
			var value = "Select -";
			var index = "";
			var newOption = new Option (value, index, false, false);
			var currentLength = areaObject.length;
			areaObject.options[currentLength] = newOption;
		}
		areaObject.selectedIndex = 0;
		// re-populate the area list if necessary
		if (typeof(ln[locationId]) != 'undefined') {
			for (count = 0; count < ln[locationId].length; count++) {
				var value = locations[ln[locationId][count]];
				var index = ln[locationId][count];
				var newOption = new Option (value, index, false, false);
				var currentLength = areaObject.length;
				areaObject.options[currentLength] = newOption;
				if (areaId == index) {
					areaObject.selectedIndex = count;
					if (addNullEntry)
						areaObject.selectedIndex += 1;
				}
			}
		}
		if ((marketSegmentId == "1") || (marketSegmentId == "3") || (marketSegmentId == "5")) {
			if (areaObject.length == 1)
				disable_input (areaFieldname);
			else
				enable_input (areaFieldname);
		}
		else {
			disable_input (areaFieldname);
			areaObject.selectedIndex = 0;
		}

	}

