// toggles the display of the various sections
function displayToggle(eB){
	var aDivs=new Array("div_gs_outer","div_stats","div_companies");
	for(var i=0;i<aDivs.length;++i){
		if(aDivs[i]==eB){
			var oTemp=document.getElementById(aDivs[i]).style;
			oTemp.display="block";
		}else{
			oTemp=document.getElementById(aDivs[i]).style;
			oTemp.display="none";
		}
	}
}
function spanToggle(eid){
	document.getElementById("div_menuyears").style.visibility="hidden";
	var aSpans=new Array();
	var idxDefault = 0, idxSelected = 1;
	aSpans["span_summary"]=new Array("/placement/placement_img_ss_.png","/placement/placement_img_ssS_.png");
	aSpans["span_grad_schools"] = new Array("/placement/placement_img_gs_.png","/placement/placement_img_gsS_.png");
	aSpans["span_companies"] = new Array("/placement/placement_img_co_.png","/placement/placement_img_coS_.png");
	aSpans["span_prevyears"] = new Array("/placement/placement_img_py_.png","/placement/placement_img_pyS_.png");
	// set the style of the span buttons
	for(key in aSpans){
		var oSpan = document.getElementById(key);
		var oImg=oSpan.childNodes[0];
		if(key==eid){
			oImg.src = aSpans[eid][idxSelected];
			oSpan.cursor="default";
		}else{
			//reset
			oImg.src = aSpans[key][idxDefault];
			oSpan.cursor="pointer";
		}
	}
	// determines the section to be sent for display
	switch(eid){
		case "span_summary":
			displayToggle("div_stats");
			break;
		case "span_grad_schools":
			displayToggle("div_gs_outer");
			break;
		case "span_companies":
			displayToggle("div_companies");
			break;
	}
	return;
}
function fnCloseDivMenuYears(){
	var aSurround = new Array("div_stats","div_pie","div_companies","div_gs_outer");
	for(var i = 0; i < aSurround.length; ++i){
		document.getElementById(aSurround[i]).onmouseover=function(){
			document.getElementById("div_menuyears").style.visibility="hidden";
			return;
		}
	}
	return;
}

function main(){
	document.getElementById("span_summary").onclick=function(){
		spanToggle(this.id);
		return;
	}
	document.getElementById("span_companies").onclick=function(){
		spanToggle(this.id);
		return;
	}
	document.getElementById("span_grad_schools").onclick=function(){
		spanToggle(this.id);
		return;
	}
	document.getElementById("span_prevyears").onmouseover=function(){
		document.getElementById("div_menuyears").style.visibility="visible";
		return;
	}
try{
	document.getElementById("span_menuyears2011").onclick=function(){
		window.location = "/placement/2011/";
		return;
	}
}
catch(e){}
try{
	document.getElementById("span_menuyears2010").onclick=function(){
		window.location = "/placement/2010/";
		return;
	}
}
catch(e){}
try{
	document.getElementById("span_menuyears2009").onclick=function(){
		window.location = "/placement/2009/";
		return;
	}
}
catch(e){}
try{	document.getElementById("span_menuyears2008").onclick=function(){
		window.location = "/placement/2008/";
		return;
	}
}
catch(e){}
try{	document.getElementById("span_menuyears2007").onclick=function(){
		window.location = "/placement/2007/";
		return;
	}
}
catch(e){}
	fnCloseDivMenuYears();
	return;
}
main();

