// AD Banner object
function ADBanner(){
this.htmlcode  = "";// Non image banner's html code
this.href      = "";// Link's href attrib
this.imgsrc    = "";// Image's src attrib
this.imgwidth  = "";// Image's width attrib
this.imgheight = "";// Image's height attrib
this.imgalt    = "";// Image's alt attrib
this.imgborder = "";// Image's border attrib
this.weight    = 1;// Banner's show weight
this.place     = 1// Banner's place
this.type      = 1;// Banner's type
}
// Make Banner objects array
function CreatBanners(aBanners, aNum){
for( var i=0; i<aNum; i++ ){
aBanners[i] = new ADBanner();
}
}
// Show banner
function showbanner(aPlace, aType, aBannerID)
{
var amount = ADBanners.length;
var includeList = new Array(amount);
if (!document.usedBanners){
document.usedBanners = new Array(amount);
for (var i=0; i<amount; i++)
document.usedBanners[i] = -1;
}
var usedList = document.usedBanners;
if (arguments.length == 2){
var j = 0;
var sum = 0;
for(var i=0; i<amount; i++){
if (ADBanners[i].place == aPlace && ADBanners[i].type == aType){
if (usedList[i] != i){
includeList[j] = i;
j++;
sum = sum + ADBanners[i].weight;
 }
}
}
if (sum <= 0)
return;
var rndNum = Math.round(Math.random() * sum);
i = 0;
j = 0;
while (true) {
j = j + ADBanners[includeList[i]].weight;
if (j >= rndNum)
break;
i++;
 }
i = includeList[i];
}
else{
if (aBannerID >= 0 && aBannerID < amount)
i = aBannerID;
else
return;
 }
usedList[i] = i;
if (ADBanners[i].htmlcode == "")
document.write('<A HREF="'+ ADBanners[i].href +'" target=_blank><IMG SRC="'+ ADBanners[i].imgsrc +'" WIDTH="'+ ADBanners[i].imgwidth +'" HEIGHT="'+ ADBanners[i].imgheight +'" ALT="'+ ADBanners[i].imgalt +'" BORDER="'+ ADBanners[i].imgborder +'"></A>');
else
document.write(ADBanners[i].htmlcode);
}
var ADBanners = new Array();
CreatBanners(ADBanners,2);
ADBanners[0].htmlcode  = '<script type="text/javascript"><!--<br>google_ad_client = "pub-8647440215621124";<br>/* 120x90, 创建于 08-11-18 */<br>google_ad_slot = "7958575618";<br>google_ad_width = 120;<br>google_ad_height = 90;<br>//--><br></script><br><script type="text/javascript"<br>src="http://pagead2.googlesyndication.com/pagead/show_ads.js"><br></script>';ADBanners[0].weight    = 1;ADBanners[0].place= 2;ADBanners[0].type = 2;ADBanners[1].imgsrc    = "http://www.cept.cn//manage/newhtml/newsfile/200732238055720.gif";ADBanners[1].href = "http://www.cept.cn/2009hbz/2009.asp";ADBanners[1].imgwidth  = "468";ADBanners[1].imgheight = "60";ADBanners[1].imgalt    = "2009高校环保周";ADBanners[1].weight    = 1;ADBanners[1].place= 1;ADBanners[1].type = 1;
