function blendon(zhi,num,st)
{
	for(var i=1;i<num+1;i++)
	{
		G("tabcontent"+st+i).style.display = "none";
		G("tablink"+st+i).className = "";
	}
	G("tabcontent"+st+zhi).style.display = "block";
	G("tablink"+st+zhi).className = "red tobe";
}
function G(tagid)
{
	return document.getElementById(tagid);
}
function showad(zhi,auto)
{
	if(auto==0)
	{
		clearInterval(aplay);
		jishi = 0;
		clearInterval(hfaplay);
		hfaplay = setInterval(hfauto,1000);
	}
	cplay = zhi;
	var tagid = "pic"+zhi;
	for(i=1;i<5;i++)
	{
		G("pic"+i).style.display = "none";
		G("spic"+i).className = "";

	}
	G("pic"+zhi).style.display = "block";
	G("spic"+zhi).className = "modern";
	try
	{
		G(tagid).filters.alpha.opacity =0;
		G(tagid).style.display="block";	
		Calpha(tagid,100,true);
	}catch(e)
	{
		Calpha(tagid,100,true);
	}
}
//变化透明度
var alphanum = 15;  //变化透明度
var timenum = 1; //执行频率
function Calpha(obj,alpha,fd)
{
	try
	{
		//alert(G(obj).filters.alpha.opacity);
	if( G(obj).filters.alpha.opacity!=alpha )
	{
		var fun = "Calpha('"+obj+"',"+alpha+","+fd+");";
		//alert(fun);
		if(fd)
		{
			G(obj).style.display="block";
			G(obj).filters.alpha.opacity = G(obj).filters.alpha.opacity+alphanum;
			if(G(obj).filters.alpha.opacity<100)
			{
				setTimeout(fun,timenum);
			}
		}else
		{
			G(obj).filters.alpha.opacity = G(obj).filters.alpha.opacity-alphanum;
			if(G(obj).filters.alpha.opacity>0)
			{
				setTimeout(fun,timenum);
			}else
			{
				G(obj).style.display = "none";
			}
		}
		
	}
	}catch(e)
	{
		//alert(e);
		if(fd)
		{
			G(obj).style.display = "block";
		}else
		{
			G(obj).style.display = "none";
		}
	}
}
var cplay = 1;  //当前播放
var aplay;   //自动播放
var hfaplay; //恢复自动播放记时器
var autotime = 5000; //自动播放间隔时间
var hftime = 20;  //多少时间恢复自动 秒
function autoplay()
{
	cplay++;
	if(cplay==5)
	{
		cplay = 1;
	}
	showad(cplay,1);
}
var jishi =1;  //记时 20秒后自动恢复
function hfauto()
{
	jishi =jishi+1;
	if(jishi>hftime)
	{
		clearInterval(hfaplay);
		aplay = setInterval(autoplay,autotime);
	}
}
aplay = setInterval(autoplay,autotime);
