var url = "infoBox/";

var count = 0;
var networks = ["students", "downloads", "online", "directions"];

function loadPanels(network) {
Init(url + network + '.php')
}

function applyEvents(){
    if(document.getElementById && document.getElementsByTagName){
        var arrAllLinks = document.getElementsByTagName("a");
        var oLink;
        for(var i=0; i<arrAllLinks.length; i++){
            oLink = arrAllLinks[i];
			if(oLink.className.search(/showonline/) != -1){
			    AddFunctions("online", oLink, "onlineTab", "#EB690A")
            }
			else if(oLink.className.search(/showdownloads/) != -1){
			   	AddFunctions("downloads", oLink, "downloadsTab", "#D3021D")
            }
			else if(oLink.className.search(/showstudents/) != -1){
			    AddFunctions("students", oLink, "studentsTab", "#1E1E1E")
            }
			else if(oLink.className.search(/showdirections/) != -1){
			    AddFunctions("directions", oLink, "directionsTab", "#336c98")
            }
        }
    }	
}	
function AddFunctions(network, oLink, networkTab, colorMe) {
	oLink.onmouseover = function (oEvent){
		var oEvent = (typeof oEvent != "undefined")? oEvent : event;
		oEvent.returnValue = false;
		if(oEvent.preventDefault){
			oEvent.preventDefault();
		}
			for(var i=0; i<networks.length; i++){
			document.getElementById(networks[i]).style.display = "none";
			document.getElementById(networks[i]+'Tab').firstChild.style.background = "none";
			document.getElementById(networks[i]+'Tab').firstChild.style.color = "#333";
			if(networks[i] == "students") {
			document.getElementById(networks[i]+'Tab').style.borderLeft = "1px solid #c6c6c6";
		};
			}
		document.getElementById(network).style.display = "block";
		document.getElementById(networkTab).firstChild.style.background = colorMe;
		document.getElementById(networkTab).firstChild.style.color = "#fff";
		if(network == "students") {
			document.getElementById(networkTab).style.borderLeft = "1px solid #1e1e1e;";
		};
	}
}
