//获得公告信息
$(function(){
	var params = $("input").serialize();
	$.ajax( {
		url : "Index_QueryTitle.do",
		type : "post",
		dataType : "json",
		data : params,
		success : update_pateTile
	});
});
function update_pateTile(result) 
{
	try
	{
		var json = eval("(" + result + ")");
		$("#noticecontent").empty();
		$("#noticecontent").append(json.GGXX);
	}
	catch(err)
	{
		
	}
	return false;
}
//获得左边栏目信息
$(function(){
	var params = $("input").serialize();
	$.ajax( {
		url : "Index_QueryLeft.do",
		type : "post",
		dataType : "json",
		data : params,
		success : update_pateLeft
	});
});
function update_pateLeft(result) 
{
	var json = eval("(" + result + ")");
	$("#list_1").empty();
	$("#list_1").append(json.JSXX); 
	$("#list_1").css("background-image","none");
	$("#list_2").empty();
	$("#list_2").append(json.GQXJHXX); 
	$("#list_2").css("background-image","none");
	$("#list_3").empty();
	$("#list_3").append(json.JXSPXX); 
	$("#list_3").css("background-image","none");
	$("#list_4").empty();
	$("#list_4").append(json.XYSPXX); 
	$("#list_4").css("background-image","none");
	return false;
}
//获得中间栏目信息
$(function(){
	var params = $("input").serialize();
	$.ajax( {
		url : "Index_QueryMiddle.do",
		type : "post",
		dataType : "json",
		data : params,
		success : update_pateMiddle
	});
});
function update_pateMiddle(result) 
{
	var json = eval("(" + result + ")")
	$("#newstop").empty();
	$("#newstop").append(json.XWXX); 
	$("#newstop").css("background-image","none");
	$("#swap").empty();
	$("#swap").append(json.XWXXPICK); 
	$("#swap").css("background-image","none");
	Rotate("album");//设置图片轮换
	setcenter("centerItem_1","img1",json.ZSXX.split("&"));
	setcenter("centerItem_2","img2",json.JYXX.split("&"));
	setcenter("centerItem_3","img3",json.XYSHXX.split("&"));
	setcenter("centerItem_4","img4",json.BJDTXX.split("&"));
	return false;
}
/**
 *  设置内容中间部分的显示
 * @param nrid 显示列表内容的ID
 * @param imgid 显示图片的ID
 * @param arraylist 数组
 * @return
 */
function setcenter(nrid,imgid,arraylist)
{
	$("#"+nrid).empty();
	$("#"+nrid).append(arraylist[0]); 
	$("#"+nrid).css("background-image","none");
	if(arraylist[1]!="")
	{
		$("#"+imgid).empty();
		$("#"+imgid).append(arraylist[1]); 
	}
}

//获得右边栏目信息
$(function(){
	var params = $("input").serialize();
	$.ajax( {
		url : "Index_QueryRight.do",
		type : "post",
		dataType : "json",
		data : params,
		success : update_pateRight
	});
});
function update_pateRight(result) 
{
	var json = eval("(" + result + ")")
	$("#teacher_centen").empty();
	$("#teacher_centen").append(json.TEACHER); 
	$("#teacher_centen").css("background-image","none");
	var a=json.LLTJ
	if(a!=null && a!="")
	{
		$("#tjlx_contact").empty();
		$("#tjlx_contact").append(json.LLTJ); 
	}
	return false;
}
//站内文章搜索
function WZQuery()
{
	var wztile=$("#wztile").val();
	if(wztile=="")
	{
		alert("搜索关键字不能为空!");
	}
	else
	{
		window.open(encodeURI(encodeURI("showclass_Index.do?NAME="+wztile)),"_blank");
	}
}
