<!--



var am_sc_oc_section_names = new Array();

am_sc_oc_section_names[0]  = 'tbl_step_intro_1';
am_sc_oc_section_names[1]  = 'tbl_step_intro_2';
am_sc_oc_section_names[2]  = 'tbl_step_old_map';
am_sc_oc_section_names[3]  = 'tbl_step_1';
am_sc_oc_section_names[4]  = 'tbl_step_2';
am_sc_oc_section_names[5]  = 'tbl_step_3';



var am_sc_oc_help_section_names = new Array();

am_sc_oc_help_section_names = 'help_old_map';
am_sc_oc_help_section_names = 'help_step1';
am_sc_oc_help_section_names = 'help_step2';
am_sc_oc_help_section_names = 'help_step3';



var am_sc_step1_inputs_section_names = new Array(); 

am_sc_step1_inputs_section_names[0] = 'tbl_step_1_sub_quicklinks'; 
am_sc_step1_inputs_section_names[1] = 'tbl_step_1_sub_postcodes'; 
am_sc_step1_inputs_section_names[2] = 'tbl_step_1_sub_coordinates'; 





// Make the tables appear as users click the tabs/links

function am_sc_oc_open_section(section_name) {



	for (a = 0; a < am_sc_oc_section_names.length; a++) {

		if (document.getElementById(am_sc_oc_section_names[a])) {

			document.getElementById(am_sc_oc_section_names[a]).style.display = 'none';

		}

	}


	if (document.getElementById(section_name)) {
		document.getElementById(section_name).style.display = '';
	}


}




// Control the main sub-sections like step 2

function am_sc_oc_control_subselect_step2(section_name) {


	if (document.getElementById(section_name).style.display == 'none') {
		document.getElementById(section_name).style.display = '';
	}
	else {
		document.getElementById(section_name).style.display = 'none';
	}


}





// Control the input by postcode, co-ordinates or quicklinks in step 1 
//
// This more complex code works a bit like a radio button by only allowing one section to show at once 
// but also allows the displayed section to be closed itself which isn't possible without this complexity 

function am_sc_inputs_control_step1(section_name) { 

	
	
	// Close everything except the clicked section 
	
	for (a = 0; a < am_sc_step1_inputs_section_names.length; a++) { 

		if (document.getElementById(am_sc_step1_inputs_section_names[a])) { 

			if (am_sc_step1_inputs_section_names[a] != section_name) { 

				document.getElementById(am_sc_step1_inputs_section_names[a]).style.display = 'none'; 
				
			}

		} 

	} 


	
	// Deal exclusively with the clicked section 
	
	if (document.getElementById(section_name)) { 
	
		if (document.getElementById(section_name).style.display == 'none') { 
	
			document.getElementById(section_name).style.display = ''; 
			
		}
		else { 
		
			document.getElementById(section_name).style.display = 'none'; 
			
		}

		
	} 


} 





// Open/close the help sections

function am_sc_oc_open_help_section(section_name) {



	for (a = 0; a < am_sc_oc_help_section_names.length; a++) {

		if (document.getElementById(am_sc_oc_help_section_names[a])) {

			document.getElementById(am_sc_oc_help_section_names[a]).style.display = 'none';

		}

	}


	if (document.getElementById(section_name)) {

		if (document.getElementById(section_name).style.display == '') {
			document.getElementById(section_name).style.display = 'none';
		}
		else {
			document.getElementById(section_name).style.display = '';
		}


	}


}





// Only close selected help section

function am_sc_oc_close_help_section(section_name) {


	if (document.getElementById(section_name)) {
		document.getElementById(section_name).style.display = 'none';
	}

}






// Control the help sub-sections found in step 2 and 3

function am_sc_oc_control_sub_help(section_name) {


	if (document.getElementById(section_name).style.display == 'none') {
		document.getElementById(section_name).style.display = '';
	}
	else {
		document.getElementById(section_name).style.display = 'none';
	}


}





// A bit of Javascript which makes a table row vanish when the page has loaded
// Should be called onLoad

function am_vanish_control() {

	if (document.getElementById('am_first_section_vanish')) {
		document.getElementById('am_first_section_vanish').style.display = 'none';
	}

}





// An alternative to hashes

function jump_div(elID)

{
	var el = document.getElementById(elID);
	el.scrollIntoView(true);

}





// -->




