//翻页的跳转
function GoToTheUrl(TheSelect)
{
	window.open(TheSelect.value,"_self");
}
//限制内容图片大小
function resize(o) {
	if (o.width>680) {
	o.style.width='680px';
	o.style.height='auto';
	}
}

function ShowFlash(flashWIDTH,flashHEIGHT,flashURL)
{
document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+'>'); 
document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">'); 
document.writeln ('<PARAM NAME=wmode VALUE=transparent>'); 
document.writeln ('<PARAM NAME=loop VALUE=true>'); 
document.writeln ('<PARAM NAME=quality VALUE=high>'); 
document.writeln ('<EMBED src="'+flashURL+'" loop=true wmode=transparent quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>'); 
document.writeln ('</OBJECT>'); 
}

function SetLeftAndRightH()
{
	document.getElementById("Xiao-Nav").style.height='auto';
	var Big_Nav=document.getElementById("Big-Nav").clientHeight;
	var Xiao_Nav=document.getElementById("Xiao-Nav").clientHeight;
	
	document.getElementById("Xiao-Nav").style.height='729px';
	document.getElementById("Xiao-Nav").style.overflowY="scroll";
	
	
	//if (Big_Nav>Xiao_Nav)
//	{
//		var NewsHeight=Big_Nav+10;
//		document.getElementById("Xiao-Nav").style.height=NewsHeight+'px';
//	}
}
var Sort2Name="";

function CkDkuang(thisValue,AllValue,EjValue)
{
	for(var i=1;i<=AllValue;i++)
	{
		if (i==1)
		{document.getElementById("Big"+i).className='frist';}
		else
		{document.getElementById("Big"+i).className='';}
		document.getElementById("Sort"+i).style.display='none';
	}
	if(thisValue==1)
	{document.getElementById("Big"+thisValue).className='frist onfocus';}
	else
	{document.getElementById("Big"+thisValue).className='onfocus';}
	document.getElementById("Sort"+thisValue).style.display='';
	if (EjValue>0)
	{
		//CkXKuang(thisValue,'1',EjValue)
	}
	SetLeftAndRightH();
}

function CkXKuang(thisSortValue,thisValue,AllValue)
{
	//for(var i=1;i<=AllValue;i++)
//	{
//		if(document.getElementById("Sort"+thisSortValue+"_Pic"+i)!=null)
//		{
//			document.getElementById("Sort"+thisSortValue+"_Pic"+i).src="images/jia.jpg";
//			document.getElementById("Sort"+thisSortValue+"_List"+i).style.display='none';
//		}
//	}
	
	
	if(document.getElementById("Sort"+thisSortValue+"_Pic"+thisValue)!=null)
	{
		if(document.getElementById("Sort"+thisSortValue+"_List"+thisValue).style.display=='')
		{
			document.getElementById("Sort"+thisSortValue+"_Pic"+thisValue).src="images/jia.jpg";
			document.getElementById("Sort"+thisSortValue+"_List"+thisValue).style.display='none';
		}
		else
		{
			document.getElementById("Sort"+thisSortValue+"_Pic"+thisValue).src="images/jian.jpg";
			document.getElementById("Sort"+thisSortValue+"_List"+thisValue).style.display='';
		}
		//if (Sort2Name=="")
//		{
//			document.getElementById("Sort"+thisSortValue+"_Pic"+thisValue).src="images/jian.jpg";
//			document.getElementById("Sort"+thisSortValue+"_List"+thisValue).style.display='';
//			Sort2Name="Sort"+thisSortValue+"_List"+thisValue;
//		}
//		else
//		{
//			if(Sort2Name=="Sort"+thisSortValue+"_List"+thisValue)
//			{Sort2Name="";}
//			else
//			{
//				document.getElementById("Sort"+thisSortValue+"_Pic"+thisValue).src="images/jian.jpg";
//				document.getElementById("Sort"+thisSortValue+"_List"+thisValue).style.display='';
//				Sort2Name="Sort"+thisSortValue+"_List"+thisValue;
//			}
//		}
	}
	SetLeftAndRightH();
}
function OpenFrist(thisSortValue,thisValue,AllValue)
{
	if(document.getElementById("Sort"+thisSortValue+"_Pic"+thisValue)!=null)
	{
		document.getElementById("Sort"+thisSortValue+"_Pic"+thisValue).src="images/jian.jpg";
		document.getElementById("Sort"+thisSortValue+"_List"+thisValue).style.display='';
	}
}


//向下滚动
function DownScroll(dome,dome1,dome2)
{
	var speed=30
	var A2=document.getElementById(dome2);
	var A1=document.getElementById(dome1);
	var A=document.getElementById(dome);
	A2.innerHTML=A1.innerHTML;
	Marquee2(dome,dome1,dome2);
	//A.scrollTop=A.scrollHeight
	var MyMar2=setInterval(function(){Marquee2(dome,dome1,dome2);},speed)
	A.onmouseover=function() {clearInterval(MyMar2)}
	A.onmouseout=function() {MyMar2=setInterval(function(){Marquee2(dome,dome1,dome2);},speed)}
}

function Marquee2(dome,dome1,dome2)
{
	var B2=document.getElementById(dome2);
	var B1=document.getElementById(dome1);
	var B=document.getElementById(dome);
	var n=get_offset(B2)-get_offset(B1);
	//求相对上个节点的唯移动(兼容目的)
	//B2.offsetTop 有可能是相对上个节点 有可能是相对BODY
	if(n-B.scrollTop<=0)
		B.scrollTop-=B1.offsetHeight
	else
	{
		B.scrollTop++
	}
}
function get_offset(obj){
    var offsetparent = obj;
	var top=0
    while(offsetparent != null && offsetparent.nodeName != "BODY"){
         //left += offsetparent.offsetLeft;
         top += offsetparent.offsetTop;
         offsetparent=offsetparent.parentNode;
    }
	return top;
}

//搜索
function OpenTheSearch()
{
	if(document.getElementById("TheSearchTxt").value=="" || document.getElementById("TheSearchTxt").value=="产品搜索")
	{
		alert("请输入产品关键字");
		return false;
	}
	var TheValue=document.getElementById("TheSearchTxt").value;
	window.open("News_List.asp?tag=Search&txt="+TheValue,"_self");
}

function liover(n,obj)
{
	obj.src="images/nav_"+n+".jpg";
}
function liout(n,obj)
{
	obj.src="images/nava_"+n+".jpg";
}
