转载请注明出处 http://jjs-love.iteye.com
<html>
<head>
<SCRIPT>
var imgpath='<Element context="current" type="content" key="DisplayImage"/>';
var imgpath1='<Element context="current" type="content" key="DisplayImage1"/>';
var imgpath2='<Element context="current" type="content" key="DisplayImage2"/>';
var urlpath=imgpath.substring(0,imgpath.lastIndexOf("?")+12);
var urlpath1=imgpath1.substring(0,imgpath1.lastIndexOf("?")+12);
var urlpath2=imgpath2.substring(0,imgpath2.lastIndexOf("?")+12);
//var name=urlpath.substring(urlpath.lastIndexOf("/")+1,urlpath.length);
var imgname=urlpath.substring(urlpath.indexOf("=")+2,imgpath.length);
var imgname1=urlpath1.substring(urlpath1.indexOf("=")+2,imgpath1.length);
var imgname2=urlpath2.substring(urlpath2.indexOf("=")+2,imgpath2.length);
var imgUrl=new Array(); ///图片地址
var imgLink=new Array(); ///链接地址
var title = new Array(); ///标题
var ltype = new Array(); ///类型 1 图片新闻 2Flash 3流媒体
var adNum=0;
var theTimer;
var iCount = 3;
imgUrl[1]=imgname;
imgLink[1]="081001.htm";
title[1]="国庆节贺卡";
ltype[1] = 2;
imgUrl[2]=imgname1;
imgLink[2]="0712liuxiang.swf";
title[2]="热列祝贺刘翔打破世界记录!";
ltype[2] = 2;
imgUrl[3]=imgname2;
imgLink[3]="0712liuxiang.swf";
title[3]="打破世界记录!";
ltype[3] = 2;
</SCRIPT>
</head>
<body TEXT="Black" BGCOLOR="White" BACKGROUND="" LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0">
<IMG style="BORDER-LEFT-COLOR: black; FILTER: revealTrans(duration=2,transition=120); BORDER-BOTTOM-COLOR: black; COLOR: #000000; BORDER-TOP-COLOR: black; BORDER-RIGHT-COLOR: black"
height=150 src="" width=248 border=0
name="imgInit" id="imgInitId">
<DIV id="xhId"></DIV>
<DIV id="tiId"></DIV>
<script>
var imgInit=document.getElementById("imgInitId");
var xh=document.getElementById("xhId");
var ti=document.getElementById("tiId");
var imgPre=new Array();
var j=0;
for (i=1;i<=iCount;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
j++;
} else {
break;
}
}
nextAd();
function playTran(){
if (document.all){
imgInit.filters[0].play();
}
}
function nextAd(){
if(adNum<j)adNum++ ;
else adNum=1;
if (document.all){
imgInit.filters[0].Transition=26;
imgInit.filters[0].apply();
}
imgInit.src=imgUrl[adNum];
var tablestring = "";
tablestring = "<table width=" + 16*iCount + " height=\"16\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#003399\">";
tablestring += "<tr>";
tablestring += "<td bgcolor=\"#FFFFFF\">";
tablestring += "<table width=" + 16*iCount + " height=\"16\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
for (i=1;i<=iCount;i++) {
if (i == adNum) {
tablestring += "<td height=\"16\" width=\"16\" bgcolor=\"#FFAA00\">";
tablestring += "<div align=\"center\" ><a href=\"javascript:;\" onclick=\"javascript:clearTimeout(theTimer);adNum=" + (i-1) + ";nextAd();\">" + i + "</a></div></td>";
}
else{
tablestring += "<td height=\"16\" width=\"16\" bgcolor=\"#FFFFFF\">";
tablestring += "<div align=\"center\"><a href=\"javascript:;\" onclick=\"javascript:clearTimeout(theTimer);adNum=" + (i-1) + ";nextAd();\">" + i + "</a></div></td>";
}
if (i!=iCount) {
tablestring += "<td width=\"1\" ></td>";
}
}
tablestring += "</tr></table>";
tablestring += "</td>";
tablestring += "</tr>";
tablestring += "</table>";
xh.innerHTML = tablestring;
ti.innerHTML = "<IMG SRC=\"dog2.jpg\" WIDTH=\"9\" HEIGHT=\"9\"> <a target=\"_blank\" href=\"" + imgLink[adNum] + "\">" + title[adNum] + "</a> <img WIDTH=\"13\" HEIGHT=\"13\" src=\"./" + ltype[adNum] + ".gif\" border=\"0\">";
playTran();
theTimer=window.setTimeout("nextAd()", 6000);
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')
window.open(jumpUrl,jumpTarget);
else
location.href=jumpUrl;
}
}
</script>
<Element context="current" type="content" key="DisplayImage"/>
</body>
</html>