// JavaScript Document

//Display the router instructions when clicking the link
function show_single_div(div_id) {
 		var the_div = document.getElementById(div_id);
 		if(the_div.style.display == '' || the_div.style.display == 'none') {
 			the_div.style.display = 'block';
 		} else {
 			the_div.style.display = 'none';
 		}
}

//Hide all the router answers for onload of page and when selecting a new modem from the drop down list 	
function openRouterDiv() {
		// this function also opens the div specified by the #anchor number
		// even though the CSS file specifies display:none for all the divs,
		// this function is still necessary if you use the jump menu
		// since it doesn't reload the page and therefore doesn't re-process the CSS
	
		// get the anchor from the URL into variable hash
		var hash = location.hash.substring(1); // position 0 is the # sign, so get rid - substring(1) gives position 1 to the end of the string
		// set variable divname to e.g. q11
		var theDiv = document.getElementById("q" + hash);
			
		// show the div
		if (theDiv) {
			theDiv.style.display = 'block';
		}

		var theOption = document.getElementById("router" + hash);
		// set the dropdown option box to have the correct router selected...
		if (theOption) {
			theOption.selected = true;
		}
}

function loseFocus()
  {
  document.getElementById('model').blur()
  }

//Get the router details from the drop down menu ready for display.
function RouterJump(){
	var v1 = document.modem.model.value;

	if (v1 == "0"){
		anchorlink = "#top";
	} else {
		anchorlink = "#" + v1;
	}
	
//do the jump to the relevant anchor
location.href = anchorlink;	
//open the relevant answer
//document.getElementById(qno).style.display = 'block';

//open the correct router div
openRouterDiv();
//take the focus away from jumpmenu to stop mousescroll going ape
loseFocus()

	
}	