

$(function() {



//load the xml, run the function on success



$.get('/xml/nav.xml', function(data) {



//write data to navigation section 1



	$('#navsection1header').html("<a href='"+$(data).find('section[id=1] header').attr("url")+"' id='navsection1header'>" + $(data).find('section[id=1] header').text() + "</a>");

	

	$(data).find('section[id=1] option').each(function() {



		  $("#navsection1bottombox").append("<a href='"+$(this).attr("url")+"' id='navsection1option'>" + $(this).text() + "</a><br />");



	});



	var section1height = $(data).find('section[id=1] option').length * 22;



	$("#navsection1bottombox").css ('height', section1height);



//write data to navigation section 2



	$('#navsection2header').html("<a href='"+$(data).find('section[id=2] header').attr("url")+"' id='navsection2header'>" + $(data).find('section[id=2] header').text() + "</a>");



	$(data).find('section[id=2] option').each(function() {



		  $("#navsection2bottombox").append("<a href='"+$(this).attr("url")+"' id='navsection2option'>" + $(this).text() + "</a><br />");



	});



	var section2height = $(data).find('section[id=2] option').length * 22;



	$("#navsection2bottombox").css ('height', section2height);



//write data to navigation section 3



	$('#navsection3header').html("<a href='"+$(data).find('section[id=3] header').attr("url")+"' id='navsection3header'>" + $(data).find('section[id=3] header').text() + "</a>");



	$(data).find('section[id=3] option').each(function() {



		  $("#navsection3bottombox").append("<a href='"+$(this).attr("url")+"' id='navsection3option'>" + $(this).text() + "</a><br />");



	});



	var section3height = $(data).find('section[id=3] option').length * 22;



	$("#navsection3bottombox").css ('height', section3height);



//write data to navigation section 4



	$('#navsection4header').html("<a href='"+$(data).find('section[id=4] header').attr("url")+"' id='navsection4header'>" + $(data).find('section[id=4] header').text() + "</a>");



	$(data).find('section[id=4] option').each(function() {



		  $("#navsection4bottombox").append("<a href='"+$(this).attr("url")+"' id='navsection4option'>" + $(this).text() + "</a><br />");



		});



	var section4height = $(data).find('section[id=4] option').length * 22;



	$("#navsection4bottombox").css ('height', section4height);



	});

});
