/*
定义一个图片轮转广告类:
*/
function FlashAdd(objname){
	this.name=objname;//对象名
	this.speed=4;// 秒/次
	this.step=0;//起步图
	this.width=280;
	this.height=254;
	this.titlewidth=280;
	this.titleheight=0;
	this.MainStyle='width:'+this.width+'px;height:'+this.height+'px;';
	this.TitleStyle='width:'+this.titlewidth+'px;height:'+this.titleheight+'px;font-size:0px;color:#000000;';
	this.FlashAry=new Array();
	this.showhtml=function(_RongQi){
		var str='';
		if(this.name==''){alert('请先定义对象名!');return;}
		str='<div id="" style="'+this.MainStyle+'"><div><a href="javascript:'+this.name+'.slidelink()" onMouseover="window.status=\'Click on the image to learn more about it!\';return true" onMouseout="window.status=\'\'">';
		if (this.FlashAry.length<=0){
			str+='<img src="'+this.imgsrc+'" name="'+this.name+'_slide" id="'+this.name+'_slide" width="0" height="0" border=0 style="filter:blendTrans(duration=3)">';
			str+='<BR></div><div id="'+this.name+'_title" align="center" style="'+this.TitleStyle+'">请设置标题</div>';
		}else{
			str+='<img src="'+this.FlashAry[this.step][0].src+'" name="'+this.name+'_slide" id="'+this.name+'_slide" width="'+this.width+'" height="'+this.height+'" border=0 style="filter:blendTrans(duration=3)" alt="'+this.FlashAry[this.step][2]+'">';
			str+='<div id="'+this.name+'_title" align="center" style="'+this.TitleStyle+'">'+this.FlashAry[0][2]+'</div>';
			str+='<BR></div>';
		}
		str+='</a></div>';
		if (_RongQi && _RongQi!=''){
			document.all[_RongQi].innerHTML=str;
		}else{
			document.write(str);
		}
		this._Reapply();
	}
	this._Reapply=function(){
		setTimeout(this.name+".slideit()",200)
		return true;
	}
	//-->
	window.onerror=this._Reapply;
}
FlashAdd.prototype.slideit=function(){
	if (this.step>this.FlashAry.length){return;}
	var src=eval("this.FlashAry["+this.step+"][0].src");
	if (!document.images)return;
	if (document.all){var img_obj=document.images[this.name+'_slide'];var title_obj=document.all[this.name+'_title'];}
	img_obj.filters.blendTrans.apply();
	img_obj.src=src;
	img_obj.alt=eval("this.FlashAry["+this.step+"][2]");
	title_obj.innerHTML=eval("this.FlashAry["+this.step+"][2]");
	img_obj.filters.blendTrans.play();
	if (this.step<this.FlashAry.length-1){this.step++;}
	else{this.step=0;}
	if (document.all){setTimeout(this.name+".slideit();",this.speed*1000);}//this.speed*1000+3000
	else{setTimeout(this.name+".slideit()",this.speed*1000);}
}
FlashAdd.prototype.slidelink=function(){
	if (this.FlashAry[this.step][1] && this.FlashAry[this.step][1]!=''){window.open(this.FlashAry[this.step][1],'','');}
	return;
}