<!--  AD rotator script written entirely in JavaScript  -->
<!--  Written by WenWei, 2002/03/03. E-mail: wenwei@blueidea.com  -->
<!--  ASP 2 JS Written by Ð¡ºÉ, 2003/05/28. E-mail: aston314@sohu.com  -->
<!--  Member Of Blueidea Web Team. -->
<!--  Welcome to www.blueidea.com. -->

// 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, 1);

//ÍøÒ×ËÑË÷
ADBanners[0].htmlcode	= '<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center"><tr valign="bottom"><td><iframe border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="no" width="100%" height="40" src="../include/search.html"></iframe></td></tr></table>';
ADBanners[0].weight		= 10;
ADBanners[0].place		= 1;
ADBanners[0].type		= 1;
