	function MessageManager(_owner)
	{
		this.owner = _owner;
		this.msgpanel = document.createElement("LABEL");
		this.owner.appendChild(this.msgpanel);

		this.text = function(text)
		{
			this.msgpanel.innerHTML = text;
		}
	}

	function VoteManager(_owner)
	{
		this.owner = _owner;

		this.votepanel = document.createElement("LABEL");

		this.votepanel.VOTE_URL  = "";
		this.votepanel.VOTE_TEXT = "";
		this.votepanel.VOTE_SCORE = 0;

		//this.votepanel.VOTE_IMG_SRC_1 = "http://cimg2.163.com/cnews/newimg/photo2007/i3.gif";
		//this.votepanel.VOTE_IMG_SRC_2 = "http://cimg2.163.com/cnews/newimg/photo2007/i2.gif";
		//this.votepanel.VOTE_IMG_SRC_3 = "http://cimg2.163.com/cnews/newimg/photo2007/i4.gif";

		this.votepanel.VOTE_IMG_SRC_1 = "http://cimg2.163.com/cnews/img/pic0215/star1.gif";
		this.votepanel.VOTE_IMG_SRC_2 = "http://cimg2.163.com/cnews/img/pic0215/star0.gif";
		this.votepanel.VOTE_IMG_SRC_3 = "http://cimg2.163.com/cnews/img/pic0215/star2.gif";

		this.votepanel.VOTE_EVENT_LIST = ["alert('voteing...')"];
		this.votepanel.VOTE_MOUSE_LIST = ["alert('voteing...')"];

		this.votepanel.score_hash = {};
		this.votepanel.score_hash["1"] = "1星/不好";
		this.votepanel.score_hash["2"] = "2星/中下";
		this.votepanel.score_hash["3"] = "3星/还行";
		this.votepanel.score_hash["4"] = "4星/不错";
		this.votepanel.score_hash["5"] = "5星/极好";

		// 默认是显示，值为 false
		this.votepanel.VOTE_ISVOTE  = false;
		// 默认是无投票记录，值为 false
		this.votepanel.VOTE_HASVOTE = false;

		this.votepanel.STAR_NUM = 5;
		this.votepanel.STAR_ARRAY = new Array(this.votepanel.STAR_NUM);
		this.votepanel.VOTE_MSG_OBJ = null;

		this.votepanel.obj = this;

		this.owner.appendChild(this.votepanel);

		this.init = function(isvote, obj)
		{
			if (isvote == "vote")
			{
				this.votepanel.VOTE_ISVOTE = true;
				this.create(true, obj);
			}
			else
				this.create(false, obj);
		}

		this.create = function(isvote, obj)
		{
			this.votepanel.VOTE_MSG_OBJ = new MessageManager(obj == null ? this.votepanel : obj);

			for (i = 0; i < this.votepanel.STAR_NUM; i ++)
				this.votepanel.STAR_ARRAY[i] = new VoteStar(this.votepanel, this.votepanel.VOTE_IMG_SRC_2, i + 1, isvote);
		}

		this.update = function(index)
		{
			this.votepanel.update(index);
		}

		this.vote = function()
		{
			this.votepanel.update(index);
		}

		this.setStar1 = function(src)
		{
			this.votepanel.VOTE_IMG_SRC_1 = src;
		}

		this.setStar2 = function(src)
		{
			this.votepanel.VOTE_IMG_SRC_2 = src;
		}

		this.setEvent = function(elist)
		{
			this.votepanel.VOTE_EVENT_LIST = elist;
		}

		this.setMouse = function(elist)
		{
			this.votepanel.VOTE_MOUSE_LIST = elist;
		}

		this.votepanel.seturl = function(url)
		{
			this.VOTE_URL = url;
		}

		this.votepanel.geturl = function()
		{
			return this.VOTE_URL;
		}

		this.setUrl = function(url)
		{
			this.votepanel.VOTE_URL = url;
		}

		this.getUrl = function()
		{
			return this.votepanel.VOTE_URL;
		}

		this.votepanel.settext = function(text)
		{
			this.VOTE_MSG_OBJ.text(this.score_hash[text] == null 
				|| this.score_hash[text] == "" ? this.VOTE_TEXT : 
				this.score_hash[text]);
		}

		this.votepanel.gettext = function()
		{
			return this.VOTE_TEXT;
		}

		/*this.setText = function(text)
		{
			this.votepanel.VOTE_TEXT = text;
			this.votepanel.VOTE_MSG_OBJ.text(this.votepanel.VOTE_TEXT);
		}

		this.getText = function()
		{
			return this.votepanel.VOTE_TEXT;
		}*/

		this.votepanel.vote = function(score)
		{
			this.seturl(this.VOTE_URL + score);
			this.VOTE_SCORE = score;

			if (!this.VOTE_HASVOTE)
				for (var i = 0, n = this.VOTE_EVENT_LIST.length; i < n; i ++)
					eval(this.VOTE_EVENT_LIST[i]);

			this.VOTE_HASVOTE = true;
		}

		/*this.votepanel.text = function(text)
		{
			this.settext(text);

			for (var i = 0, n = this.VOTE_MOUSE_LIST.length; i < n; i ++)
				eval(this.VOTE_MOUSE_LIST[i]);
		}*/

		this.votepanel.update = function(index)
		{
//alert(index);
			if (!this.VOTE_ISVOTE || !this.VOTE_HASVOTE)
			{
				for (var i = 0; i < this.STAR_NUM; i ++)
				{
					if (i < index)
					{
						if (i + 0.5 <= index)
							this.STAR_ARRAY[i].img.src = this.VOTE_IMG_SRC_1;
						else
							this.STAR_ARRAY[i].img.src = this.VOTE_IMG_SRC_3;
					}
					else
						this.STAR_ARRAY[i].img.src = this.VOTE_IMG_SRC_2;
				}
			}
		}
	}

	function VoteStar(_owner, imgsrc, imgval, isact)
	{
		this.owner = _owner;
		this.img = document.createElement("IMG");
		this.img.src    = imgsrc;
		this.img.value  = imgval;
		this.img.width  = 13;
		this.img.height = 12;
		this.img.border = 0;

			//this.img.onmouseover = this.onImgMouseOver;
			//this.img.onmouseout  = this.onImgMouseOut;
			//this.img.onclick     = this.onImgClick;

		this.img.obj = this;

		this.owner.appendChild(this.img);

		if (isact)
		{
			this.img.style.cursor = "hand";

			this.img.onmouseover = function(e)
			{
				var self = this.obj;

				if (!self.owner.VOTE_HASVOTE)
				{
					if (!e) e = window.event;
					e.cancelBubble = true;

					self.owner.update(self.img.value);
					self.owner.settext(self.img.value);
				}
			}

			this.img.onmouseout = function(e)
			{
				if (!e) e = window.event;
				e.cancelBubble = true;

				var self = this.obj;
				self.owner.update(-1);
				self.owner.settext(self.owner.VOTE_TEXT);
			}

			this.img.onclick = function(e)
			{
				if (!e) e = window.event;
				e.cancelBubble = true;

				var self = this.obj;
				self.owner.vote(self.img.value);
			}
		}
	}

	/*function VoteStar.prototype.onImgMouseOver()
	{
		event.cancelBubble = true;

		var self = this.obj;
		self.owner.update(self.img.value);
		self.owner.settext(self.img.value);
	}

	function VoteStar.prototype.onImgMouseOut()
	{
		event.cancelBubble = true;

		var self = this.obj;
		self.owner.update(-1);
		self.owner.settext(self.owner.VOTE_TEXT);
	}

	function VoteStar.prototype.onImgClick()
	{
		event.cancelBubble = true;

		var self = this.obj;
		self.owner.vote(self.img.value);
	}*/