file://* function settimer(){
file://* adver.floatscroll();
file://* adver1.floatscroll();
file://* settimeout("settimer()",80);
file://* }
file://***********************************************************************************
function adverclass(){
var objname="";
var imagetype=0;
var imagewidth=imageheight=0;
var itop=ileft=0;
var topflag=leftflag=false;
var divid=0,objdiv=null;
var offwidth=offheight=0;
var width=document.body.clientwidth;
var height=document.body.clientheight;
var delay=30; file://时间的延迟值
var topstep=2,leftstep=3; file://一步跨多少
var inter;
file://此处是当外部不设置divid的值能够确保层的id是唯一
divid=math.round(math.random()*100000)
file://广告的类型 0=普通图片 1=flash广告图片
this.setimagetype=function(stype){
if(stype!=1&&stype!=0){stype=0;}
imagetype=stype;
}
file://外部调用的变量名
this.setobjname=function(sname){objname=sname;}
file://广告图片的高度与宽度
this.setimagepx=function(iwidth,iheight){
if(!isnan(iwidth)){
imagewidth=iwidth;
}else{
imagewidth=0;
}
if(!isnan(iheight)){
imageheight=iheight;
}else{
imageheight=0;
}
}
file://设置广告所在层的id值
this.setdivid=function(idiv){divid=idiv;}
file://主函数,显示广告代码
this.showadver=function(adimgsrc,adhref,adtitle){
if(imagetype==0){
showimagehtml(adimgsrc,adhref,adtitle);
}else{
showflashhtml(adimgsrc,adhref,adtitle);
}
eval("objdiv=document.all.img"+divid+";");
file://取得图片的宽度
offwidth=objdiv.offsetwidth;
offheight=objdiv.offsetheight;
file://随机显示广告的开始位置
ileft=math.round(math.random()*(width-offwidth));
itop=math.round(math.random()*(height-offheight));
objdiv.style.pixelleft=ileft;
objdiv.style.pixeltop=itop;
file://定时开始
file://starttimer();
}
file://主函数,漂浮游动显示广告
this.floatscroll=function(){
var irnd;
irnd=math.round(math.random()*100); file://此值是为了能使多图显示时产生不同的轨迹