
function floatMenuChanger(thisObj,ctrlId,Num,reClass){
	var type,reClass;
	if(thisObj.className == reClass)return;
	var tabList = document.getElementById(ctrlId).getElementsByTagName("li");
	for(var tl=0; tl <tabList.length; tl++){
		var mli = document.getElementById(ctrlId+tl);
		if (tl == Num){
			thisObj.className = reClass;
			mli.style.display = "block";
			mli.className = "menuContent_on";
		}else{
			tabList[tl].className = ""; 
			mli.style.display = "none";
			mli.className = "menuContent_off";
		}
	} 
}

function floatMenu(mId,oId,cId,mainW){
	var _tg ,_cB ,_cBs,_oB,	_DDE,_SAW,	_Min,_Max,wideW,wwT,tmT,lPos,rPos,_tS,_oS;
	    _tg = $(mId);
	    _cB = $(oId);
	    _oB = $(cId);
	   	_cBs = _cB.getElementsByTagName("span")[0];
		_DDE = document.documentElement || document.body;
		_tSTop = _DDE.scrollTop || window.pageYOffset;
		if(!_tSTop) _tSTop = 0;
		_SAW = document.body.scrollWidth;
		_tS = _tg.style;
		_oS = _oB.style;
		
	var notIE6 = navigator.userAgent.indexOf("MSIE 7.0")>0 || window.XMLHttpRequest,
		isIE6 = navigator.userAgent.indexOf("MSIE 6.0")>0;
		
	if(_tS.display == "" || _tS.display == "none"){_tS.display = "block"}
	_Max = _cB.scrollWidth;
	_Min = _oB.scrollWidth;
	_oS.display = "none";
	_tS.width = _Max + "px";
	wwT = _tg.scrollWidth - (_SAW - mainW)/2;
	lPos = Math.ceil((mainW + (_SAW - mainW)/2)-2) + "px";
	rPos = Math.ceil((mainW + (_SAW - mainW)/2)- _Min/2) + "px";
	//tmT = "-" + _tg.scrollHeight/2 + "px";//绝对垂直居中
	//分浏览器定位	
	_tS.position = "absolute";
	_tS.top = _tSTop + _DDE.clientHeight - 250 + "px";
	window.onscroll = function(){doScroll()};
	//分分辨率定位
	if(_SAW <= 1014){
		with(_tS){
			//top = "50%";
			right = "2px";
		}
	}else if(_SAW > 1014  && _SAW <1206){//适应宽屏，框架容器980px		
		with(_tS){
			//top = "50%";		
			right = Math.abs(Math.ceil((_SAW - mainW)/2-_Min*1.5 - 1)) + "px";
		}
	}else if(_SAW > 1014 && _SAW >=1206){//适应宽屏，框架容器980p
		with(_tS){
			//top = "50%";
			left = lPos;
		}
	}
	
	//IE6滚蛋方法
	var doScroll = function(){
		//_tS.marginTop = _DDE.scrollTop - _tg.scrollHeight/2 + "px";
		//_tS.marginTop = _DDE.scrollTop - _tg.scrollHeight/2  + 170 + "px";
		_tSTop = _DDE.scrollTop || window.pageYOffset;
		if(!_tSTop) _tSTop = 0;
		_tS.top = _tSTop + _DDE.clientHeight - 250 + "px";
	}
    
    _cBs.onclick= function(){ 
        _oS.display="block";
        _tS.width =  _Min+ "px";
        _cB.style.display= "none";
        if (_SAW >= 1206){_tS.left=rPos;}
    };

    _oB.onclick = function()
    {
        _oS.display="none";
        _cB.style.display="block";
        _tS.width = _Max+ "px";
        if (_SAW >=1206){_tS.left = lPos;}
        if (isIE6){_tS.top = _DDE.scrollTop + _DDE.clientHeight - 250 + "px";}
    };
}