// JavaScript Document
function fanzhuan(idstr,nowid,countid,nowclass)
{
	var i=1;
	for (i=1; i<=countid; i++)
	{
		if (i == nowid)
		{
			document.getElementById(idstr + i).className = nowclass;
			document.getElementById(idstr + "info" + i ).style.display = "block";
		}
		else
		{
			document.getElementById(idstr + i).className = "";
			document.getElementById(idstr + "info" + i ).style.display = "none";
		}
	}
}
function getID(obj){return document.getElementById(obj)}

var indexlist = new Array(
							  "<a href='/zhuanti/2010zhuanyefxh/' target='_blank'><img src='/usaindeximages/2011fxh1.jpg' alt='2011美国名校热门专业申请分析会' width='700' height='90' border='0' /></a>",
							  "<a href='/usazhaosheng/info/zhaosheng128.shtml' target='_blank'><img src='/usanewsimages/uc.jpg' alt='辛辛那提大学2011年招生' width='700' height='90' border='0' /></a>"
							  );
var indexwp = 0;
function indexbanner()
{
	if(indexwp>=indexlist.length)
		indexwp=0;
	getID("ggl").innerHTML = indexlist[indexwp];
	indexwp++;
	var dex = setTimeout("indexbanner()",5000);
}

function tvShow(obj,index,now,links,imgSrc,time){
	this.p=0;
	this.obj=getID(obj);
	if(time==null) this.time=4000;
	else this.time=time;
	this.index=getID(index);
	this.l=this.index.getElementsByTagName("li");
	this.showPicSetTime='';
	this.links=links.split("|");
	this.imgSrc=imgSrc.split("|");
	this.clickEvent=function(i,OBJ)
	{
		this.l[i].onclick=function(){OBJ.showPic(i,OBJ)};
	};
	this.overEvent=function(i,OBJ)
	{
		this.l[i].onmouseover=function(){OBJ.showPic(i,OBJ)};
	};
	this.setPara=function(e)
	{
		for(var i=0;i<this.l.length;i++)
		{
			switch(e)
			{
				case "click":
					this.clickEvent(i,this)
					break
				case "over":
					this.overEvent(i,this)
			}
		}
		this.zdshow();
	};
	this.showPic=function(n,OBJ)
	{
		clearTimeout(OBJ.showPicSetTime);
		if(OBJ.obj)
		{
			OBJ.obj.innerHTML="<a href=\""+OBJ.links[n]+"\" target=\"_blank\"><img src=\""+OBJ.imgSrc[n]+"\" border=\"0\" /></a>";
			for(var i=0;i<OBJ.l.length;i++)
			{
				 if(i == n) {OBJ.l[i].className = 'now'}else OBJ.l[i].className = '';
			};
			OBJ.p = n+1;
		}
		OBJ.showPicSetTime=setTimeout(function(){OBJ.zdshow()},OBJ.time);
	};
	this.zdshow=function()
	{
		var picL=this.l.length;
		if(this.p==picL) this.p = 0;
		if(this.obj)
		{
			this.l[this.p].className = now;
			this.showPic(this.p,this);
		}
	}
}
/*var t=500;
var height=0;
var gt=300;
var gheight=240;
function showads() //展开头部广告
{
	if(t>0)
	{
		t--;
		height=height+5;
	}
	else
		return;
	if (height>240)
		return;
	getID("topgg").style.display = "block";
	getID("topgg").style.height = height + "px";
	setTimeout("showads()",30);
}
function noneads()
{
	if (gt>0)
	{
		gt--;
		gheight=gheight-5;
	}
	else
		return;
	if (gheight<0)
	{
		getID("topgg").style.display = "none";
		return;
	}
	getID("topgg").style.height = gheight + "px";
	setTimeout("noneads()",30);
}
window.onload = function()
{
	showads();
	setTimeout("noneads()",15000);
}
*/