﻿// change menu
function changeMenu(id,tabName,conName,tabCount) {
for(i=0;i<=tabCount;i++) 
{
document.getElementById(tabName+i).style.backgroundImage="url(images/menu_bg01.jpg)";
document.getElementById(conName+i).style.display="none"; 
} 
document.getElementById(tabName+id).style.backgroundImage="url(images/menu_bg02.jpg)";
document.getElementById(conName+id).style.display="block"; 
}
//change tab
function changeTab(id,tabName,conName,tabCount) {
for(i=0;i<=tabCount;i++) 
{
document.getElementById(tabName+i).style.backgroundImage="url(../images/tab_def.jpg)";
document.getElementById(conName+i).style.display="none"; 
} 
document.getElementById(tabName+id).style.backgroundImage="url(../images/tab_act.jpg)";
document.getElementById(conName+id).style.display="block"; 
}
// change text
function changeText(id,tabName,conName,tabCount) {
for(i=1;i<=tabCount;i++) 
{
document.getElementById(tabName+i).style.color="#979797";
document.getElementById(conName+i).style.display="none"; 
} 
document.getElementById(tabName+id).style.color="#575757";
document.getElementById(conName+id).style.display="block"; 
}
//change industry tab
function changeInTab(id,tabName,conName,tabCount) {
for(i=0;i<=tabCount;i++) 
{
document.getElementById(tabName+i).style.backgroundImage="url(images/intab_def.jpg)";
document.getElementById(conName+i).style.display="none"; 
} 
document.getElementById(tabName+id).style.backgroundImage="url(images/intab_act.jpg)";
document.getElementById(conName+id).style.display="block"; 
}
//scroll auto
function ScroltdmgLeft(){ 
var speed = 20; 
var scroll_begin=document.getElementById("scroll_begin"); 
var scroll_end=document.getElementById("scroll_end"); 
var scroll_div=document.getElementById("scroll_div"); 
scroll_end.innerHTML=scroll_begin.innerHTML; 
function Marquee(){ 
if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0) 
scroll_div.scrollLeft-=scroll_begin.offsetWidth; 
else 
scroll_div.scrollLeft++ 
} 
var MyMar=setInterval(Marquee,speed); 
scroll_div.onmouseover=function(){clearInterval(MyMar)} 
scroll_div.onmouseout=function(){MyMar=setInterval(Marquee,speed)} 
} 

//DoSearch
function DoSearch()
{ 
var query = document.getElementById("query").value; 
var currSelectIndex = document.getElementById("searchSelect").selectedIndex; 
if(currSelectIndex == 0) {
location.href =  "http://www.ieredu.cn/news/list.ds?query="+query; 
}
else if(currSelectIndex == 1){
location.href =  "http://www.ieredu.cn/indu/list.ds?query="+query; 
}
else if(currSelectIndex == 2){
location.href =  "http://www.ieredu.cn/tech/list.ds?query="+query; 
}
else if(currSelectIndex == 3){
location.href =  "http://www.ieredu.cn/enter/list.ds?query="+query; 
}
else if(currSelectIndex == 4){
location.href =  "http://www.ieredu.cn/academe/list.ds?query="+query; 
}
else if(currSelectIndex == 5){
location.href =  "http://www.ieredu.cn/talent/list.ds?query="+query; 
}
else if(currSelectIndex == 6){
location.href =  "http://www.ieredu.cn/robot/list.ds?query="+query; 
}

}
