//全局变量，用于AD01
var tempNum = 1;
var intervalID;

////////////////////////////////////////////////////////////////////////////////////////////////////

function createXMLHttpRequest(){
	var XMLHttpReq;
	if (window.XMLHttpRequest) {
        //针对FireFox，Mozillar， Opera， Safari， IE7 , IE8
         XMLHttpReq = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        //针对IE6, IE5.5, IE5
        var activexName = ["MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
        for (var  i = 0; i < activexName.length; i++ ) {
            try{
                XMLHttpReq = new  ActiveXObject(activexName[i]);
            }  catch(e) {
			}
        }
    }
	return XMLHttpReq;
}

///////////////////////////////////////////////////////////////////////////////////////////////////

function gotoShouYe(){
	window.location = "index.html";
}
function gotoKaoJi(){
	window.open("kaoJiBaoMing.html");
}
function gotoPeiXun(){
	window.open("shiZiPeiXun.html");
}
function gotoLiuYan(){
	window.open("chaKanLiuYan.html");
}
function gotoWoMen(){
	window.open("guanYuWoMen.html");
}
function  gotoShiYanYuan(){
	window.open("ShiYanYuan.html");
}

////////////////////////////////////////////////////////////////////////////////////////
//导航变换
function chgImgOnTopOver(obj){
	tempId = obj.id;
	var tempObj = document.getElementById(tempId);
	if(tempId == "shouYe"){
		tempObj.className = "shouYe_over";
	}else if(tempId == "kaoJiBaoMing"){
		tempObj.className = "kaoJiBaoMing_over";
	}else if(tempId == "peiXunYuYue"){
		tempObj.className = "peiXunYuYue_over";
	}else if(tempId == "jiaoAnTouGao"){
		tempObj.className = "jiaoAnTouGao_over";
	}else if(tempId == "guanYuWoMen"){
		tempObj.className = "guanYuWoMen_over";
	}else if(tempId == "shiYanYuanZhuanQu"){
		tempObj.className = "shiYanYuanZhuanQu_over";
	}
}

function chgImgOnTopOut(obj){
	tempId = obj.id;
	var tempObj = document.getElementById(tempId);
	if(tempId == "shouYe"){
		tempObj.className = "shouYe_normal";
	}else if(tempId == "kaoJiBaoMing"){
		tempObj.className = "kaoJiBaoMing_normal";
	}else if(tempId == "peiXunYuYue"){
		tempObj.className = "peiXunYuYue_normal";
	}else if(tempId == "jiaoAnTouGao"){
		tempObj.className = "jiaoAnTouGao_normal";
	}else if(tempId == "guanYuWoMen"){
		tempObj.className = "guanYuWoMen_normal";
	}else if(tempId == "shiYanYuanZhuanQu"){
		tempObj.className = "shiYanYuanZhuanQu_normal";
	}
}

///////////////////////////////////////////////////////////////////////////////////////////

//获取公告信息
function getGongGaoInfo(){
	var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/GongGao.asp";
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
											if(tempXMLHttpReq.readyState == 4){
												if(tempXMLHttpReq.status == 200){
													var str1 = unescape(tempXMLHttpReq.responseText);
													document.getElementById("noticeContentDiv").innerHTML = ""+
														"&nbsp;&nbsp;&nbsp;&nbsp;"+
														str1;	
												}
											}
										};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
}

//////////////////////////////////////////////////////////////////////////////////////////////////

//向后台请求登录面板样式信息
function loadLogoPanel(){
	var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/login.asp";
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
											if(tempXMLHttpReq.readyState == 4){
												if(tempXMLHttpReq.status == 200){
													var logoPanel1 = document.getElementById("LogoPanelOne");
													var logoPanel2 = document.getElementById("LogoPanelTwo");
													var logoPanel3 = document.getElementById("LogoPanelThree");
													var userLogoedInfo = (unescape(tempXMLHttpReq.responseText));
													var tempArr = (userLogoedInfo).split("#");
													if(tempArr[0] == "noLogoed"){
														logoPanel1.className = "LogoPanelOne";
														logoPanel2.className = "dis_non";
														logoPanel3.className = "dis_non";
													}else if(tempArr[0] == "true"){
														if(tempArr[1] == "isLogoedAndNoOrder"){
															logoPanel1.className = "dis_non";
															logoPanel2.className = "LogoPanelTwo";
															logoPanel3.className = "dis_non";
															//添加相关信息
															document.getElementById("userName1").innerHTML = tempArr[2];
															document.getElementById("userStatus1").innerHTML = tempArr[3];
														}else if(tempArr[1] == "isLogoedAndHaveOrder"){
															logoPanel1.className = "dis_non";
															logoPanel2.className = "dis_non";
															logoPanel3.className = "LogoPanelThree";
															//添加相关信息
															document.getElementById("userName2").innerHTML = tempArr[2];
															document.getElementById("userStatus2").innerHTML = tempArr[3];
															document.getElementById("noPayFor").innerHTML = tempArr[4];
															document.getElementById("allNoPayMoney").innerHTML = tempArr[5];
														}
													}
												}
											}
										};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
}

///////////////////////////////////////////////////////////////////////////////////////////////////

//获取验证码
function getCode(){
	var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/Code.asp";
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
											if(tempXMLHttpReq.readyState == 4){
												if(tempXMLHttpReq.status == 200){
													var str1 = unescape(tempXMLHttpReq.responseText);
													document.getElementById("logo07").innerHTML = str1;
												}
											}
										};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
}

///////////////////////////////////////////////////////////////////////////////////////////////////

//验证输入信息，并向后台发送信息
function checkUserInfo(){
	var uid = document.getElementById("userId");
	var upass = document.getElementById("userPass");
	var uchkcode = document.getElementById("userChkCode");
	if(uid.value.length == 0) {
		uid.focus();
		alert("用户名不能为空！");
		return ;
	}
	if(upass.value.length == 0) {
		uid.focus();
		alert("密码不能为空！");
		return ;
	}
	if(uchkcode.value.length == 0) {
		uid.focus();
		alert("验证码不能为空");
		return ;
	}
	//向后台发送信息
	sendUserInfo();
}

//////////////////////////////////////////////////////////////////////////////////////////////////

//向后台发送验证信息
function sendUserInfo(){
	var tempXMLHttpReq = createXMLHttpRequest();
	//获得用户输入的信息
	var uId = document.getElementById("userId").value;
	var uPass = document.getElementById("userPass").value;
	var uCode = document.getElementById("userChkCode").value;
	var url = "asp/chkuser.asp?userId=" + escape(uId) + 
		"&userPass=" + escape(uPass) + 
		"&userChkCode=" + escape(uCode);
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
											if(tempXMLHttpReq.readyState == 4){
												if(tempXMLHttpReq.status == 200){
													var temp1 = (unescape(tempXMLHttpReq.responseText)).split("#");
													if (temp1[0] == "true") {
														window.location.reload();
													}else if (temp1[0] == "false"){
														alert(temp1[1]);
													}
												}
											}
										};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
}

///////////////////////////////////////////////////////////////////////////////////////////////////

//注销登录
function logoOut(obj){
	var tempId = obj.id;
	var tempObj = document.getElementById(tempId);
	if(tempId == "logoOut1" || tempId == "logoOut2"){
		//取消session中的变量,设置为空
		var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/logoOut.asp";
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
											if(tempXMLHttpReq.readyState == 4){
												if(tempXMLHttpReq.status == 200){										
													window.location.reload();
												}
											}
										};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
	}
}

/////////////////////////////////////////////////////////////////////////////////////////////////

//请求幼教动态信息
function requestYouJiaoDongTaiInfo(){
	var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/youJiaoDongTai.asp";
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
											if(tempXMLHttpReq.readyState == 4){
												if(tempXMLHttpReq.status == 200){
													var tempDiv = document.getElementById("youJiaoDongTai");
													var temp1 = (unescape(tempXMLHttpReq.responseText)).split("#");
													var tempStr = "<table width='443' border='0' cellpadding='4' cellspacing='0' style='position:absolute; top:40px;'>";
													var tempIDArr = new Array(); //保存ID的数组													
													//保存ID
													for(var k=0;k<temp1.length-1;k++){
														var allid = temp1[k].split("%");
														tempIDArr[k] = allid[0]; 		
													}
													for(var i=0;i<temp1.length-1;i++){
														//添加ID链接，以便跳转到指定内容
														tempStr = tempStr + "<tr id=" + tempIDArr[i] + " onclick='gotoYouJiaoDongTaiDetail(this)' onmouseover='showPointLineBG(this)' onmouseout='hidePointLineBG(this)'>";
														var temp2 = temp1[i].split("%");
														//从1开始是为了去掉 ID 号
														for(var j=1;j<temp2.length;j++){
															var temp = "";
															if(j == 1){
																//J==1的字段是幼教动态内容
																if(temp2[j].length >= 20){
																	temp = "·[幼教动态]&nbsp;"+(temp2[j]).substr(0,20) + "....";
																}else{
																	temp = "·[幼教新闻]&nbsp;"+temp2[j];
																}
																tempStr = tempStr + "<td>" + temp + "</td>";
															}else{
																//该字段是时间
																temp =(temp2[j]).split(" ");
																tempStr = tempStr + "<td Style='color=#cccccc'>" + temp[0] + "</td>";
															}
														}
														tempStr = tempStr + "</tr>";
													}
													tempStr = tempStr + "</table>";
													tempDiv.innerHTML = tempStr;
													
												}
											}
										};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
}

/////////////////////////////////////////////////////////////////////////////////////////////////

//读取最新上传文章
function getNewSubmitWZ(){
	var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/getNewSubmitWZ.asp";
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
		if(tempXMLHttpReq.readyState == 4){
			if(tempXMLHttpReq.status == 200){
				var temp = (unescape(tempXMLHttpReq.responseText)).split("######");
				var tempDiv = document.getElementById("tuoFuYouErYingYuDongTai");
				if(unescape(tempXMLHttpReq.responseText) == ""){
					tempDiv.innerHTML = "<div style='padding-top:5px'>暂无文章上传！</div>";
				}
				var tempStr = "<table width='210' border='0' cellpadding='3' cellspacing='0' style='position:absolute; top:55px;'>";
				for(var i=0; i<temp.length; i++){
					var temp1 = temp[i].split("#%#");
					var tempTitle = "";
					if(temp1[1].length >11){
						tempTitle = temp1[1].substr(0,11) + "...";
					}else{
						tempTitle = temp1[1];
					}
					if(temp1[2] == 0){
						temp1[2] = "心得";
					}else if(temp1[2] == 1){
						temp1[2] = "教学";
					}
					tempStr = tempStr + "<tr id=wenzhang" + temp1[0] + " title='" + temp1[1] + "' onmouseover='xibaoOver(this)' onmouseout='xibaoOut(this)' onClick='showWenZhangDetail(this)'><td height='15'>&middot;[" + temp1[2] + "]&nbsp;" + tempTitle + "</td></tr>";
				}
				tempStr = tempStr + "<tr><td align='right' style='color:#f00;cursor:pointer;' onClick='gotoWenZhangList()'>更多...</td></tr>"
				tempStr = tempStr + "</table>";
				tempDiv.innerHTML = tempStr;
			}
		}
	}
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);												
}

/////////////////////////////////////////////////////////////////////////////////////////////////

//修改个人资料
function chhInfo(){
	window.open("chgUserInfo.html");
}

/////////////////////////////////////////////////////////////////////////////////////////////////

//显示文章详细信息
function showWenZhangDetail(obj){
	var wenzhangid = obj.id;
	window.open("showWenZhangDetail.html?wenzhangid=" + wenzhangid);
}

/////////////////////////////////////////////////////////////////////////////////////////////////

//鼠标经过内容列表时的状态改变
function showPointLineBG(obj){
	var tempID = obj.id;
	var tempDiv = document.getElementById(tempID);
	tempDiv.className = "showPointDetail";
}
function hidePointLineBG(obj){
	var tempID = obj.id;
	var tempDiv = document.getElementById(tempID);
	tempDiv.className = "hidePointDetail";
}

////////////////////////////////////////////////////////////////////////////

//根据商品 ID 来查找指定商品内容
//将该商品 ID 保存入cookies中，记录到最近浏览商品列表中
function showBookDetail(obj){
	var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/saveLastLiuLanGood.asp?clickId=" + obj.id;
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
		if(tempXMLHttpReq.readyState == 4){
			if(tempXMLHttpReq.status == 200){
				//向后台发送产品ID
				window.open("showBookDetail.html?shopID=" + obj.id);
			}
		}
	};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
}

////////////////////////////////////////////////////////////////////////////////////////////////

//资格证鼠标经过函数
function kaoJiChgTab(obj){
	var tempID=obj.id;
	var kaoJiTab1 = document.getElementById("kaoJiTab1");
	var kaoJiTab2 = document.getElementById("kaoJiTab2");
	if(tempID=="kaoJiTab2"){
		kaoJiTab1.className = "kaoJiTab1_over";
		kaoJiTab2.className = "kaoJiTab2_over";
	}
	if(tempID=="kaoJiTab1"){
		kaoJiTab1.className = "kaoJiTab1";
		kaoJiTab2.className = "kaoJiTab2";
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////

//考级查询函数
function SerchChengJiFn(){
	//获取用户输入的信息
	var tempName = document.getElementById("userKaoJiName");
	var tempNumber = document.getElementById("userKaoJiNumber");
	var temp = document.getElementById("kaoJiTab1");
	if((tempName.value).length == 0 && (tempNumber.value).length == 0){
		alert("姓名或考号必须输入一项！");
		return;
	}
	if((tempName.value).length != 0 && (tempNumber.value).length != 0){
		//两个参数，包括姓名和编号
		alert("姓名或编号输入一项即可！");
		return ;
	}
	if(temp.className == "kaoJiTab1_over"){
		//教师查询
		//将输入的姓名传递给考级查询子页面
		if((tempName.value).length != 0 && (tempNumber.value).length == 0){
			window.open("teachAndStudentSearch.html?teacherNAME=" + escape(tempName.value));
		}
		//将输入的编号传递给考级查询子页面
		if((tempName.value).length == 0 && (tempNumber.value).length != 0){
			window.open("teachAndStudentSearch.html?teacherNumber=" + tempNumber.value);
		}
	}else{
		//学生查询
		if((tempName.value).length != 0 && (tempNumber.value).length == 0){
			window.open("teachAndStudentSearch.html?studentName=" + escape(tempName.value));
		}
		if((tempName.value).length == 0 && (tempNumber.value).length != 0){
			window.open("teachAndStudentSearch.html?studentNumber=" + tempNumber.value);
		}
	}
	
}

///////////////////////////////////////////////////////////////////////////////////////////////////

//根据幼教动态 ID 来查找指定动态内容
//将该ID保存入cookies中，记录到最近浏览新闻列表中
function gotoYouJiaoDongTaiDetail(obj){
	var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/saveLastLiuLanNews.asp?clickId=" + obj.id;
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
		if(tempXMLHttpReq.readyState == 4){
			if(tempXMLHttpReq.status == 200){
				//跳转到指定页面，并传递 ID 参数
				window.open("youJiaoDongTaiDetail.html?dongTaiId=" + obj.id);
			}
		}
	};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
}

//////////////////////////////////////////////////////////////////////////////////////////////////

//考级报名图片轮换
function chgImgBaoMingOver(obj){
	var tempID = obj.id;
	var tempDiv = document.getElementById(tempID);
	tempDiv.className = "baoMingDiv_over";
}
function chgImgBaoMingOut(obj){
	var tempID = obj.id;
	var tempDiv = document.getElementById(tempID);
	tempDiv.className = "baoMingDiv";
}

/////////////////////////////////////////////////////////////////////////////////////////
//跳转到用户注册页面
function gotoUserRegistPage(){
	window.open("regist.html");
}

//跳转到考级简介页面
function gotoBaoMingDetail(){
	window.open("kaoJiJianJie.html");
}
///////////////////////////////////////////////////////////////////////////////////////////


//跳转到考级报名页面
function gotoBaoMing(){
	window.open("kaoJiBaoMing.html");
}
//掉转到培训页面
function gotoPeiXun(){
	window.open("shiZiPeiXun.html");
}
//跳转到实验园
function gotoShiYanYuan(){
	window.open("shiYanYuan.html");
}

///////////////////////////////////////////////////////////////////////////////////////////////
//显示书籍列表
function showMoreBookList(){
	//跳转到显示书籍列表的页面
	window.open("showBookList.html");
}

///////////////////////////////////////////////////////////////////////////////////////////////////

//
function gotoUpdate(){
	window.open("update.html");
}

///////////////////////////////////////////////////////////////////////////////////////////

//
function gotoMiaoHongList(){
	window.open("showBookList.html?listID=7");
}

/////////////////////////////////////////////////////////////////////////////////////////

//
function gotoQHNet(){
	window.open("http://www.qhzd.cn");
}

//////////////////////////////////////////////////////////////////////////////////////

//
function gotoMingPaiFn(){
	window.open("showBookList.html?listID=8");
}


///////////////////////////////////////////////////////////////////////////////////////////

//
function gotoYouJiaoNet(){
	window.open("http://www.hnyjw.com.cn");
}

/////////////////////////////////////////////////////////////////////////////////////

//
function gotoDongTaiList(){
	window.open("showDongTaiList.html");
}

///////////////////////////////////////////////////////////////////////////////////////

//
function gotoWenZhangList(){
	window.open("showWZList.html");
}

//////////////////////////////////////////////////////////////////////////////////////////

//
function gotoDangLang(){
	window.open("http://www.danglang123.com/talentshow.php");
}

/////////////////////////////////////////////////////////////////////////////////////////

//
function xibaoOver(obj){
	obj.style.color = "#ff0000";
	obj.style.cursor = "pointer";
}
function xibaoOut(obj){
	obj.style.color = "#000000";
	obj.style.cursor = "auto";
}

////////////////////////////////////////////////////////////////////////////////////////////
//
function gotoPolice(){
	window.open("http://www.netpolice.gov.cn/wj/index.asp");
}

////////////////////////////////////////////////////////////////////////////////////////////

//上传文章
function submitWenZhang(){
	window.open("editor/index1.html");
}

//跳转到喜报小图页面
function gotoxibao_small(obj){
	window.open("xibao_small.html?id="+obj.id);
}

//打开更多喜报
function gotoMore(){
	window.open("xibaoMore.html");
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////

//查找用户上传的文章(一)
function chkSzpxNum(){
	//判断是否已经登陆
	var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/chkIsLogoed.asp";
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
		if(tempXMLHttpReq.readyState == 4){
			if(tempXMLHttpReq.status == 200){
				var temp1 = (unescape(tempXMLHttpReq.responseText));
				if(temp1 == "noLogoed"){
					//未登陆，则跳转回主页
					alert("您尚未登录！请先登录！");
					return;
				}else if(temp1 == "isLogoed"){
					//已登陆，则跳转到文章显列表示页面
					window.open("showSubmitWzList.html");
				}
			}
		}
	};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
}
/////////////////////////////////////////////////////////////////////////////////////

//获得最新的活动信息
function getLastHuoDong(){
	var tempXMLHttpReq = createXMLHttpRequest();
	var url = "asp/getLastHuoDong.asp";
	tempXMLHttpReq.open("GET",url,true);
	tempXMLHttpReq.onreadystatechange = function(){
		if(tempXMLHttpReq.readyState == 4){
			if(tempXMLHttpReq.status == 200){
				var temp = (unescape(tempXMLHttpReq.responseText)).split("#%#%#");
				if(temp[0]=="false"){
					alert(temp[1]);
				}else if(temp[0]=="true"){
					var temp1 = temp[1].split("#####");
					var tempStr = "";
					for(var i=0;i<temp1.length-1;i++){
						tempStr = tempStr + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + temp1[i];
					}
					document.getElementById("huoDongXunHuanContent").innerHTML=tempStr;
				}
			}
		}
	};
	//防止数据缓存
	tempXMLHttpReq.setRequestHeader("If-Modified-Since","0");
	tempXMLHttpReq.send(null);
}

/////////////////////////////////////////////////////////////////////////////////////

//发布活动
function faBuHuoDong(){
	window.open("faBuHuoDong.html");
}

///////////////////////////////////////////////////////////////////////////////////////

//师资培训鼠标轮换
function chgSzpxBtnOver(obj){
	var tempID = obj.id;
	var tempBtn001 = document.getElementById("szpxBtn_001");
	var tempBtn002 = document.getElementById("szpxBtn_002");
	var tempBtn003 = document.getElementById("szpxBtn_003");
	var tempBtn004 = document.getElementById("szpxBtn_004");
	
	if(tempID == "szpxBtn_001"){
		tempBtn001.className = "szpxBtn_001Over";
	}else if(tempID == "szpxBtn_002"){
		tempBtn002.className = "szpxBtn_002Over";
	}else if(tempID == "szpxBtn_003"){
		tempBtn003.className = "szpxBtn_003Over";
	}else if(tempID == "szpxBtn_004"){
		tempBtn004.className = "szpxBtn_004Over";
	}
}
function chgSzpxBtnOut(obj){
	var tempID = obj.id;
	var tempBtn001 = document.getElementById("szpxBtn_001");
	var tempBtn002 = document.getElementById("szpxBtn_002");
	var tempBtn003 = document.getElementById("szpxBtn_003");
	var tempBtn004 = document.getElementById("szpxBtn_004");
	
	if(tempID == "szpxBtn_001"){
		tempBtn001.className = "szpxBtn_001Normal";
	}else if(tempID == "szpxBtn_002"){
		tempBtn002.className = "szpxBtn_002Normal";
	}else if(tempID == "szpxBtn_003"){
		tempBtn003.className = "szpxBtn_003Normal";
	}else if(tempID == "szpxBtn_004"){
		tempBtn004.className = "szpxBtn_004Normal";
	}
}


///////////////////////////////////////////////////////////////////////////////////////

//教材展示轮换函数
function chgJiaoCaiContent(obj){
	var tempid = obj.id;
	var tuoFuYingYuDiv = document.getElementById("tuoFuYingYu");
	var peiPeiMiaoHongDiv = document.getElementById("peiPeiMiaoHong");
	var mingPaiXiaoXueDiv = document.getElementById("mingPaiXiaoXue");
	var yaSiDiv = document.getElementById("yaSi");
	var tuoFuYingYuContentDiv = document.getElementById("tuoFuYingYuContent");
	var peiPeiMiaoHongContentDiv = document.getElementById("peiPeiMiaoHongContent");
	var mingPaiXiaoXueContentDiv = document.getElementById("mingPaiXiaoXueContent");
	var yaSiContentDiv = document.getElementById("yaSiContent");
	
	if(tempid == "tuoFuYingYu"){
		tuoFuYingYuDiv.className = "tuoFuYingYu_over";
		peiPeiMiaoHongDiv.className = "peiPeiMiaoHong";
		mingPaiXiaoXueDiv.className = "mingPaiXiaoXue";
		yaSiDiv.className = "yaSi";
		tuoFuYingYuContentDiv.className = "tuoFuYingYuContent";
		peiPeiMiaoHongContentDiv.className = "dis_non";
		mingPaiXiaoXueContentDiv.className = "dis_non";
		yaSiContentDiv.className = "dis_non";
	}else if(tempid == "peiPeiMiaoHong"){
		tuoFuYingYuDiv.className = "tuoFuYingYu";
		peiPeiMiaoHongDiv.className = "peiPeiMiaoHong_over";
		mingPaiXiaoXueDiv.className = "mingPaiXiaoXue";
		yaSiDiv.className = "yaSi";
		tuoFuYingYuContentDiv.className = "dis_non";
		peiPeiMiaoHongContentDiv.className = "peiPeiMiaoHongContent";
		mingPaiXiaoXueContentDiv.className = "dis_non";
		yaSiContentDiv.className = "dis_non";
	}else if(tempid == "mingPaiXiaoXue"){
		tuoFuYingYuDiv.className = "tuoFuYingYu";
		peiPeiMiaoHongDiv.className = "peiPeiMiaoHong";
		mingPaiXiaoXueDiv.className = "mingPaiXiaoXue_over";
		yaSiDiv.className = "yaSi";
		tuoFuYingYuContentDiv.className = "dis_non";
		peiPeiMiaoHongContentDiv.className = "dis_non";
		mingPaiXiaoXueContentDiv.className = "mingPaiXiaoXueContent";
		yaSiContentDiv.className = "dis_non";
	}else if(tempid == "yaSi"){
		tuoFuYingYuDiv.className = "tuoFuYingYu";
		peiPeiMiaoHongDiv.className = "peiPeiMiaoHong";
		mingPaiXiaoXueDiv.className = "mingPaiXiaoXue";
		yaSiDiv.className = "yaSi_over";
		tuoFuYingYuContentDiv.className = "dis_non";
		peiPeiMiaoHongContentDiv.className = "dis_non";
		mingPaiXiaoXueContentDiv.className = "dis_non";
		yaSiContentDiv.className = "yaSiContent";
	}
}


///////////////////////////////////////////////////////////////////////////////////////////////

//AD01鼠标经过函数
function adMouseOver(obj){
	clearInterval(intervalID);
	var tempId = obj.id;
	var tempbtn1Div = document.getElementById("btn1Div");
	var tempbtn2Div = document.getElementById("btn2Div");
	var tempbtn3Div = document.getElementById("btn3Div");
	var tempbtn4Div = document.getElementById("btn4Div");
	var tempad1Div = document.getElementById("ad1Div");
	var tempad2Div = document.getElementById("ad2Div");
	var tempad3Div = document.getElementById("ad3Div");
	var tempad10Div = document.getElementById("ad10Div");
	if(tempId == "btn1Div"){
		tempad1Div.className = "ad1Div";
		tempad2Div.className = "disNon";
		tempad3Div.className = "disNon";
		tempad10Div.className = "disNon";
		tempbtn1Div.className = "btn1Div_over";
		tempbtn2Div.className = "btn2Div";
		tempbtn3Div.className = "btn3Div";
		tempbtn4Div.className = "btn4Div";
	}else if(tempId == "btn2Div"){
		tempad1Div.className = "disNon";
		tempad2Div.className = "ad2Div";
		tempad3Div.className = "disNon";
		tempad10Div.className = "disNon";
		tempbtn1Div.className = "btn1Div";
		tempbtn2Div.className = "btn2Div_over";
		tempbtn3Div.className = "btn3Div";
		tempbtn4Div.className = "btn4Div";
	}else if(tempId == "btn3Div"){
		tempad1Div.className = "disNon";
		tempad2Div.className = "disNon";
		tempad3Div.className = "ad3Div";
		tempad10Div.className = "disNon";
		tempbtn1Div.className = "btn1Div";
		tempbtn2Div.className = "btn2Div";
		tempbtn3Div.className = "btn3Div_over";
		tempbtn4Div.className = "btn4Div";
	}else if(tempId == "btn4Div"){
		tempad1Div.className = "disNon";
		tempad2Div.className = "disNon";
		tempad3Div.className = "disNon";
		tempad10Div.className = "ad10Div";
		tempbtn1Div.className = "btn1Div";
		tempbtn2Div.className = "btn2Div";
		tempbtn3Div.className = "btn3Div";
		tempbtn4Div.className = "btn4Div_over";
	}
	adTime();
}

//定时变换图片函数
function chgPicEveryTime(num){
	var tempbtn1Div = document.getElementById("btn1Div");
	var tempbtn2Div = document.getElementById("btn2Div");
	var tempbtn3Div = document.getElementById("btn3Div");
	var tempbtn4Div = document.getElementById("btn4Div");
	var tempad1Div = document.getElementById("ad1Div");
	var tempad2Div = document.getElementById("ad2Div");
	var tempad3Div = document.getElementById("ad3Div");
	var tempad10Div = document.getElementById("ad10Div");
	if(num == 1){
		tempad1Div.className = "ad1Div";
		tempad2Div.className = "disNon";
		tempad3Div.className = "disNon";
		tempad10Div.className = "disNon";
		tempbtn1Div.className = "btn1Div_over";
		tempbtn2Div.className = "btn2Div";
		tempbtn3Div.className = "btn3Div";
		tempbtn4Div.className = "btn4Div";
	}else if(num == 2){
		tempad1Div.className = "disNon";
		tempad2Div.className = "ad2Div";
		tempad3Div.className = "disNon";
		tempad10Div.className = "disNon";
		tempbtn1Div.className = "btn1Div";
		tempbtn2Div.className = "btn2Div_over";
		tempbtn3Div.className = "btn3Div";
		tempbtn4Div.className = "btn4Div";
	}else if(num == 3){
		tempad1Div.className = "disNon";
		tempad2Div.className = "disNon";
		tempad3Div.className = "ad3Div";
		tempad10Div.className = "disNon";
		tempbtn1Div.className = "btn1Div";
		tempbtn2Div.className = "btn2Div";
		tempbtn3Div.className = "btn3Div_over";
		tempbtn4Div.className = "btn4Div";
	}else if(num == 4){
		tempad1Div.className = "disNon";
		tempad2Div.className = "disNon";
		tempad3Div.className = "disNon";
		tempad10Div.className = "ad10Div";
		tempbtn1Div.className = "btn1Div";
		tempbtn2Div.className = "btn2Div";
		tempbtn3Div.className = "btn3Div";
		tempbtn4Div.className = "btn4Div_over";
	}
}

///////////////////////////////////////////////////////////////////////////////////////////////////

//
function adTime(){
	//AD01
	intervalID = window.setInterval(
		function(){
			if(tempNum == 1){
				tempNum = 2;
			}else if(tempNum == 2){
				tempNum = 3;
			}else if(tempNum == 3){
				tempNum = 4;
			}else if(tempNum == 4){
				tempNum = 1;
			}
			chgPicEveryTime(tempNum);
		},
		5000  //每 5 秒变换一次
	);
}

///////////////////////////////////////////////////////////////////////////////////////////

//主页打开时加载的函数
function loadFn(){
	//获取公告信息
	getGongGaoInfo();
	//向后台请求登录面板样式信息
    loadLogoPanel();
	//获取验证码
	getCode();
	//获取幼教动态
	requestYouJiaoDongTaiInfo();
	//获得最新文章信息
	getNewSubmitWZ();
	//获得最新飞播活动
	getLastHuoDong();
	//AD01
	adTime();
}
