var imgWidth=900;              //图片宽
var imgHeight=230;             //图片高
var textFromHeight=0;         //焦点字框高度 (单位为px)
var textStyle="bt_link";           //焦点字class style (不是连接class)
var textLinkStyle="FONT"; //焦点字连接class style
var buttonLineOn="#ce0609";           //button下划线on的颜色
var buttonLineOff="#000";          //button下划线off的颜色
var TimeOut=5000;              //每张图切换时间 (单位毫秒);
var imgUrl=new Array(); 
var imgLink=new Array();
var adNum=0;
var theTimer=0;
//焦点字框高度样式表 开始
document.write('<style type="text/css">');
document.write('#focuseFrom{width:'+(imgWidth+2)+';margin: 0px; padding:0px;height:'+(imgHeight+textFromHeight)+'px; overflow:hidden;}');
document.write('#txtFrom{height:'+textFromHeight+'px;line-height:'+textFromHeight+'px;width:'+imgWidth+'px;overflow:hidden;}');
document.write('#imgTitle{width:'+imgWidth+';top:-'+(textFromHeight+12)+'px;height:18px}');
document.write('</style>');
document.write('<div id="focuseFrom">');
//焦点字框高度样式表 结束

imgUrl[1] ='images/1.jpg';
imgLink[1]='#';
imgUrl[2] ='images/2.jpg';
imgLink[2]='#';
imgUrl[3] ='images/3.jpg';
imgLink[3]='#';
imgUrl[4] ='images/4.jpg';
imgLink[4]='#';
imgUrl[5] ='images/5.jpg';
imgLink[5]='#';
			var intPage =0;
			for (var i=1;i<=imgUrl.length;i++)
			{
				if (imgUrl[i]!="!!!")
				{
					intPage++;
				}
			}
			function changeimg(n)
			{
				adNum=n;
				window.clearInterval(theTimer);
				adNum=adNum-1;
				nextAd();
			}
			function goUrl(){
			window.open(imgLink[adNum]);
			}
			//NetScape开始
			if (navigator.appName == "Netscape")
			{
			document.write('<style type="text/css">');
			document.write('.buttonDiv{height:4px;width:21px;}');
			document.write('</style>');
			function nextAd(){
				if(adNum<(intPage-1))adNum++;
				else adNum=1;
				theTimer=setTimeout("nextAd()", TimeOut);
				document.images.imgInit.src=imgUrl[adNum];
				document.getElementById('link'+adNum).style.background=buttonLineOn;
				document.getElementById('imgLink').href=imgLink[adNum];
				for (var i=1;i<=intPage;i++)
				{
				   if (i!=adNum){document.getElementById('link'+i).style.background=buttonLineOff;}
				}	
			}
				document.write('<a id="imgLink" href="'+imgLink[1]+'"class="p1"><img src="imgUrl[1]" name="imgInit" border=1 class="imgClass" Width="'+imgWidth+'" Height="'+imgHeight+'"></a>')
				document.write('<div id="imgTitle">');
				document.write('<div id="imgTitle_down">');
			//数字按钮代码开始
			for(var i=1;i<intPage;i++){document.write('<a href="javascript:changeimg('+i+')" class="button" style="cursor:hand">'+i+'</a>');}
			//数字按钮代码结束
				document.write('</div>');
				document.write('</div>');
				document.write('</div>');
				nextAd();
			}
			//NetScape结束
			//IE开始
			else
			{
			var count=0;
			for (i=1;i<intPage;i++) {
				if( (imgUrl[i]!="") && (imgLink[i]!="")) {
					count++;
				} else {
					break;
				}
			}
			function playTran(){
				if (document.all)
					document.images.imgInit.filters.BlendTrans.play();		
			}
			var key=0;
			function nextAd(){
				if(adNum<count)adNum++ ;
				else adNum=1;
				
				if( key==0 ){
					key=1;
				} else if (document.all){
					//imgInit.filters.revealTrans.Transition=6;
					document.images.imgInit.filters.BlendTrans.apply();
					   playTran();
			    }
				document.images.imgInit.src= imgUrl[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;}
				}	
				//links_ie_font.links=imglink[adNum];
				theTimer=setTimeout("nextAd()", TimeOut);
			}
			document.write('<a target=_self href="javascript:goUrl()"><img style="FILTER: BlendTrans ( duration=1 );" src="javascript:nextAd()" border=0 vspace="0" name=imgInit class="imgClass" Width="'+imgWidth+'" Height="'+imgHeight+'"></a>');
			document.write('<div id="txtFrom"><a target=_self href="javascript:goUrl()"><span id="focustext" class="'+textStyle+'"></span></a></div>');
			document.write('<div id="imgTitle">');
			document.write('<div id="imgTitle_down">');
			for(var i=intPage-1;i>=1;i--){document.write('<a id="link'+i+'"  href="javascript:changeimg('+i+')" class="button" style="cursor:hand;float:right" onFocus="this.blur()">'+i+'</a>');}
			document.write(' <a class="trans"" style="float:right"><img src="http://www.webjx.com/upfiles/20070726/20070726203802_3.gif" border=0></a>');
			//数字按钮代码开始
			
			//数字按钮代码结束
			document.write('</div>');
			document.write('</div>');
			document.write('</div>');
changeimg(1);
			}
			//IE结束