function subSectorObj(id, name)
{
	this.id = id;
	this.name = name;

	this.makeOption = function()
	{
		return (new Option(this.name, this.id));
	};

	this.toString = function()
	{
		return ('[subsector:' + this.name + '=' + this.id + ']');
	};
}

function sectorObj(id)
{
	this.id = id;
	this.subsectors = new Array();

	this.append = function(sector)
	{
		this.subsectors.push(sector);
	};

	this.populateSelect = function(select_id)
	{
		var sel = document.getElementById(select_id);
		if (sel != null)
		{
			// clear options (leave top "select all" option)
			for (var i = sel.options.length; i >= 1; i--)
			{
				sel.options[i] = null;
			}

			// populate
			for (var i = 0; i < this.subsectors.length; i++)
			{
				sel.options[i+1] = this.subsectors[i].makeOption();
			}
		}
	};

	this.toString = function()
	{
		var str = '{sector ' + this.id + '=';

		for (var i = 0; i < this.subsectors.length; i++)
		{
			str += this.subsectors[i].toString() + "\r\n";
		}

		return (str + '}');
	};
}

function sectorsObj()
{
	this.sectors = new Array();

	this.sector = function(id)
	{
		var s = null;

		for (var i = 0; i < this.sectors.length; i++)
		{
			var o = this.sectors[i];
			if (o.id == id)
			{
				s = this.sectors[i];
				break;
			}
		}

		if (s == null)
		{
			s = new sectorObj(id);
			this.sectors.push(s);
		}

		return (s);

	};

	this.toString = function()
	{
		var str = '';

		for (var i = 0; i < this.sectors.length; i++)
		{
			str += this.sectors[i].toString() + "\r\n";
		}

		return (str);
	};
}

var mySectors = new sectorsObj;

function appendSubsector(parent, name, id)
{
	mySectors.sector(parent).append(new subSectorObj(id, name));
}

function sector_onChange()
{
	var sector_id = 'industry';
	var subsector_id = 'subsector';

	var sec = document.getElementById(sector_id);
	if (sec != null)
	{
		mySectors.sector(sec.value).populateSelect(subsector_id);
	}
}


// Populate
appendSubsector('1', 'Accountant', 203);
appendSubsector('1', 'Accounts Clerk/Admin', 287);
appendSubsector('1', 'Accounts Payable', 288);
appendSubsector('1', 'Accounts Receivable', 289);
appendSubsector('1', 'Bookkeepers', 290);
appendSubsector('1', 'Business Analyst', 291);
appendSubsector('1', 'Company Secretary', 292);
appendSubsector('1', 'Credit Control', 293);
appendSubsector('1', 'Financial Controller', 199);
appendSubsector('1', 'Fund Accounting', 294);
appendSubsector('1', 'Management Consulting', 205);
appendSubsector('1', 'Other', 295);
appendSubsector('1', 'Payroll', 296);
appendSubsector('1', 'Planning Analysis', 297);
appendSubsector('1', 'Procurement & Inventory', 298);
appendSubsector('1', 'Systems', 299);
appendSubsector('1', 'Treasury', 200);
appendSubsector('2', 'Administration & Secretarial', 206);
appendSubsector('2', 'Contracts Administration', 300);
appendSubsector('2', 'Data Entry/WPO', 301);
appendSubsector('2', 'Management', 302);
appendSubsector('2', 'Office Assistant/Junior', 303);
appendSubsector('2', 'Office Manager', 304);
appendSubsector('2', 'Other', 305);
appendSubsector('2', 'Personal/Executive Assistant', 306);
appendSubsector('2', 'Reception', 307);
appendSubsector('3', 'Advertising', 207);
appendSubsector('3', 'Event Management', 308);
appendSubsector('3', 'Graphic Designer', 309);
appendSubsector('3', 'MarComms', 310);
appendSubsector('3', 'Market Research', 311);
appendSubsector('3', 'Other', 312);
appendSubsector('3', 'Product Management', 313);
appendSubsector('3', 'Product Marketing', 314);
appendSubsector('3', 'Public Relations', 209);
appendSubsector('3', 'Writing', 315);
appendSubsector('5', 'All', 316);
appendSubsector('6', 'All', 317);
appendSubsector('7', 'Account Management', 318);
appendSubsector('7', 'Creative Services', 319);
appendSubsector('7', 'Event Management', 321);
appendSubsector('7', 'Media', 322);
appendSubsector('7', 'Other', 323);
appendSubsector('7', 'Public Relations', 324);
appendSubsector('7', 'Publishing', 320);
appendSubsector('8', 'All', 325);
appendSubsector('9', 'Corporate/Commercial Banking', 211);
appendSubsector('9', 'Investment Banking', 210);
appendSubsector('9', 'Other', 326);
appendSubsector('9', 'Private Banking', 213);
appendSubsector('9', 'Retail Banking', 212);
appendSubsector('10', 'Other', 327);
appendSubsector('10', 'Pharmaceutical', 328);
appendSubsector('10', 'Pharmacy', 329);
appendSubsector('10', 'Sales Execs/Reps', 330);
appendSubsector('331', 'Community', 332);
appendSubsector('331', 'Non-Profit', 333);
appendSubsector('331', 'Other', 334);
appendSubsector('331', 'Social Services', 335);
appendSubsector('14', 'Air Conditioning/Refrigeration', 337);
appendSubsector('14', 'Architects', 338);
appendSubsector('14', 'Boiler Maker', 339);
appendSubsector('14', 'Brick Layer', 340);
appendSubsector('14', 'Building', 341);
appendSubsector('14', 'Cabinet Maker', 342);
appendSubsector('14', 'Carpentry', 343);
appendSubsector('14', 'Civil/Infrastructure', 344);
appendSubsector('14', 'Cleaning', 345);
appendSubsector('14', 'Contracts Administration', 346);
appendSubsector('14', 'Courier Driver', 347);
appendSubsector('14', 'Drafting', 348);
appendSubsector('14', 'Electrician', 349);
appendSubsector('14', 'Estimators', 350);
appendSubsector('14', 'Facilities Management', 351);
appendSubsector('14', 'Fitting/Welding', 352);
appendSubsector('14', 'Food Preparation', 353);
appendSubsector('14', 'Foreman/Supervisor', 354);
appendSubsector('14', 'Gardening/Landscaping', 355);
appendSubsector('14', 'Inspectors', 356);
appendSubsector('14', 'Machine Operator', 357);
appendSubsector('14', 'Mechancial', 358);
appendSubsector('14', 'Mechanic', 359);
appendSubsector('14', 'Mining', 360);
appendSubsector('14', 'Natural Resources', 361);
appendSubsector('14', 'Other', 362);
appendSubsector('14', 'Painting', 363);
appendSubsector('14', 'Plumber', 364);
appendSubsector('14', 'Printer', 365);
appendSubsector('14', 'Process Worker', 366);
appendSubsector('14', 'Project Manager', 367);
appendSubsector('14', 'Quantity Surveyor', 368);
appendSubsector('14', 'Security', 369);
appendSubsector('14', 'Site Management', 370);
appendSubsector('14', 'Surveying', 371);
appendSubsector('15', 'All', 372);
appendSubsector('17', 'Call Centre Manager', 373);
appendSubsector('17', 'Call Centre Operator', 374);
appendSubsector('17', 'Customer Service', 375);
appendSubsector('17', 'Other', 376);
appendSubsector('17', 'Sales & Marketing', 377);
appendSubsector('17', 'Supervision/Management', 378);
appendSubsector('46', 'Air Force', 379);
appendSubsector('46', 'Army', 380);
appendSubsector('46', 'Navy', 381);
appendSubsector('46', 'Other', 382);
appendSubsector('18', 'Early Childhood', 383);
appendSubsector('18', 'Library Services', 384);
appendSubsector('18', 'Other', 385);
appendSubsector('18', 'Schools', 386);
appendSubsector('18', 'University', 387);
appendSubsector('18', 'Vocational Edu. & Training', 388);
appendSubsector('20', 'CAD/Drafting', 389);
appendSubsector('20', 'Communications', 390);
appendSubsector('20', 'Consulting', 391);
appendSubsector('20', 'Electronics', 392);
appendSubsector('20', 'Engineer', 233);
appendSubsector('20', 'Graduate', 393);
appendSubsector('20', 'Hardware Engineering', 394);
appendSubsector('20', 'Instrumentation', 395);
appendSubsector('20', 'Maintenance', 396);
appendSubsector('20', 'Management', 397);
appendSubsector('20', 'Manufacturing', 398);
appendSubsector('20', 'Mining', 399);
appendSubsector('20', 'Oil & Gas', 400);
appendSubsector('20', 'Operations', 401);
appendSubsector('20', 'Other', 402);
appendSubsector('20', 'Petrochemical', 403);
appendSubsector('20', 'Plant', 404);
appendSubsector('20', 'Project Manager', 405);
appendSubsector('20', 'Safety Coordinator/Officer', 406);
appendSubsector('20', 'Software Engineering', 407);
appendSubsector('20', 'Supervisor', 408);
appendSubsector('20', 'Test Engineering', 409);
appendSubsector('23', 'Analysis', 412);
appendSubsector('23', 'Custody', 413);
appendSubsector('23', 'Economist', 410);
appendSubsector('23', 'Financial Markets', 414);
appendSubsector('23', 'Financial Planning', 415);
appendSubsector('23', 'Funds Management', 416);
appendSubsector('23', 'Insurance', 417);
appendSubsector('23', 'Marketing', 418);
appendSubsector('23', 'Mortgage', 419);
appendSubsector('23', 'Other', 411);
appendSubsector('23', 'Project Management', 420);
appendSubsector('23', 'Property Funds/Asset/Portfolio Management', 421);
appendSubsector('23', 'Risk Management', 422);
appendSubsector('23', 'Stockbrocking', 423);
appendSubsector('23', 'Superannuation', 424);
appendSubsector('23', 'Treasury', 425);
appendSubsector('23', 'Venture Capital', 426);
appendSubsector('24', 'Education', 427);
appendSubsector('24', 'Enterprises', 428);
appendSubsector('24', 'Federal', 429);
appendSubsector('24', 'Local', 430);
appendSubsector('24', 'Other', 431);
appendSubsector('24', 'Police/Prison Workers', 432);
appendSubsector('24', 'State', 433);
appendSubsector('30', 'Administration/Admissions', 434);
appendSubsector('30', 'Allied Health', 435);
appendSubsector('30', 'Environmental Services', 436);
appendSubsector('30', 'Management', 437);
appendSubsector('30', 'Other', 438);
appendSubsector('30', 'Sales Execs/Reps', 439);
appendSubsector('30', 'Social Work', 440);
appendSubsector('30', 'Veterinarian/Animal Welfare', 441);
appendSubsector('63', 'Aged/Disabled Care', 442);
appendSubsector('63', 'Allied Health', 443);
appendSubsector('63', 'Ambulance/Paramedic', 444);
appendSubsector('63', 'Chiropractor', 445);
appendSubsector('63', 'Clinical/Medical Research', 446);
appendSubsector('63', 'Dental', 447);
appendSubsector('63', 'Medical Practitioner', 448);
appendSubsector('63', 'Nursing/Midwives', 449);
appendSubsector('63', 'Other', 450);
appendSubsector('63', 'Pathology', 451);
appendSubsector('63', 'Psychology/Counselling', 452);
appendSubsector('63', 'Radio/Sono/Ultrasound', 453);
appendSubsector('63', 'Safety Inspector', 454);
appendSubsector('63', 'Specialists', 455);
appendSubsector('37', 'All', 235);
appendSubsector('38', 'Administration', 456);
appendSubsector('38', 'Change Management', 457);
appendSubsector('38', 'Executive', 458);
appendSubsector('38', 'General HR', 459);
appendSubsector('38', 'HRIS', 460);
appendSubsector('38', 'Industrial/Employee Relations', 461);
appendSubsector('38', 'Management', 462);
appendSubsector('38', 'Occupational Health & Safety', 463);
appendSubsector('38', 'Organisational Development', 464);
appendSubsector('38', 'Other', 465);
appendSubsector('38', 'Payroll', 466);
appendSubsector('38', 'Projects', 467);
appendSubsector('38', 'Recruitment', 468);
appendSubsector('38', 'Remuneration & Benefits', 469);
appendSubsector('39', 'Analyst/Programmer', 264);
appendSubsector('39', 'Architect', 470);
appendSubsector('39', 'Business Analyst', 251);
appendSubsector('39', 'Computer Operators', 471);
appendSubsector('39', 'Consultant', 472);
appendSubsector('39', 'Database Development & Administration', 473);
appendSubsector('39', 'Hardware Engineer', 336);
appendSubsector('39', 'Helpdesk/Support', 249);
appendSubsector('39', 'Internet', 481);
appendSubsector('39', 'Management', 248);
appendSubsector('39', 'Marketing', 244);
appendSubsector('39', 'Networks & Systems', 265);
appendSubsector('39', 'Other', 250);
appendSubsector('39', 'Product Management', 474);
appendSubsector('39', 'Project Management', 252);
appendSubsector('39', 'QA/Testers', 475);
appendSubsector('39', 'Sales: Pre & Post', 266);
appendSubsector('39', 'Security', 476);
appendSubsector('39', 'Software Engineer', 477);
appendSubsector('39', 'Team Leaders', 478);
appendSubsector('39', 'Technical Writers', 479);
appendSubsector('39', 'Telecommunications', 577);
appendSubsector('39', 'Trainers', 480);
appendSubsector('40', 'All', 482);
appendSubsector('41', 'All', 483);
appendSubsector('44', 'Building & Construction', 484);
appendSubsector('44', 'Commercial', 485);
appendSubsector('44', 'Corporate Mergers & Acquisitions', 486);
appendSubsector('44', 'Employment & Industrial Relations', 487);
appendSubsector('44', 'Family', 488);
appendSubsector('44', 'Financial Services', 489);
appendSubsector('44', 'Government', 490);
appendSubsector('44', 'In-House Banking & Finance ', 491);
appendSubsector('44', 'In-House Corporates', 253);
appendSubsector('44', 'In-House Insurance', 492);
appendSubsector('44', 'Law Clerk', 493);
appendSubsector('44', 'Law Firm/Private Practice', 254);
appendSubsector('44', 'Legal Secretary', 494);
appendSubsector('44', 'Litigation', 495);
appendSubsector('44', 'Other', 496);
appendSubsector('44', 'Paralegals', 255);
appendSubsector('44', 'Partners/Senior Associate', 497);
appendSubsector('44', 'Patent & IP', 498);
appendSubsector('44', 'Personal Injury', 499);
appendSubsector('44', 'Property', 500);
appendSubsector('44', 'Solicitor', 501);
appendSubsector('44', 'Tax', 502);
appendSubsector('44', 'Word Processing Operator', 503);
appendSubsector('45', 'Assembly Line Worker', 504);
appendSubsector('45', 'Fitters/Machinists', 505);
appendSubsector('45', 'Industrial Design', 506);
appendSubsector('45', 'Labourer', 507);
appendSubsector('45', 'Machine Operators', 508);
appendSubsector('45', 'Machine Tool Programmers', 509);
appendSubsector('45', 'Other', 510);
appendSubsector('45', 'Plant Manager', 511);
appendSubsector('45', 'Process Worker', 512);
appendSubsector('45', 'Purchasing', 513);
appendSubsector('45', 'Q/A', 514);
appendSubsector('45', 'Quality', 515);
appendSubsector('45', 'Supervisor/Team Leader', 516);
appendSubsector('45', 'Trades Assistant', 517);
appendSubsector('64', 'Account Management', 518);
appendSubsector('64', 'Analyst', 519);
appendSubsector('64', 'Brand Management', 520);
appendSubsector('64', 'Communications', 523);
appendSubsector('64', 'Direct Marketing', 521);
appendSubsector('64', 'Market Research', 522);
appendSubsector('64', 'Other', 524);
appendSubsector('64', 'Product Management & Development', 525);
appendSubsector('48', 'Drilling', 526);
appendSubsector('48', 'Engineering', 527);
appendSubsector('48', 'Geoscience', 528);
appendSubsector('48', 'Health & Safety', 529);
appendSubsector('48', 'Logistics/Procurement', 530);
appendSubsector('48', 'Management', 531);
appendSubsector('48', 'Other', 532);
appendSubsector('49', 'Property Management', 533);
appendSubsector('50', 'Beauty Therapy', 534);
appendSubsector('50', 'Hairdressing', 535);
appendSubsector('50', 'Marketing', 229);
appendSubsector('50', 'Merchandising', 230);
appendSubsector('50', 'Other', 536);
appendSubsector('50', 'Sales Assistant', 228);
appendSubsector('43', 'Other', 537);
appendSubsector('43', 'Police Force', 538);
appendSubsector('43', 'Security', 539);
appendSubsector('52', 'Administration', 540);
appendSubsector('52', 'Leasing', 541);
appendSubsector('52', 'Other', 542);
appendSubsector('52', 'Property & Shopping Centre Management', 543);
appendSubsector('52', 'Property Advisory', 544);
appendSubsector('52', 'Property Development', 545);
appendSubsector('52', 'Sales', 546);
appendSubsector('52', 'Valuation', 547);
appendSubsector('19', 'All', 548);
appendSubsector('53', 'All', 549);
appendSubsector('54', 'Buying', 552);
appendSubsector('54', 'FMCG', 550);
appendSubsector('54', 'Operations', 553);
appendSubsector('54', 'Other', 551);
appendSubsector('54', 'Store Manager', 554);
appendSubsector('55', 'Account Management', 555);
appendSubsector('55', 'Analyst', 556);
appendSubsector('55', 'Brand/Product Management', 557);
appendSubsector('55', 'Business Development', 558);
appendSubsector('55', 'Coordinator', 559);
appendSubsector('55', 'Market Research', 560);
appendSubsector('55', 'Marketing Communications', 561);
appendSubsector('55', 'Marketing Manager', 562);
appendSubsector('55', 'Other', 563);
appendSubsector('55', 'Project Sales Engineer', 564);
appendSubsector('55', 'Sales Manager', 565);
appendSubsector('55', 'Sales Representative/Consultant', 566);
appendSubsector('55', 'Telemarketing', 567);
appendSubsector('56', 'Other', 568);
appendSubsector('57', 'All', 569);
appendSubsector('58', 'Logistics', 570);
appendSubsector('58', 'Management', 571);
appendSubsector('58', 'Operations', 572);
appendSubsector('58', 'Other', 573);
appendSubsector('58', 'Planning', 574);
appendSubsector('58', 'Procurement', 575);
appendSubsector('58', 'Supply Chain', 576);
appendSubsector('60', 'Inventory', 578);
appendSubsector('60', 'Logistics', 579);
appendSubsector('60', 'Materials', 580);
appendSubsector('60', 'Other', 581);
appendSubsector('60', 'Planning', 582);
appendSubsector('60', 'Purchasing', 583);
appendSubsector('60', 'Systems', 584);
appendSubsector('60', 'Transport', 585);
appendSubsector('60', 'Warehouse & Distribution', 586);
