function ImgAd(options) {
	if (!options) {
		options = {};
	}
	this.src = options.src;
	this.title = options.title || "";
	this.href = options.href;
	this.target = options.target || "_blank";
}
var ImgAdUtil = {imgAdArr:[], srcObj:null, titleObj:null, numAD:0, isInit:false, parentAObj:null, imgtimer:null, frequence:1000, start:function (id, titleId, frequence) {
	if (!this.isInit) {
		this.srcObj = document.getElementById(id);
		this.parentAObj = this.srcObj.parentNode;
		if (frequence && !isNaN(frequence)) {
			this.frequence = frequence;
		}
		if (titleId) {
			this.titleObj = document.getElementById(titleId);
		}
		this.isInit = true;
	}
	this.nextAD();
}, addImgAd:function (options) {
	this.imgAdArr.push(new ImgAd(options));
}, nextAD:function (num) {
	if (this.imgAdArr.length <= 0) {
		return;
	}
	clearTimeout(this.imgtimer);
	if (num && !isNaN(num)) {
		this.numAD = num;
	}
	this.setTransition();
	this.tranImage();
	this.playTransition();
	if (this.numAD >= this.imgAdArr.length - 1) {
		this.numAD = 0;
	} else {
		this.numAD++;
	}
	this.imgtimer = setTimeout("ImgAdUtil.nextAD()", this.frequence);
}, tranImage:function () {
	var imgAd = this.imgAdArr[this.numAD];
	this.srcObj.src = imgAd.src;
	this.srcObj.title = imgAd.title;
	if (this.titleObj) {
		this.titleObj.innerHTML = imgAd.title;
	}
	this.parentAObj.href = imgAd.href;
	this.parentAObj.target = imgAd.target;
}, setTransition:function () {
	if (document.all) {
		this.srcObj.filters.revealTrans.Transition = Math.floor(Math.random() * 23);
		this.srcObj.filters.revealTrans.apply();
	}
}, playTransition:function () {
	if (document.all) {
		this.srcObj.filters.revealTrans.play();
	}
}};


