var hotImageClass = function(){
	this.pic_width	= 350;
	this.pic_height	= 130;
	this.button_pos	= 1;					//是否显示按扭 1显示 0不显示
	this.stop_time	= 5000;					//图片停留时间(1000为1秒钟)
	this.show_text	= 1;					//是否显示文字标题 1显示 0不显示
	this.text_height	= 20;					//文字标题的高度
	this.txtcolor	= "FF0000";				//文字色
	this.bgcolor		= "FFFFFF";				//文字背景色
	this.swf_path	= "/static/images/hot_new.swf";	//flash文件的地址
	this.pics="";
	this.links="";
	this.texts="";
};
		
hotImageClass.prototype={
	handle:this,
	addUrl:function (str){
		this.links += "|" + str.formatHtml();
		return this;
	},
	addPic:function (str){
		this.pics +="|" + str.formatHtml();
		return this;
	},
	addTitle:function(str){
		this.texts += "|" + str.formatHtml();
		return this;
	},
	setWidth:function (str){
		this.pic_width = parseInt(str);
		return this;
	},
	setHeight:function (str){
		this.pic_height = parseInt(str);
		return this;
	},
	setShowText:function (str){
		this.show_text =(str==true)?1:0;
		return this;
	},
	setTextBgcolor:function(str){
		this.bgcolor = parseInt(str);
		return this;
	},
	setTextHeight:function(str){
		this.text_height = parseInt(str);
		return this;
	},
	setTextColor:function(str){
		this.text_height = str.formatHtml();
		return this;
	},
	setSwfPath:function(str){
		this.swf_path = str.formatHtml();
	},
	setInterval:function(str){
		this.stop_time = parseInt(str);
	},
	initParameter:function (){
			this.swf_height = (this.show_text == 1) ? this.pic_height + this.text_height : this.pic_height;				
			if ( this.pics.length > 0 ) this.pics=this.pics.substring(1);
			if ( this.links.length > 0 ) this.links=this.links.substring(1);
			if ( this.texts.length > 0 ) this.texts=this.texts.substring(1);
	},
	initFlash:function (){
			var hotImageStr = "";
			hotImageStr +='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabversion=6,0,0,0" width="'+ this.pic_width +'" height="'+ this.swf_height +'">'
			hotImageStr +='<param name="movie" value="'+this.swf_path+'">';
			hotImageStr +='<param name="quality" value="high"><param name="wmode" value="opaque">';
			hotImageStr +='<param name="FlashVars" value="pics='+this.pics+'&links='+this.links+'&texts='+this.texts+'&pic_width='+this.pic_width+'&pic_height='+this.pic_height+'&show_text='+this.show_text+'&txtcolor='+this.txtcolor+'&bgcolor='+this.bgcolor+'&button_pos='+this.button_pos+'&stop_time='+this.stop_time+'">';
			hotImageStr +='<embed src="'+this.swf_path+'" FlashVars="pics='+this.pics+'&links='+this.links+'&texts='+this.texts+'&pic_width='+this.pic_width+'&pic_height='+this.pic_height+'&show_text='+this.show_text+'&txtcolor='+this.txtcolor+'&bgcolor='+this.bgcolor+'&button_pos='+this.button_pos+'&stop_time='+this.stop_time+'" quality="high" width="'+ this.pic_width +'" height="'+ this.swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  menu="false" wmode="transparent" />';
			hotImageStr +='<\/object>';
			document.write(hotImageStr);	
	},
	apply:function(){
		this.initParameter();
		this.initFlash();
	}
}
