//巨人首页广告条的切换
//banner01显示下标
//var index_banner_01 = 0;
//var index_banner_02 = 0;
//var index_banner_03 = 0;
//banner01显示数量
//var count_banner_01 = 4;
//var count_banner_02 = 3;
//var count_banner_03 = 3;
//innerHTML数组
//var textVal_banner_01 = ["<a href='http://www.whjuren.com/huodong/2011wx/index.html'><img src='http://www.whjuren.com/style/images/banner_2011wx.jpg'  width='950' height='70' border='0' ></a>","<a href='http://www.whjuren.com/huodong/2011wh71/index.html'><img src='http://www.whjuren.com/style/images/banner_2011wh71.jpg'  width='950' height='70' border='0' ></a>","<a href='http://www.whjuren.com/huodong/2011wll/index.html'><img src='http://www.whjuren.com/style/images/banner_wll.jpg'  width='950' height='70' border='0' ></a>","<a href='http://www.whjuren.com/huodong/2011erzgy/index.html'><img src='http://www.whjuren.com/style/whjuren/images/banner_erzgy.jpg'  width='950' height='70' border='0' ></a>"]
//var textVal_banner_02 = ["<a href='http://www.whjuren.com/huodong/2011qjkcs/index.html'><img src='http://www.whjuren.com/style/images/banner_2011qjkcs.jpg' width='950' height='70' border='0' ></a>","<a href='http://www.whjuren.com/huodong/2011zxsqj/index.html'><img src='http://www.whjuren.com/style/images/banner_2011zxqj.jpg' width='950' height='70' border='0' ></a>","<a href='http://www.whjuren.com/huodong/xxsqj2011/index.html'><img src='http://www.whjuren.com/style/images/banner_2011xxsqj.jpg' width='950'  height='70' border='0'></a>"]
//var textVal_banner_03 = ["<a href='http://www.whjuren.com/huodong/2012hjkc/index.html'><img src='http://www.whjuren.com/style/images/2012hjkc.jpg' width='950' height='70' border='0' ></a>","<a href='http://www.whjuren.com/huodong/2012xsc/index.html'><img src='http://www.whjuren.com/style/images/2012xsc.jpg'  width='950' height='70' border='0' ></a>","<a href='http://www.whjuren.com/huodong/2012xsczt/xsc/index.html'><img src='http://www.whjuren.com/style/whjuren/images/banner_2012xsc.jpg'  width='950' height='70' border='0' ></a>"]
//function showBanner(id){
//	document.getElementById(id).innerHTML = textVal_banner_01[index_banner_01];
//	index_banner_01 ++;	
//	if(index_banner_01 >= count_banner_01){
//		index_banner_01 = 0;
//	}
//	setTimeout("showBanner('banner01')",3000);	
//}
//function showBanner2(id){
//	document.getElementById(id).innerHTML = textVal_banner_02[index_banner_02];
//	index_banner_02 ++;	
//	if(index_banner_02 >= count_banner_02){
//		index_banner_02 = 0;
//	}
//	setTimeout("showBanner2('banner02')",3000);	
//}
//function showBanner3(id){
//	document.getElementById(id).innerHTML = textVal_banner_03[index_banner_03];
//	index_banner_03 ++;	
//	if(index_banner_03 >= count_banner_03){
//		index_banner_03 = 0;
//	}
//	setTimeout("showBanner3('banner03')",3000);	
//}

//首页热班抢报
function getIndexHotClass(insert,gid,mid,course_join,course_feature,size,org_id){
var url="http://service.whjuren.com/whjr/courseCenter/IndexTypeQueryAction.do?method=queryByAjax&insert="+insert+"&gid="+gid+"&mid="+mid+"&course_join="+course_join+"&course_feature="+course_feature+"&size="+size+"&org_id="+org_id+"&callback=?";
var insert="";
$.getJSON(url,function(jsonContent){
var htmls="";
if(jsonContent.result!=null){
$.each(jsonContent.result,function(i,n){
if(n.id=='course'){
var vals=n.code;
var txts=n.text;
var count=n.count;
for(var j=0;j<vals.length;j++){
htmls+='<li><span class="hot">热度：'+count[j]+'</span><img src="http://www.whjuren.com/style/whjuren/images/no0'+(j+1)+'.gif"><a href="http://service.whjuren.com/whjr/course/view/'+vals[j]+'/'+vals[j]+'/////.html" target="_blank" class="a_333" title="'+txts[j]+'">'+txts[j].substring(0,22)+'</a></li>';}
}
if(n.id=='insert'){
var vals=n.code;var txts=n.text;
for(var j=0;j<vals.length;j++){
insert=vals[j];}}});
document.getElementById(insert).innerHTML=htmls;
}});
}

//列表及内容页热班抢报
function indexHotClass(insert,gid,mid,course_join,course_feature,size,org_id){
var url="http://service.whjuren.com/whjr/courseCenter/IndexTypeQueryAction.do?method=queryByAjax&insert="+insert+"&gid="+gid+"&mid="+mid+"&course_join="+course_join+"&course_feature="+course_feature+"&size="+size+"&org_id="+org_id+"&callback=?";
var insert="";$.getJSON(url,function(jsonContent){
var htmls="";
if(jsonContent.result!=null){
htmls='';
$.each(jsonContent.result,function(i,n){if(n.id=='course'){
var vals=n.code;
var txts=n.text;
var count=n.count;
for(var j=0;j<vals.length;j++){
htmls+='<li><a href="http://service.whjuren.com/whjr/course/view/'+vals[j]+'/'+vals[j]+'/////.html" target="_blank" title="'+txts[j]+'">· '+txts[j].substring(0,20)+'</a></li>';
}
}
if(n.id=='insert'){
var vals=n.code;
var txts=n.text;
for(var j=0;j<vals.length;j++){
insert=vals[j];
}}});
document.getElementById(insert).innerHTML=htmls;
}});
}

//加载邮件订阅
function loadSelect(){
var options="";
var div="<select name='st_id' id='st_id' style='width:115px; line-height:20px; height:20px;vertical-align:middle; font-size:12px;margin-right:5px;'>";
var url="http://service.whjuren.com/whjr/front/FrontGetSTAction.do?callback=?";
jQuery.getJSON(url,function(jsonContent){
jQuery.each(jsonContent.key,function(i,n){
options=options+"<option value="+n.st_id+">"+n.st_name+"</option>";});
options=options+"</select></td>";
var ss=document.getElementById('subscript');
div+=options;
div+="<input type='text' onclick='cleans();' name='sd_email' id='sd_email' value='请输入邮箱地址' onblur='showText();' style='width:140px;color:#666;height:18px;line-height:18px; border:1px solid #819FBA; vertical-align:middle;' ><p><a href='#' onclick='dingyue()'><img src='http://www.whjuren.com/style/whjuren/images/email_btn.gif' style='border:none;'></a></p>";
$(ss).html(div);
});
}
//点击邮件订阅
function dingyue(){
var url='http://service.whjuren.com/whjr/front/FrontDingyueAction.do?sd_email='+$("#sd_email").val()+'&st_id='+$("#st_id").val()+'&callback=?';
jQuery.getJSON(url,function(jsonContent){
$.each(jsonContent.key,function(i,n){
asyncbox.error(n.email,'');	
});
});
}
//失去焦点时提示信息
function showText(){
if(document.getElementById("sd_email").value==''){
    document.getElementById("sd_email").value="请输入邮箱地址";
}
}
function cleans(){
document.getElementById("sd_email").value="";
}

﻿﻿//全站搜索
function searchKey(){
var keyword=document.getElementById("keyword").value;
if(keyword=="关键字搜索"){
keyword="";
}
var url="http://www.whjuren.com/whjuren.html?wd="+keyword;
var form=document.getElementById("research");
form.action=url;form.submit();
}
//课程搜索单击文本输入框清空
﻿function clean(){
document.qlike.teacher.value="";
}
//课程搜索中文本输入框失去焦点时显示提示信息
function showTishi(){
   if(document.qlike.teacher.value==''){
    document.qlike.teacher.value="请输入教师、课程关键字";
    }
}
//查询课程
function queryCourse(){
var form=document.getElementById("qlike");
var teacher=form.teacher.value;
var org_id="";
if(form.org_id){org_id=form.org_id.value;}
if(form.teacher_name.value=="请输入教师、课程关键字"){
form.teacher_name.value="";
}
var url="http://service.whjuren.com/whjr/courseCenter/CourseCenterAction.do?teacher="+escape(teacher)+"&org_id="+org_id;
url=encodeURI(url);
url=encodeURI(url);
form.action=url;
form.method.value="query";
form.target='_blank';
form.submit();
}

﻿//文章详细页的分享
function shareIt(media){
var location=window.location.href;
var title=document.title;
switch(media){
case"tencent":
window.open("http://v.t.qq.com/share/share.php?title="+title+"&url="+location,"_blank","");
break;
case"sina":
window.open("http://v.t.sina.com.cn/share/share.php?url="+location+"&title="+title,"_blank","");
break;
case"douban":
window.open("http://www.douban.com/recommend/?url="+location+"&title="+title+"&comment="+encodeURIComponent("武汉巨人教育网"),"_blank","");
break;case"renren":
window.open("http://share.renren.com/share/buttonshare.do?link="+location+"&title="+title,"_blank","");
break;case"kaixin":
window.open("http://www.kaixin001.com/~repaste/repaste.php?rtitle="+title+"&rurl="+location+"&rcontent="+escape("武汉巨人教育网"),"_blank","");
break;
default:
break;
}}
function postToWb(){
var _t=encodeURI(document.title);
var _url=encodeURIComponent(document.location);
var _appkey=encodeURI("4d31efad8658481ba9774767a929cc18");
var _pic=encodeURI('');
var _site='';
var _u='http://v.t.qq.com/share/share.php?title='+_t+'&url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic;
window.open(_u,'','width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
}

//首页变色标题title
function showFullTitle(id,fulltitle){
	var topic1=document.getElementById("topic1").innerHTML;
	var topic2=document.getElementById("topic2").innerHTML;
	var topic3=document.getElementById("topic3").innerHTML;
	var topic4=document.getElementById("topic4").innerHTML;
	var topic5=document.getElementById("topic5").innerHTML;
	var topic6=document.getElementById("topic6").innerHTML;
	var topic7=document.getElementById("topic7").innerHTML;
	if(id=="1"&&topic1.substring(0,5)=="<font"){alert(topic1.substring(0,21));
		document.getElementById("topic1").innerHTML=topic1.substring(0,21)+" title='"+fulltitle+"'>"+topic1.substr(22,topic1.indexOf("</font>")-22)+"</font>";
	}
	if(id=="2"&&topic2.substring(0,5)=="<font"){
		document.getElementById("topic2").innerHTML=topic2.substring(0,21)+" title='"+fulltitle+"'>"+topic2.substr(22,topic2.indexOf("</font>")-22)+"</font>";
	}
	if(id=="3"&&topic3.substring(0,5)=="<font"){
		document.getElementById("topic3").innerHTML=topic3.substring(0,21)+" title='"+fulltitle+"'>"+topic3.substr(22,topic3.indexOf("</font>")-22)+"</font>";
	}
	if(id=="4"&&topic4.substring(0,5)=="<font"){
		document.getElementById("topic4").innerHTML=topic4.substring(0,21)+" title='"+fulltitle+"'>"+topic4.substr(22,topic4.indexOf("</font>")-22)+"</font>";
	}
	if(id=="5"&&topic5.substring(0,5)=="<font"){
		document.getElementById("topic5").innerHTML=topic5.substring(0,21)+" title='"+fulltitle+"'>"+topic5.substr(22,topic5.indexOf("</font>")-22)+"</font>";
	}
	if(id=="6"&&topic6.substring(0,5)=="<font"){
		document.getElementById("topic6").innerHTML=topic6.substring(0,21)+" title='"+fulltitle+"'>"+topic6.substr(22,topic6.indexOf("</font>")-22)+"</font>";
	}
	if(id=="7"&&topic7.substring(0,5)=="<font"){
		document.getElementById("topic7").innerHTML=topic7.substring(0,21)+" title='"+fulltitle+"'>"+topic7.substr(22,topic7.indexOf("</font>")-22)+"</font>";
	}
}

function backTitle(id,fulltitle){
	var topic1=document.getElementById("topic1").innerHTML;
	var topic2=document.getElementById("topic2").innerHTML;
	var topic3=document.getElementById("topic3").innerHTML;
	var topic4=document.getElementById("topic4").innerHTML;
	var topic5=document.getElementById("topic5").innerHTML;
	var topic6=document.getElementById("topic6").innerHTML;
	var topic7=document.getElementById("topic7").innerHTML;
	if(id=="1"&&topic1.substring(0,5)=="<font"){
		document.getElementById("topic1").innerHTML=topic1.substring(0,21)+" title='"+fulltitle+"'>"+topic1.substr(22,topic1.indexOf("</font>")-22)+"</font>";
	}
	if(id=="2"&&topic2.substring(0,5)=="<font"){
		document.getElementById("topic2").innerHTML=topic2.substring(0,21)+" title='"+fulltitle+"'>"+topic2.substr(22,topic2.indexOf("</font>")-22)+"</font>";
	}
	if(id=="3"&&topic3.substring(0,5)=="<font"){
		document.getElementById("topic3").innerHTML=topic3.substring(0,21)+" title='"+fulltitle+"'>"+topic3.substr(22,topic3.indexOf("</font>")-22)+"</font>";
	}
	if(id=="4"&&topic4.substring(0,5)=="<font"){
		document.getElementById("topic4").innerHTML=topic4.substring(0,21)+" title='"+fulltitle+"'>"+topic4.substr(22,topic4.indexOf("</font>")-22)+"</font>";
	}
	if(id=="5"&&topic5.substring(0,5)=="<font"){
		document.getElementById("topic5").innerHTML=topic5.substring(0,21)+" title='"+fulltitle+"'>"+topic5.substr(22,topic5.indexOf("</font>")-22)+"</font>";
	}
	if(id=="6"&&topic6.substring(0,5)=="<font"){
		document.getElementById("topic6").innerHTML=topic6.substring(0,21)+" title='"+fulltitle+"'>"+topic6.substr(22,topic6.indexOf("</font>")-22)+"</font>";
	}
	if(id=="7"&&topic7.substring(0,5)=="<font"){
		document.getElementById("topic7").innerHTML=topic7.substring(0,21)+" title='"+fulltitle+"'>"+topic7.substr(22,topic7.indexOf("</font>")-22)+"</font>";
	}
}
