﻿try{

document.execCommand("BackgroundImageCache", false, true);

}catch(e){}

//显示一个div，有延时/展开效果

function flashshowFlashshow()

{

	//需要展示的div对象

	this.showObj=null;

	

	//几个周期之内显示完毕

	this.timeMaxCount=20;

	//每隔几个毫秒显示一次?

	this.delay=10;

	//当前显示到第几个了

	this.currentCount=null;

	//时间对象

	this.timeObj=null;

	//文字

	this.innertext=null;

	

	//显示动作

	//times:	几个周期之内展示完毕，默认是20个周期

	//height:	要展开的对象的高度

	this.show=function(event,showObj,width,height,times,data)

	{

		var overObj=event.srcElement?event.srcElement:event.target;

		//必须设置对象

		if(typeof showObj =='undefined')

			return null;

		if(typeof showObj =='string')

			showObj=document.getElementById(showObj);	

		//还在显示中间的时候,就不显示下一个

		if(document.timeObj)

			return true;

		//

		document.flashshowTagObj=showObj;

		//必须设置对象的高度

		if(typeof height =='undefined')

			return null;

		//

		if(typeof width =='undefined')

			return null;			

		//

		showObj.showObjHeight=height;

		showObj.showObjWidth=width;

		//

		if(typeof times !='undefined')

			showObj.timeMaxCount=times;

		

		if(!showObj.init)

		{		

			//透明度

			this.filter(showObj);		

			//监听鼠标移走的事件

			this.mouseout(showObj);

		}

		//

		showObj.currentCount=1;			

		//移动到鼠标旁边去,考虑到有滚动条的时候

		this._showxy(event.clientX,event.clientY,showObj);

				

		//首先把DIV展示出来		

		showObj.style.display='block';

		showObj.style.height=10+'px';

		showObj.style.width=1+'px';

		//清除数据

		if(!data)

			showObj.innerword=overObj.title;	

		else

			showObj.innerword=data;	

		showObj.innerHTML="";

		showObj.ref=this;

		showObj.init=true;

		document.timeObj=setInterval(this._show,this.delay);

	},

	//显示的辅助函数

	this._show=function()

	{

		if( document.flashshowTagObj.currentCount>document.flashshowTagObj.timeMaxCount || document.flashshowTagObj

.clientHeight>document.flashshowTagObj.showObjHeight ||document.flashshowTagObj.clientWidth>document

.flashshowTagObj.showObjWidth)

		{

			clearInterval(document.timeObj);

			document.timeObj=null;

			document.flashshowTagObj.innerHTML=document.flashshowTagObj.innerword;

			//showDiv.timeObj=null;

			//最后一步设置成最终的宽度和高度 

			document.flashshowTagObj.style.height=document.flashshowTagObj.showObjHeight+'px';

			document.flashshowTagObj.style.width=document.flashshowTagObj.showObjWidth+'px';		

			return 0;

		}else

		{

			//高度不参与变化

			document.flashshowTagObj.style.width=(parseInt(document.flashshowTagObj.style.width)+(document.flashshowTagObj

.showObjWidth/document.flashshowTagObj.timeMaxCount))+'px';

			document.flashshowTagObj.currentCount++;

		}

	},

	

	//得到一个对象在页面的绝对位置,参数为Left,或者Top

	this.point=function(obj,tag)

	{

		x=eval('obj.offset'+tag);

		while(obj=obj.offsetParent)  

		   x+=eval('obj.offset'+tag);

		return x;

	},

		

	//收缩的效果

	this.hidden=function(event)

	{

		showObj=event.srcElement?event.srcElement:event.target;

		try{

			//如果鼠标还在范围之内,就不隐藏

			inx=event.clientX>document.flashshowTagObj.point(showObj,'Left');

			inx2=event.clientX<document.flashshowTagObj.point(showObj,'Left')+showObj.clientWidth;

			//

			iny=event.clientY+document.documentElement.scrollTop>document.flashshowTagObj.point(showObj,'Top'

);

			iny2=event.clientY+document.documentElement.scrollTop<document.flashshowTagObj.point(showObj,'Top'

)+showObj.clientHeight;

		

		if(inx && inx2 && iny && iny2)

			return event.returnValue=false;

		}catch(e){

			if(showObj.tagName=='DIV')

				return event.returnValue=false;

		}	

		

		if(document.timeObj)

			clearInterval(document.timeObj);	

		document.timeObj=null;

		document.flashshowTagObj.style.display='none';

	},

	//

	this._showxy=function(x,y,showObj)

	{

		showObj.style.top=document.documentElement.scrollTop+y+15+'px';

		showObj.style.left=x+'px';	

	}

		

	this.new2=function()

	{

		//转移this对象

		return document.all?new _IE_show:new _FF_show;

	}

}

_IE_show.prototype=new flashshowFlashshow;

function _IE_show()

{

	

	this.filter=function(showObj)

	{

		//透明度

		showObj.style.filter ='alpha(opacity=75)';

	},

	

	//鼠标移开,隐藏起来

	this.mouseout=function(obj)

	{

		//绑定鼠标点击,就隐藏	

		obj.attachEvent('onmouseout',this.hidden);

		document.attachEvent('onclick',this.hidden);

	}

}

_FF_show.prototype=new flashshowFlashshow;

function _FF_show()

{

		

	this.filter=function(showObj)

	{

		//透明度

		showObj.style.opacity ='0.75';

	},

	

	//鼠标移开,隐藏起来

	this.mouseout=function(obj)

	{

		obj.addEventListener('mouseout',this.hidden,true);

		//绑定鼠标点击,就隐藏

		document.addEventListener('click',this.hidden,true);		

	}

}//

//拖动

function  dragDrag()

{	

	

	//全部的事件对照表

	this.allEvenetArray=new Array();	

	//初始化显示对象

	this.getMainObj=function(mainObj)

	{

		if(typeof mainObj =='string')

			mainObj=document.getElementById(mainObj);	

		mainObj.style.position='absolute';		

		mainObj.style.display='block';					

		return mainObj;

	}

	

	//在鼠标的左边显示

	this.showleft=function(mainObj,event)

	{

		mainObj=this.getMainObj(mainObj);

		mainObj.style.left=event.clientX-mainObj.clientWidth-mainObj.clientWidth/2+'px';

		mainObj.style.top=document.documentElement.scrollTop+event.clientY+'px';		

		this.allEvenet(mainObj);

	}

	//在鼠标的右边显示

	this.showright=function(mainObj,event)

	{

		mainObj=this.getMainObj(mainObj);

		mainObj.style.left=event.clientX+10+'px';

		mainObj.style.top=document.documentElement.scrollTop+event.clientY+'px';			

		this.allEvenet(mainObj);

	}

	//在鼠标的右边显示

	this.showMid=function(mainObj,event)

	{

		mainObj=this.getMainObj(mainObj);

		//mainObj.style.left=parseInt(document.body.clientWidth/2)+'px';

		mainObj.style.top=document.body.scrollTop+'px';	

		this.allEvenet(mainObj);

	}

		

	//针对一个对象,发布全部的事件

	this.allEvenet=function (mainObj)

	{

		mainObj=this.getMainObj(mainObj);

		//得到当前的对象

		mainObj.ref=this;

		//

		this.mainObj=mainObj;	

		//只能初始化一次

		if(mainObj.init)

			return true;

		this.allEvenetArray.push('_objMove','_objClose','_objResize');

		mainObj.init=true;

		//不一定需要变化大小

		try{

			mainObj.x=mainObj.clientWidth-20;

			//内容

			mainObj.y=mainObj.firstChild.nextSibling.scrollWidth-20;	

		}catch(e){}

		this._allEvenet(mainObj.childNodes);

	},

	

	//递归查找出全部的事件,然后赋值

	this._allEvenet=function (child)

	{

		for(var i in  child)

		{

			if(!child[i].className)

			{

				//必须有下级才能继续

				if(child[i].childNodes)

					this._allEvenet(child[i].childNodes);		

				continue;			

			}

			//开始分配事件

			for(ia in this.allEvenetArray)

			{

				if(child[i].className.indexOf(this.allEvenetArray[ia])!=-1)

				{

					//对象绑定

					child[i].tagObj=this.mainObj;

					//事件绑定

					child[i].ref=this.mainObj.ref;

					//预备事件

					var tmp=this.allEvenetArray[ia];

					//下面的浏览器必须预备这个处理函数

					if(eval('this.mainObj.ref.'+tmp))

						eval('this.mainObj.ref.'+tmp)(child[i]);

				}

			}

			//必须有下级才能继续

			if(child[i].childNodes)

				this._allEvenet(child[i].childNodes);		

		}

	},

	//

	this.reziseInit=function(event)

	{

		//得到当前的对象

		document.tagObj=Handobj=event.srcElement?event.srcElement:event.target;	

		//记录当时的鼠标位置,状态全部记录在点击的hand对象上面

		Handobj.originx=-event.clientX+Handobj.tagObj.clientWidth;

		Handobj.originy=-event.clientY+Handobj.parentNode.previousSibling.clientHeight;

		//然后立马回归原位

		Handobj.ref.resizeMove(event);		

		//具体浏览器截住事件

		Handobj.ref.resizeDown(event);

	},

	//变化大小的事件

	this.resizeMove=function(event)

	{

		//鼠标按钮

		if((event.button?event.button:event.which)!=1)

			return document.tagObj.ref.resizeUp();

		//如果不是记录状态的对象 

		if(!document.tagObj.tagObj || document.tagObj.hasup==true )

			return document.tagObj.ref.resizeUp();

		//大小范围有一个限制

		if(document.tagObj.tagObj.clientWidth+10<document.tagObj.tagObj.x)

		{

			//还原大小

			document.tagObj.tagObj.style.width  =document.tagObj.tagObj.clientWidth+1+'px';

			return document.tagObj.ref.resizeUp();

		}

		//大小范围有一个限制

		if(document.tagObj.parentNode.previousSibling.scrollWidth<document.tagObj.tagObj.y)

		{

			document.tagObj.parentNode.previousSibling.style.height =document.tagObj.parentNode.previousSibling

.scrollWidth+20+'px';

			return document.tagObj.ref.resizeUp();

		}

		//

		try{

			document.tagObj.tagObj.style.width =document.tagObj.originx + event.clientX+'px';

			//这个可能会出错,需要保护一下

			document.tagObj.parentNode.previousSibling.style.height=document.tagObj.originy + event.clientY+'px'

;

		}catch(e){}

		return true;

	},	

	//启用事件来处理

	this.dragInit=function (event)

	{

		//得到当前的对象

		document.tagObj=Handobj=event.srcElement?event.srcElement:event.target;		

		if(!Handobj.ref)

			return;

		//记录当时的鼠标位置,状态全部记录在点击的hand对象上面

		Handobj.originx=-event.clientX+Handobj.ref.point(Handobj.tagObj,'Left');

		Handobj.originy=-event.clientY+Handobj.ref.point(Handobj.tagObj,'Top');

		//层的位置

		Handobj.oldzIndex=Handobj.style.zIndex;

		Handobj.tagObj.style.zIndex=100;	

		//设置可以移动状态

		Handobj.tagObj.style.position='absolute';	

		//然后立马回归原位

		Handobj.ref.dragMove(event);		

		//具体浏览器截住事件

		Handobj.ref.dragDown();

	},

	

	//当鼠标移动的时候,

	this.dragMove=function (event)

	{

		//鼠标按钮,释放按钮

		if((event.button?event.button:event.which)!=1)

			return document.tagObj.ref.dragUp();

		//如果不是记录状态的对象 

		if(document.tagObj.hasup==true || !document.tagObj.tagObj )

			return document.tagObj.ref.dragUp();

		//Handobj.x,y来自鼠标点击下去的记录

		document.tagObj.tagObj.style.left =document.tagObj.originx+ event.clientX+'px';

		document.tagObj.tagObj.style.top  =document.tagObj.originy + event.clientY+'px';

	},

	

	//按钮放开的时候

	this.closeInit=function(event)

	{

		//得到当前的对象

		Handobj=event.srcElement?event.srcElement:event.target;		

		Handobj.tagObj.style.display='none';

	},

	//鼠标移动上去的时候

	this.closeUp=function(event)

	{

		Handobj=event.srcElement?event.srcElement:event.target;	

		Handobj.className='close_on';

	}

	//鼠标移走的时候

	this.closeOut=function (event)

	{

		Handobj=event.srcElement?event.srcElement:event.target;	

		Handobj.className=Handobj.oldClassName;

	}

	//

	this.hidden=function (Handobj)

	{

		Handobj.tagObj.style.display='none';

	}

	

	

	//不能变化大小,将下面的边框隐藏起来

	this.noresize=function ()

	{

		try{

		this._noresize(this.mainObj.childNodes,'_objResize','none');

		}catch(e){}

	}

	

	//可以变化大小

	this.canresize=function ()

	{

		try{

			this._noresize(this.mainObj.childNodes,'_objResize','block');

		}catch(e){}

	}

	//不可以移动,不可以关闭,只剩下核心

	this.noaction=function ()

	{

		try{

		this._noresize(this.mainObj.childNodes,'_objResize','none');

		this._noresize(this.mainObj.childNodes,'_objClose','none');		

		this._noresize(this.mainObj.childNodes,'_objMove','none');				

		}catch(e){}

	}

	//还原一切操作

	this.canaction=function ()

	{

		try{

		this._noresize(this.mainObj.childNodes,'_objResize','block');

		this._noresize(this.mainObj.childNodes,'_objClose','block');		

		this._noresize(this.mainObj.childNodes,'_objMove','block');				

		}catch(e){}	

	}	

	

	

	//辅助函数

	this._noresize=function (child,handClass,tag)

	{

		for(var i in  child)

		{

			if(!child[i].className)

			{

				//必须有下级才能继续

				if(child[i].childNodes)

					this._noresize(child[i].childNodes,handClass,tag);		

				continue;			

			}

			//查找到可以变化大小的关键点,将其隐藏起来

			if(child[i].className.indexOf(handClass)!=-1)

			{

				child[i].parentNode.style.display=tag;

			}

			//继续递归数据

			if(child[i].childNodes)

				this._noresize(child[i].childNodes,handClass,tag);				

		}

	}

	

	//设置窗口标题

	this.setTitle=function(titletext)

	{

		this._setTitle(this.mainObj.childNodes,titletext.substr(0,30));

	}

	//辅助函数

	this._setTitle=function (child,titletext)

	{

		for(var i in  child)

		{

			if(!child[i].className)

			{

				//必须有下级才能继续

				if(child[i].childNodes)

					this._setTitle(child[i].childNodes,titletext);		

				continue;			

			}

			//查找到可以变化大小的关键点,将其隐藏起来

			if(child[i].className.indexOf('settitle')!=-1)

			{

				child[i].innerHTML=titletext;

			}

			//继续递归数据

			if(child[i].childNodes)

				this._setTitle(child[i].childNodes,titletext);				

		}

	}

		

			

	//得到一个对象在页面的绝对位置,参数为Left,或者Top

	this.point=function(obj,tag)

	{

		x=eval('obj.offset'+tag);

		while(obj=obj.offsetParent)  

		   x+=eval('obj.offset'+tag);

		return x;

	},

	

	this.new2=function()

	{

		return document.all?new _IE_drag:new _FF_drag;

	}

}

//接入事件处理,由运行时决定

_IE_drag.prototype= new dragDrag();

//为IE写的插件

function _IE_drag()

{

	//分配事件,一次性分配

	this._objMove=function (obj)

	{

		obj.attachEvent('onmousedown',obj.ref.dragInit);

	}

	//分配事件,一次性分配

	this._objResize=function (obj)

	{

		obj.attachEvent('onmousedown',obj.ref.reziseInit);

	},

	//有关闭功能的对象

	this._objClose=function(obj)

	{

		obj.oldClassName=obj.className;

		obj.attachEvent('onclick',obj.ref.closeInit);

		obj.attachEvent('onmouseover',obj.ref.closeUp);

		obj.attachEvent('onmouseout',obj.ref.closeOut);

	},

	//鼠标按下去的时候

	this.resizeDown=function(event)

	{

		document.attachEvent('onmousemove',document.tagObj.ref.resizeMove);	

		//document.tagObj.tagObj.style.filter ='alpha(opacity=80)';		

		document.tagObj.setCapture();

	},

	//

	this.resizeUp=function()

	{

		document.detachEvent('onmousemove',document.tagObj.ref.resizeMove);		

		//document.tagObj.tagObj.style.filter ='alpha(opacity=100)';

		document.tagObj.releaseCapture();	

	},

			

	//鼠标按下去的时候

	this.dragDown=function ()

	{

		document.attachEvent('onmousemove',document.tagObj.ref.dragMove);			

		//设置半透明,这个要导致cpu占用40%左右!

		//document.tagObj.tagObj.style.filter ='alpha(opacity=80)';	

		//在IE下设置焦点,要不然会变成选择文字

		document.tagObj.setCapture();

	}

	

	//当鼠标放开的时候

	this.dragUp=function()

	{

		//取消透明

		//document.tagObj.tagObj.style.filter ='alpha(opacity=100)';

		//取消事件的绑定

		document.detachEvent('onmousemove',document.tagObj.ref.dragMove);

		//还原相对立体位置

		if(parseInt(document.tagObj.oldzIndex)>1)

			document.tagObj.tagObj.style.zIndex=document.tagObj.oldzIndex;

		//释放鼠标的定位对象

		document.tagObj.releaseCapture();

	}

}

//接入事件处理,由运行时决定

_FF_drag.prototype= new dragDrag();

//firefox插件

function _FF_drag()

{

	//分配事件,一次性分配

	this._objMove=function(obj)

	{

		obj.addEventListener('mousedown',obj.ref.dragInit,true);

	},

	//有关闭功能的对象

	this._objClose=function(obj)

	{

		obj.oldClassName=obj.className;

		obj.addEventListener('click',obj.ref.closeInit,true);

		obj.addEventListener('mouseover',obj.ref.closeUp,true);

		obj.addEventListener('mouseout',obj.ref.closeOut,true);

	},

	//分配事件,一次性分配

	this._objResize=function(obj)

	{

		obj.addEventListener('mousedown',obj.ref.reziseInit,true);

	},

			

	//鼠标按下去的时候

	this.resizeDown=function()

	{

		document.addEventListener('mousemove',document.tagObj.ref.resizeMove,true);	

		document.addEventListener('mouseup',function()

		{

			document.tagObj.ref.resizeUp();

		},false);		

		document.tagObj.hasup=false;

		//设置半透明

		//document.tagObj.tagObj.style.opacity ='0.8';

	},

	//

	this.resizeUp=function()

	{

		document.removeEventListener('mousemove',document.tagObj.ref.resizeMove,true);		

		document.removeEventListener('mouseup',function()

		{

			document.tagObj.ref.resizeUp();

		},false);			

		//记录鼠标已经移开了

		document.tagObj.hasup=true;

		//取消半透明

		//document.tagObj.tagObj.style.opacity ='1';		

	},

	//鼠标按下去的时候

	this.dragDown=function()

	{

		//设置半透明,这个要导致cpu占用40%左右!

		//document.tagObj.tagObj.style.opacity ='0.8';

		document.addEventListener('mousemove',document.tagObj.ref.dragMove,true);	

		//firefox要特别处理这个,因为他监控不了鼠标的状态

		document.addEventListener('mouseup',function()

		{

			document.tagObj.ref.dragUp();

		},false);

		document.tagObj.hasup=false;

	}

	

	//当鼠标放开的时候

	this.dragUp=function()

	{

		document.tagObj.hasup=true;

		//取消透明

		//document.tagObj.tagObj.style.opacity ='1';

		//取消事件的绑定

		document.removeEventListener('mousemove',document.tagObj.ref.dragMove,false);

		//firefox要特别处理这个,因为他监控不了鼠标的状态

		document.removeEventListener('mouseup',function()

		{

			document.tagObj.ref.dragUp();

		},false);

				

		//还原相对立体位置

		document.tagObj.tagObj.style.zIndex=document.tagObj.oldzIndex;

	}

}

//带有子框架的拖动框

dragIframe.prototype= new dragDrag();

function dragIframe()

{

	//框架公共处理事件接口

	this._objIframe=function(dragIframe_objIframe)

	{

		//先把框架放大

		dragIframe_objIframe.width=dragIframe_objIframe.parentNode.nextSibling.clientWidth;

		dragIframe_objIframe.height=dragIframe_objIframe.clientHeight;

		document.dragIframe_objIframe=dragIframe_objIframe;

		//自动适应宽度和高度

		dragIframe_objIframe.tagObj.ref._iframeonload(dragIframe_objIframe);

	},

	this.iframeonloadOkEnd=function(handObj,doc)

	{

		//

		if(!(buttonObj=doc.getElementById('html-buttom')))

		{

			var buttonObj=doc.createElement("DIV");

			buttonObj.id='html-buttom';

			buttonObj.style.clear='both';

			buttonObj.style.display='block';

			doc.body.appendChild(buttonObj);		

		}

		cy=handObj.tagObj.ref.point(buttonObj,'Top');

		handObj.tagObj.ref.resizeY(cy);	

		//取消页面加载的提示

		handObj.previousSibling.style.display='none';

		if(!doc.noresize)

			handObj.tagObj.ref.noresize();

	}

	//按钮放开的时候

	this.closeInit=function(event)

	{

		try{

		//得到当前的对象

		Handobj=event.srcElement?event.srcElement:event.target;		

		Handobj.tagObj.style.display='none';

		document.dragIframe_objIframe.src='about:blank';

		}catch(e){}

	},

	

	//

	this.resizeMove=function (event)

	{

		if(dragIframe.prototype.resizeMove(event))

		{

			document.dragIframe_objIframe.width=document.dragIframe_objIframe.parentNode.nextSibling.clientWidth

;

			document.dragIframe_objIframe.height=document.dragIframe_objIframe.parentNode.clientHeight-10;

		}

	},

	

	//开始打开某个页面框架

	this.openurl=function(url)

	{

		//显示页面加载的提示

		document.dragIframe_objIframe.previousSibling.style.display='block';

		document.dragIframe_objIframe.src='about:blank';

		if(document.dragIframe_objIframe.tagObj.style.display=='none')

			return null;

		//保证不缓存数据

		document.dragIframe_objIframe.src=url+'&time='+new Date().getTime();

	},

	//将窗口变化到制定的大小

	this.resize=function(width,height)

	{

		//同时左右也拉宽

		document.dragIframe_objIframe.parentNode.parentNode.style.width=width+'px';

		document.dragIframe_objIframe.tagObj.style.width=width+'px';

		document.dragIframe_objIframe.style.width=width+'px';

		document.dragIframe_objIframe.height=height;		

	}

	

	//只要改变高度	

	this.resizeY=function(height)

	{

		try{

			document.dragIframe_objIframe.tagObj.style.height=height+30+'px';

			document.dragIframe_objIframe.height=height;

		}catch(e){}

	}

	//只要改变宽度

	this.resizeX=function(width)

	{

		document.dragIframe_objIframe.tagObj.style.width=width+'px';

		document.dragIframe_objIframe.style.width=width+'px';

	}	

		

	//

	this.new2=function()

	{

		this.allEvenetArray.push('_objIframe');	

		return document.all?new _IE_drag_iframe:new _FF_drag_iframe;

	}	

	

}

//重定向父类位置

_IE_drag.prototype = new dragIframe();

//IE(扩展)

_IE_drag_iframe.prototype= new _IE_drag();

function _IE_drag_iframe()

{

	//绑定框架载入事件

	this._iframeonload=function(iframeObj)

	{

		iframeObj.attachEvent('onload',iframeObj.tagObj.ref.iframeonloadOk);

	}

	//转载完毕,开始事件触发	

	this.iframeonloadOk=function(event)

	{

		try{

			handObj=event.srcElement;

			doc=document.frames(handObj.id).document;

			handObj.tagObj.ref.iframeonloadOkEnd(handObj,doc);

		}catch(e){}

	}

		

}

//重定向父类位置

_FF_drag.prototype = new dragIframe();

//firefox(扩展)

_FF_drag_iframe.prototype= new _FF_drag();

function _FF_drag_iframe()

{

	//绑定框架载入事件

	this._iframeonload=function(iframeObj)

	{

		iframeObj.addEventListener('load',iframeObj.tagObj.ref.iframeonloadOk,true);

	}

	

	//转载完毕,开始事件触发	

	this.iframeonloadOk=function(event)

	{

		try{

			//注意框架的绑定对象是不一样的

			handObj=event.currentTarget;

			doc=handObj.contentDocument;

			handObj.tagObj.ref.iframeonloadOkEnd(handObj,doc);

		}catch(e){}

	}	

}

//

function starstar()

{

	this.set=function (divObj,number,newSrc,oldsrc)

	{

		//只需要绑定事件一次	

		if(divObj._set==null)

		{

			divObj._set=true;

			divObj.number=number;

			divObj.newSrc=newSrc;

			divObj.oldsrc=oldsrc;

			if(!divObj.ref)

				divObj.ref=this;

			try{

				var icount=0;

				var notes=divObj.childNodes;

				for(i in notes)

					if(notes[i].tagName=='IMG' && !notes[i]._loadevent)

					{

						notes[i].num=++icount;

						//对单独的星星绑定事件

						divObj.ref._loadevent(notes[i]);

						//标志已经被绑定事件了

						notes[i]._loadevent=true;

					}

				return true;

			}catch(e){alert(e['message']); return false; }

		}

		return false;

	}

	

	//重新设置星星的个数

	this.fix=function(divObj,num)

	{

		try{

			var count=0;

			for(i in divObj.childNodes)

				if(divObj.childNodes[i].tagName=='IMG' && !divObj.childNodes[i]._loadevent)

				{

					count++;

					if(count<=num)

						divObj.childNodes[i].src=divObj.oldsrc;

					else

						break;

				}

		}catch(e){}

	}

	

	//鼠标移动到图片的上面

	this.overstar=function (event)

	{

		try{

			currentObj=event.srcElement?event.srcElement:event.target;

			var divObj=currentObj.parentNode;

			currentObj.style.cursor='hand';

			if(currentObj.num>divObj.number)

			{

				for(i in divObj.childNodes)

				{

					if(divObj.childNodes[i].tagName!='IMG')

					{

						continue;

					}

					if(divObj.childNodes[i].num<=divObj.number)

					{

						continue;

					}

					if(divObj.childNodes[i].num>currentObj.num)

						break;

					

					divObj.childNodes[i].oldsrc=divObj.childNodes[i].src;

					divObj.childNodes[i].src=divObj.newSrc;

				}			

			}

			else

			{

				start=1;		

				end	=currentObj.num;

				for(i in divObj.childNodes)

				{

					if(divObj.childNodes[i].tagName!='IMG')

						continue;

					if(divObj.childNodes[i].num<start)

						continue;

					if(divObj.childNodes[i].num>end)

						break;

					divObj.childNodes[i].oldsrc=divObj.childNodes[i].src;						

					divObj.childNodes[i].src=divObj.newSrc;

				}						

			}

		}catch(e){

		}

	}

	//鼠标移开了

	this.outstar=function (event)

	{

		currentObj=event.srcElement?event.srcElement:event.target;

		var divObj=currentObj.parentNode;	

		currentObj.style.cursor='auto';

		try{

			for(i in  divObj.childNodes)

			{

				if(divObj.childNodes[i].oldsrc)

					divObj.childNodes[i].src=divObj.childNodes[i].oldsrc;

				divObj.childNodes[i].oldsrc=null;			

			}	

		}catch(e){}

	}

	//

	this.new2=function()

	{

		return document.all? new _IE_star:new _FF_star;

	}

	

}

//为IE写的

_IE_star.prototype= new starstar();

function _IE_star()

{

	//

	this._loadevent=function (imageObj)

	{

		imageObj.attachEvent('onmouseover',this.overstar);

		imageObj.attachEvent('onmouseout',this.outstar);

	}

}

//为FF写的

_FF_star.prototype= new starstar();

function _FF_star()

{

	//

	this._loadevent=function (imageObj)

	{

		imageObj.addEventListener('mouseover',this.overstar,true);

		imageObj.addEventListener('mouseout',this.outstar,true);

	}

}

//onmousemove="try{new starDivObj().new2().set(this,3,'over.gif')}catch(e){}"//

starpost.prototype= new starstar;

function starpost()

{

	//初始化,加载XMLHTTP

	this.set=function (divObj,number,newSrc,oldsrc,url)

	{

		divObj.ref=this;

		if(!starpost.prototype.set(divObj,number,newSrc,oldsrc))

		{

			divObj.url=url;

		}

	}

	

	//鼠标点击星星时候的反应

	this.onclick=function(event)

	{

		try{		

			//得到当前的星星对象

			currentObj=event.srcElement?event.srcElement:event.target;

			var divObj=currentObj.parentNode;

			xmlhttp= new xmlhttpxmlhttp().new2();

			xmlhttp.open('GET', divObj.url+"&vote_score=" + currentObj.num+"&t="+Math.random(), true);

			xmlhttp.onreadystatechange =function()

			{

				if (xmlhttp.readyState==4)

				{

					 if (xmlhttp.status==200)

					 {

							if(xmlhttp.responseText && xmlhttp.responseText!='-')

							{

								document.getElementById('item_vote_score').innerHTML=xmlhttp.responseText;

							}else

								document.getElementById('item_vote_score_error').style.display='block';

					 }

				}

			}

			xmlhttp.send(null);	

		}catch(e){}

	}

	

	//

	this.new2=function()

	{

		return document.all?new _IE_post_star:new _FF_post_star;

	}

}

//IE

_IE_star.prototype= new starpost;

_IE_post_star.prototype= new _IE_star;

function _IE_post_star()

{

	this._loadevent=function(imageObj)

	{

		_IE_post_star.prototype._loadevent(imageObj);

		imageObj.attachEvent('onclick',this.onclick);	

	}

}

//FIREFOX

_FF_star.prototype= new starpost;

_FF_post_star.prototype= new _FF_star;

function _FF_post_star()

{

	this._loadevent=function(imageObj)

	{

		_FF_post_star.prototype._loadevent(imageObj);

		imageObj.addEventListener('click',this.onclick,true);	

	}

}

function xmlhttpxmlhttp()

{

	this.new2=function()

	{

		return document.all?_IE_xmlhttp():_FF_xmlhttp();

	}	

 };

 

 //

_IE_xmlhttp.prototype = new xmlhttpxmlhttp;

 //

 function _IE_xmlhttp()

 {

 	var xmlhttp=null;

 	try

	{xmlhttp= new ActiveXObject("Msxml2.XMLHTTP");}

	catch (e)

	{

		try

		{xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");}

		catch (err){

			return xmlhttp;

		}

	}

	return 	xmlhttp;

 }

 

 //

_FF_xmlhttp.prototype  = new xmlhttpxmlhttp;

 //

  function _FF_xmlhttp()

 {

 	var xmlhttp=null; 

	xmlhttp= new XMLHttpRequest();

	if (!xmlhttp)

		return null;

	return xmlhttp; 

 }
 
 
 

