// 鼠标相关应用
var vMouse	= {
	curr:	{},
	mMain:	{},
	step:	0,
	settime:	{},
	zoom:	{},
	reset:	{},
	left:	100,
	right:	100,
	step:	5,
	// 分页
	p:		1,
	p2:		1,
	$:			function(_s){
		return document.getElementById(_s);
	},
	// 特殊需求特殊处理
	hide:		function(_iMark){
		// ie
		
		clearTimeout(this.limit);
		
		this.limit	= setTimeout(step, 200);
		
		function step(){
			document.getElementById('rela_video').className		= 'rela_video3';
			document.getElementById('good_special').className	= 'good_special3';

			if(_iMark != ""){

			document.getElementById('rela_video').className		= 'rela_video' + _iMark;
			document.getElementById('good_special').className	= 'good_special' + _iMark;

			}else{
				document.getElementById('rela_video').className		= 'rela_video3';
				document.getElementById('good_special').className	= 'good_special3';
			}
		}
	},
	getXY:		function(_this) {
		var sumTop = 0, sumLeft = 0;
		while(_this		!=	document.body){
				sumLeft +=	_this.offsetLeft;
				sumTop	+=	_this.offsetTop;
				_this	=	_this.offsetParent;
		}
		return {x:sumLeft, y:sumTop};
	},
	menuOver:	function(_this){
		var _this	= this.$(_this.getAttribute('goto'));
		var menu	= this.getXY(_this);
		this.mMain	= _this;
		
		if(!isNaN(vMouse.settime))
		{
			clearTimeout(vMouse.settime);
		}
		
		this.$(_this.getAttribute('menu')).style.display	= '';
		this.$(_this.getAttribute('menu')).style.position	= 'absolute';
		this.$(_this.getAttribute('menu')).style.zIndex	= '9999999';
		this.$(_this.getAttribute('menu')).style.top		= (parseInt(_this.offsetHeight) + parseInt(menu.y)).toString() + 'px';
		this.$(_this.getAttribute('menu')).style.left		= (parseInt(menu.x)).toString() + 'px';
	},
	menuOut:	function(_this){
		vMouse.settime	= setTimeout(vMouse.menuHidden, 500);
	},
	menuHidden:	function(){
		try{
			vMouse.$(vMouse.mMain.getAttribute('menu')).style.display		= 'none';
		}catch(e){}
	},
	pageUp:	function(_sID, _iHeight){
		this.$(_sID).scrollTop	-= _iHeight;

		if(_sID == 'list1'){
			if(this.p > 1)
				--this.p;
			if(this.p == 1){
				this.$('page1').style.display	= '';
				this.$('page11').style.display	= 'none';
			}else{
				this.$('page1').style.display	= 'none';
				this.$('page11').style.display	= '';
				this.$('page2').style.display	= '';
				this.$('page22').style.display	= 'none';
			}
		}else{
			if(this.p2 > 1)
				--this.p2;
			if(this.p2 == 1){
				this.$('page3').style.display	= '';
				this.$('page33').style.display	= 'none';
			}else{
				this.$('page3').style.display	= 'none';
				this.$('page33').style.display	= '';
				this.$('page4').style.display	= '';
				this.$('page44').style.display	= 'none';
			}
		}
		
	},
	pageDown:	function(_sID, _iHeight){
		this.$(_sID).scrollTop	+= _iHeight;

		if(_sID == 'list1'){
			if(this.p < 5)
				++this.p;
			if(this.p == 5){
				this.$('page2').style.display	= 'none';
				this.$('page22').style.display	= '';
			}else{
				this.$('page2').style.display	= '';
				this.$('page22').style.display	= 'none';
				this.$('page1').style.display	= 'none';
				this.$('page11').style.display	= '';
			}
		}else{
			if(this.p2 < 5)
				++this.p2;
			if(this.p == 5){
				this.$('page4').style.display	= 'none';
				this.$('page44').style.display	= '';
			}else{
				this.$('page4').style.display	= '';
				this.$('page44').style.display	= 'none';
				this.$('page3').style.display	= 'none';
				this.$('page33').style.display	= '';
			}
		}
	},
	pageLeft:	function(_sID, _lID, _lCSS, _rID, _rCSS, _iWidth, _iPNUM){

		this.$(_sID).scrollLeft		-= _iWidth;
		
		if(this.p > 1)
			--this.p;

		if(this.p == 1){
			this.$(_lID).className	= _lCSS[0];
			this.$(_rID).className	= _rCSS[1];
		}else{
			this.$(_lID).className	= _lCSS[1];
			this.$(_rID).className	= _rCSS[0];
		}
	},
	pageRight:	function(_sID, _lID, _lCSS, _rID, _rCSS, _iWidth, _iPNUM){

		this.$(_sID).scrollLeft		+= _iWidth;
		
		if(this.p < _iPNUM)
			++this.p;

		if(this.p == _iPNUM){
			this.$(_lID).className	= _lCSS[1];
			this.$(_rID).className	= _rCSS[0];
		}else{
			this.$(_lID).className	= _lCSS[0];
			this.$(_rID).className	= _rCSS[1];
		}
	},
	hidden:		function(_sID){
		if(vMouse.$(_sID) != null){
			vMouse.$(_sID).style.display	= vMouse.$(_sID).style.display	== 'none' ? '' : 'none';
			if($(_sID).id == 'loginMenu'){
				this.$(_sID).style.top		= '36px';
				this.$(_sID).style.left		= '35%';
			}
		}
	},
	goto:		function(_oThis, _cID, _x, _y){
		var oCtrl	= vMouse.$(_cID);
		var iXY		= vMouse.getXY(_oThis);
		if(oCtrl != null){
			oCtrl.style.position	= 'absolute';
			oCtrl.style.top			= iXY.y	+ _y;
			oCtrl.style.left		= iXY.x	+ _x;
		}
	}
};