//head.php 欢迎语
function Marquee(o, lh, speed, delay)
{
	var p=false;
	var t;
	o.innerHTML += o.innerHTML;
	o.style.marginTop = "0px";
	o.onmouseover = function(){p = true;}
	o.onmouseout = function(){p = false;}

	function start()
	{
		if(!p) o.style.marginTop = parseInt(o.style.marginTop) - 1 + "px";
		t = setInterval(scrolling, speed);
	}

	function scrolling()
	{
		if(parseInt(o.style.marginTop) % lh != 0)
		{
			o.style.marginTop = parseInt(o.style.marginTop) - 1 + "px";
			if(Math.abs(parseInt(o.style.marginTop)) >= o.scrollHeight/2) 
				o.style.marginTop = o.scrollHeight/2 - Math.abs(parseInt(o.style.marginTop)) + "px";
		}
		else
		{
			clearInterval(t);
			setTimeout(start, delay);
		}
	}
	setTimeout(start, delay);
}


//single.php 相关文章
function g(o){return document.getElementById(o);}
            function HoverLi(n){
            for(var i=1;i<=4;i++){g('post_tab'+i).className='normal_tab';g('tbc_0'+i).className='pld_none';}g('tbc_0'+n).className='pld_show';g('post_tab'+n).className='hover_tab';
            }
//滑动标签如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;

//sidebar.php feed
function showDiv(objectID) {
                        var theElementStyle = document.getElementById(objectID);
                        if(theElementStyle.style.display == "block"){
                        theElementStyle.style.display = "none";
                        }else{
                        theElementStyle.style.display = "block";}
                        }


//taoshopping
function displayA(num){
	for(var i=1;i<=8;i++){
		if(i!=num){
	document.getElementById("width_li_a"+i).style.display = "none";
	document.getElementById("narrow_li_a"+i).style.display = "";
		}
		else{
	document.getElementById("width_li_a"+i).style.display = "";
	document.getElementById("narrow_li_a"+i).style.display = "none";

		}
	}
}

function displayB(num){
	for(var i=1;i<=8;i++){
		if(i!=num){
	document.getElementById("width_li_b"+i).style.display = "none";
	document.getElementById("narrow_li_b"+i).style.display = "";
		}
		else{
	document.getElementById("width_li_b"+i).style.display = "";
	document.getElementById("narrow_li_b"+i).style.display = "none";

		}
	}
}

function displayC(num){
	for(var i=1;i<=8;i++){
		if(i!=num){
	document.getElementById("width_li_c"+i).style.display = "none";
	document.getElementById("narrow_li_c"+i).style.display = "";
		}
		else{
	document.getElementById("width_li_c"+i).style.display = "";
	document.getElementById("narrow_li_c"+i).style.display = "none";

		}
	}
}

function displayTaobao(num){
	for(var i=1;i<=3;i++){
		if(i!=num){
		document.getElementById("man_div"+i).style.display = "none";
		document.getElementById("taobao_nav"+i).style.background = "";
		}
		else{
		document.getElementById("man_div"+i).style.display = "";
		document.getElementById("taobao_nav"+i).style.background = "ffffff";
		}
	}
}

function menuFix() { 
var sfEls = document.getElementById("nav").getElementsByTagName("li"); 
for (var i=0; i <sfEls.length; i++) { 
  sfEls[i].onmouseover=function() { 
  this.className+=(this.className.length>0? " ": "") + "sfhover"; 
  } 
  sfEls[i].onMouseDown=function() { 
  this.className+=(this.className.length>0? " ": "") + "sfhover"; 
  } 
  sfEls[i].onMouseUp=function() { 
  this.className+=(this.className.length>0? " ": "") + "sfhover"; 
  } 
  sfEls[i].onmouseout=function() { 
  this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), 
""); 
  } 
} 
} 
