// shows and hides data

function show_data(div_id) {
	if (document.getElementById('node_' + div_id)) {
		document.getElementById('node_'+ div_id).style.display="block";
	}
	if (document.getElementById('node_' + div_id + '_icon')) {
			document.getElementById('node_' + div_id + '_icon').src = "/elements/images/icons/icon_expanded.gif";
	}
}

function hide_data(div_id) {
	if (document.getElementById('node_' + div_id)) {
		document.getElementById('node_'+ div_id).style.display="none";		
	}
	if (document.getElementById('node_' + div_id + '_icon')) {
			document.getElementById('node_' + div_id + '_icon').src = "/elements/images/icons/icon_collapsed.gif";
	}
}

function toggle_data(div_id) {
	thisDiv = document.getElementById('node_'+ div_id);
	if (thisDiv)
		if (thisDiv.style.display == "none") show_data(div_id);
		else hide_data(div_id);
}

function subsection_load(div_id) {
	parent.document.getElementById('node_'+div_id).innerHTML = document.body.innerHTML;
}

function toggle_subsection(div_id) {
	var URL = "http://asnmu.nmu.edu/projects/get_node.php?id="+ div_id +"";
	if (document.getElementById('node_'+div_id).innerHTML == "Loading...") document.getElementById('this_data').src = URL;
	toggle_data(div_id);
}

function toggle_syllabi(div_id) {
	var URL = "http://asnmu.nmu.edu/syllabi/get_node.php?id="+ div_id +"";
	if (document.getElementById('node_'+div_id).innerHTML == "Loading...") document.getElementById('this_data').src = URL;
	toggle_data(div_id);
}

function toggle_pollsection(div_id) {
	var URL = "http://asnmu.nmu.edu/webpoll/get_node.php?id="+ div_id +"";
	if (document.getElementById('node_'+div_id).innerHTML == "Loading...") document.getElementById('this_data').src = URL;
	toggle_data(div_id);
}

function toggle_business(div_id) {
	var URL = "http://asnmu.nmu.edu/wallet/get_node.php?id="+ div_id +"";
	if (document.getElementById('node_'+div_id).innerHTML == "Loading...") document.getElementById('this_data').src = URL;
	toggle_data(div_id);
}

function toggle_landlord(div_id) {
	var URL = "http://asnmu.nmu.edu/landlord/get_node.php?id="+ div_id +"";
	if (document.getElementById('node_'+div_id).innerHTML == "Loading...") document.getElementById('this_data').src = URL;
	toggle_data(div_id);
}
