// JavaScript Document
$(document).ready(function(){
						   
						        $("#div1 a").click(function(){
								var i=$("#div1 a").index(this);
								if(i==0){
									gofusionchart(1,"dianji","dianjichart");
									}
									if(i==1){
									gofusionchart(2,"dianji","dianjichart");
									}
									if(i==2){
									gofusionchart(3,"dianji","dianjichart");
									}
									if(i==3){
									gofusionchart(12,"dianji","dianjichart");
									}
													   });
						      $("#div2 a").click(function(){
								var i=$("#div2 a").index(this);
								if(i==0){
									gofusionchart(1,"chengjiao","chengjiaochart");
									}
									if(i==1){
									gofusionchart(2,"chengjiao","chengjiaochart");
									}
									if(i==2){
									gofusionchart(3,"chengjiao","chengjiaochart");
									}
									if(i==3){
									gofusionchart(12,"chengjiao","chengjiaochart");
									}
													   });
					gofusionchart(1,"dianji","dianjichart");
					gofusionchart(1,"chengjiao","chengjiaochart");
		function gofusionchart(n,m,idiv){
		$.post("getdata.php",{n:n,m:m},function(data){
		var myChart = new FusionCharts("../FusionCharts/MSLine.swf", idiv, "800", "280");
		myChart.setDataXML(data);       
		 myChart.render(idiv);
															});
							   
							   }
							   });