
var imgWidth=216;              //图片宽
var imgHeight=180;             //图片高
var textFromHeight=0;         //焦点字框高度 (单位为px)
var textStyle="f12";           //焦点字class style (不是连接class)
var textLinkStyle="p1"; //焦点字连接class style
var buttonLineOn="#f60";           //button下划线on的颜色
var buttonLineOff="#000";          //button下划线off的颜色
var TimeOut=6000;              //每张图切换时间 (单位毫秒);
var itime=new Array();
var adNum=0;
var agent = navigator.userAgent.toLowerCase();
//焦点字框高度样式表 开始
document.write("<style type=\"text/css\">");
document.write("#focuseFrom{width:"+(imgWidth+2)+";margin:4px 0 0 2px;padding:0px;height:"+(imgHeight+textFromHeight)+"px;overflow:hidden;}");
document.write("#imgTitle{width:"+imgWidth+";top:-"+(textFromHeight+16)+"px;height:18px}");
document.write("</style>");
document.write("<div id=\"focuseFrom\">");
//焦点字框高度样式表 结束

function changeimg(n)
{
	adNum=n;
	window.clearInterval(theTimer);
	adNum=adNum-1;
	nextAd();
}
function goUrl(){
window.open(imgLink[adNum],'_blank');
}

var count=0;
for (i=1;i<5;i++) {
	if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgtext[i]!="")&&(imgAlt[i]!="") ) {
		count++;
	} else {
		break;
	}
}
function playTran(){
	//if (document.all)
	//	imgInit.filters.revealTrans.play();		
}
var key=0;
	function GetObj(objName){
		if(document.getElementById){
			return eval('document.getElementById("' + objName + '")');
		}else if(document.layers){
			return eval("document.layers['" + objName +"']");
		}else{
			return eval('document.all.' + objName);
		}
	}
function nextAd(){
	if(adNum<count)adNum++ ;
	else adNum=1;
	
	if (agent.indexOf("msie")!=-1){
		//imgInit.filters.revealTrans.Transition=24;
		//imgInit.filters.revealTrans.apply();
		playTran();
    }
	GetObj("slideTitle").innerHTML = imgtext[adNum];
	document.images.imgInit.src=imgUrl[adNum];
	document.images.imgInit.alt=imgAlt[adNum];	
	document.getElementById('link'+adNum).style.background=buttonLineOn;
	for (var i=1;i<=count;i++)
	{
	   if (i!=adNum){document.getElementById('link'+i).style.background=buttonLineOff;}
	}	
	theTimer=setTimeout("nextAd()", TimeOut);
}
document.write('<a target=_self href="javascript:goUrl()"><img src='+imgUrl[1]+' width='+imgWidth+' height='+imgHeight+' vspace="0" id=imgInit class="imgClass"></a>');
document.write('<div id="imgTitle">');
document.write(' <div id="imgTitle_down"> <a class="trans"></a>');
//数字按钮代码开始
for(var i=1;i<5;i++){document.write('<a id="link'+i+'" target="_self" href="javascript:changeimg('+i+')" class="button" style="cursor:hand" onFocus="this.blur()">'+i+'</a>');}
//数字按钮代码结束
document.write("</div>");
document.write("</div>");
document.write("</div>");
document.write("<div id=\"slideTitle\"></div>")
nextAd();