

//<!--供求快讯 专利产品 国际采购 新奇特 begin-->
function GetObj(objName){
	if(document.getElementById){
		return eval('document.getElementById("' + objName + '")');
	}else if(document.layers){
		return eval("document.layers['" + objName +"']");
	}else{
		return eval('document.all.' + objName);
	}
}

function ADMenu(index,flag){
	for(var i=0;i<4;i++){/* 最多支持4个标签 */
		if(GetObj("ADcon"+i)&&GetObj("ADm"+i)){
			GetObj("ADcon"+i).style.display = 'none';
			GetObj("ADm"+i).className = "ADmenuOff";
		}
	}
	if(GetObj("ADcon"+index)&&GetObj("ADm"+index)){
		GetObj("ADcon"+index).style.display = 'block';
		GetObj("ADm"+index).className = "ADmenuOn";
	}
}
//<!--供求快讯 专利产品 国际采购 新奇特 end-->

//<!--新闻 财经 专利 begin-->
var debug = false ;
function switchTab (tab)
{	
	
	//event.returnValue = false ;
	//alert(1);
	var tabName = getTabGroupName (tab.id) ;
	if (tabName == '')
	{	alert ("No tabName for tab [" + tab.id + "]") ;
		return ;
	}
	var index = 1 ;
	while (true)
	{	var tabTitle = eval ("document.all ('" + tabName + '_' + index + "')") ;
		if (tabTitle == undefined)
			break ;
		deactiveTabTitle (tabTitle , tabName) ;
		var tabContent = eval ("document.all ('" + tabName + '_' + index + '_content' + "')") ;
		if (tabContent != undefined)
			{tabContent.style.display = "NONE";}
		index ++ ;
	}
	if (debug)
		alert ("Find " + (index - 1) + " tab title(s) for TabName [" + tabName + "]") ;
	activeTabTitle (tab , tabName) ;
	var tabContent = eval ("document.all ('" + tab.id + '_content' + "')") ;
	if (tabContent != undefined)
		tabContent.style.display = "BLOCK" ;
}	
function getTabGroupName (tabId)
{
	if (tabId == '' || tabId == undefined)
	{
		alert ("tabId is NULL! [" + tabId + "]") ;
		return ;
	}
	var i = tabId.lastIndexOf ('_') ;
	if (i <= 1)
		return '' ;
	return tabId.substr (0 , i) ;
}
function deactiveTabTitle (tab , tabName)
{		tab.className = tabName + "_off" ;
}

function activeTabTitle (tab , tabName)
{		tab.className = tabName + "_on" ;
}
//<!--新闻 财经 专利 end-->

//<!--搜索框 begin-->
function s_chg(td_now)
{
	s_td_1.className = s_td_2.className = s_td_3.className = s_td_4.className = s_td_5.className = s_td_6.className = s_td_7.className = "s_of";
	td_now.className = "s_on";
}

function mouse_on(td_now)
{
	if(td_now.className == "s_on") return false;
	else td_now.className = "m_on";
}

function mouse_of(td_now)
{
	if(td_now.className == "s_on") return false;
	else td_now.className = "s_of";
}
//<!--搜索框 end-->

//<!--行业资讯 价格快报 begin-->
function setTab01Syn(i){
selectTab01Syn(i);
}
function selectTab01Syn(i){
switch(i){
case 1:
document.getElementById("TabTab01Con1").style.display="block";
document.getElementById("TabTab01Con2").style.display="none";
break;
case 2:
document.getElementById("TabTab01Con1").style.display="none";
document.getElementById("TabTab01Con2").style.display="block";
break;
case 3:
document.getElementById("TabTab01Con3").style.display="block";
document.getElementById("TabTab01Con4").style.display="none";
break;
case 4:
document.getElementById("TabTab01Con3").style.display="none";
document.getElementById("TabTab01Con4").style.display="block";
break;
}
}
//<!--行业资讯 价格快报 end-->

function search4(){
	var  abc_value
	var  aa = document.getElementsByName("abc");  
	for  (var  i=0;  i<aa.length;  i++)  
	{  
		 if(aa[i].checked) abc_value=aa[i].value;  
	} 
	if(abc_value==1)window.open("http://search.china.alibaba.com/selloffer/"+searchform1.key.value+".html","alibaba");
	if(abc_value==2)window.open("http://www.search.hc360.com/cgi-bin/seinterface.cgi?word="+searchform1.key.value,"hc360");
	//if(abc_value==3)window.open("http://www.mainone.com/ProductFlat/SearchResult.aspx?keyword="+searchform1.key.value + "&searchtype=supply&type=bykeyword&&For=supply","mainone");
	if(abc_value==3)window.open("http://search.www.com.cn/search.aspx?keyword="+searchform1.key.value + "&InfoCate=0&Industry=0&region=0&bizType=1","www");
	if(abc_value==4)window.open("http://www.sogou.com/web?query="+searchform1.key.value ,"www");
	if(abc_value==6)window.open("http://b2b.bosslink.com/supply/search.asp?s1="+searchform1.key.value + "&s2=all-al","bosslink");
	if(abc_value==9)window.open("http://www.sogou.com/web?sogouhome=&shuru=shou&query="+searchform1.key.value,"mspg1");
	if(abc_value==13)window.open("http://search.cn.yahoo.com/search?p="+searchform1.key.value,"mspg2");
	if(abc_value==7)window.open("http://www.google.com.hk/search?hl=zh-CN&q="+searchform1.key.value,"mspg4");
	if(abc_value==8)window.open("http://www.baidu.com/s?tn=&word="+searchform1.key.value,"mspg6");
	//if(abc_value==100)window.open("http://www.sogou.com/web?query="+searchform1.key.value+"+site%3Aqianyan.biz&num=10&clusterfilter=on");
	//if(abc_value==100)window.open("http://www.qianyan.biz/search.do?key="+searchform1.key.value);
	if(abc_value==100)window.open("http://search.qianyan.biz/search.do?q="+searchform1.key.value);
	//if(abc_value==101)window.open("http://www.qianyan.biz/search_product.do?key="+searchform1.key.value);	
	if(abc_value==101)window.open("http://search.qianyan.biz/search.do?q="+searchform1.key.value);	
	return false;
}

function formatIt(sSource){
	var arrString = sSource.split("");
	var j=0;
	var sResult="";
	for (i=arrString.length-1;i>=0;i--){

		if(j==3){
			j=0;
			sResult =sResult +"," ;
		}
		sResult = sResult + arrString[i]
		j++;
	}
	arrString = sResult.split("");
	sResult = "";
	for (i=arrString.length-1;i>=0;i--){
		sResult = sResult + arrString[i];
	}
	return sResult;
}
