// JavaScript Document
var stopscrollC = true;
var cur=1;

function g(formname)	{
	var url = "http://www.baidu.com/baidu";
	formname.ct.value = "2097152";
	formname.action = url;
	return true;
}
function onload_Func(){
	var o=document.getElementById('box');
	window.setInterval(function(){scrollup(o,60,0);},3000);
}
function scrollup(o,d,c){
	if(!stopscrollC) return;
	if(d==c){
		var t=getFirstChild(o.firstChild).cloneNode(true);
		o.removeChild(getFirstChild(o.firstChild));
		o.appendChild(t);
		t.style.marginTop="0px";
	}else{
		c+=2;
		getFirstChild(o.firstChild).style.marginTop=-c+"px";
		window.setTimeout(function(){scrollup(o,d,c)},20);
	}
}
function getFirstChild(node){
	while (node.nodeType!=1)
	{
		node=node.nextSibling;
	}
	return node;
}
function div_start(){
	stopscrollC = true;
}
function div_stop(){
	stopscrollC = false;
}


//首页滚动JS代码
function opentimer(){
	timerID = setInterval("change()",2000);
}
function change(){
	var curPre = cur-1;
	//7轮为一循环
	if(cur == 1){
		curPre = 7;
	}
	//上轮失去焦点，当前轮获取焦点
	document.getElementById("nav"+curPre).className="nav"+curPre;
	document.getElementById("nav_c_"+curPre).className="yincang";
	document.getElementById("nav"+cur).className="nav"+cur+"_active";
	document.getElementById("nav_c_"+cur).className="";
	
	//指针下移
	if(cur == 7){
		cur = 1;
	}else{
		cur++;
	}
	return;
}
function change1(id){
	clearInterval(timerID);
	for (var i=1; i<=7; i++){
		//当前鼠标所在的行获取焦点
		if(id == i){
			document.getElementById("nav"+i).className="nav"+i+"_active";
			document.getElementById("nav_c_"+i).className="";
		}else{
			document.getElementById("nav"+i).className="nav"+i;
			document.getElementById("nav_c_"+i).className="yincang";
		}
	}
	cur=id;
}
	
	
