function MM_openBrWindow(theURL,winName,features) { //v2.0
 window.open(theURL,winName,features);
}
function openWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function olImg() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=olImg.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function show_div(div_id,obj){
var  t_id = document.getElementById(div_id);
var  t_num = document.getElementById(obj);
if (t_id.style.display == ""){
t_id.style.display = "none";
t_num.style.background = "url('http://img.iance.com/2008/left_menu_title_down.gif') no-repeat 5px 0px";
}else{
t_id.style.display = "";
t_num.style.background = "url('http://img.iance.com/2008/left_menu_title_up.gif') no-repeat 5px 0px";
}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function slideLine(ul, delay, speed, lh) {
var slideBox = (typeof ul == 'string')?document.getElementById(ul):ul;
var delay = delay||1000, speed=speed||20, lh = lh||20;
var tid = null, pause = false;
var start = function() {
tid=setInterval(slide, speed);
}
var slide = function() {
if (pause) return;
slideBox.scrollTop += 2;
if (slideBox.scrollTop % lh == 0) {
clearInterval(tid);
slideBox.appendChild(slideBox.getElementsByTagName('li')[0]);
slideBox.scrollTop = 0;
setTimeout(start, delay);
}
}
slideBox.onmouseover=function(){pause=true;}
slideBox.onmouseout=function(){pause=false;}
setTimeout(start, delay);
}
function show_menu(obj_s,obj){
var  s_id = document.getElementById(obj_s);
var  sc_id = document.getElementById(obj);
s_id.style.display = "";
sc_id.className = "ahv";
}
function hide_menu(obj_h,obj){
var  h_id = document.getElementById(obj_h);
var  hc_id = document.getElementById(obj);
h_id.style.display = "none";
hc_id.className = "alk";
}

function Company(UID) { //v2.0
window.open('http://corp.iance.com/Url.phtml?UID='+UID);
}
function PowerByAnce() { //v2.0
window.open('Power.php','builder','width=458,height=330,statusbar=no,scrollbars=no,toolbar=no');
}
function Card(SID) { //v2.0
window.open('http://corp.iance.com/ShowCard.php?SID='+SID,'od','width=418,height=258,resizable=0,scrollbars=1,status=no,toolbar=no,location=no,menu=no');
}
function js_callpage(url){
        window.open('http://News.iance.com/detail.php?url='+url);
        return false;
}
function js_icppage(){
        window.open('http://about.iance.com/icp.phtml');
        return false;
}
function js_sender(url) {
	window.open('SendMail.phtml?Url='+url,'od','width=408,height=558,resizable=0,scrollbars=0,status=no,toolbar=no,location=no,menu=no');
	return false;
}

function Login() {

	if (document.login.username.value==""){
		alert("请输入用户名");
		document.login.username.focus();
		return;
	}

	if (document.login.loginpass.value==""){
		alert("请输入密码");
		document.login.loginpass.focus();
		return;
	}

        index = document.login.usertype.selectedIndex;
        user_to= document.login.usertype.options[index].value ;
        if (user_to=="1"){
	document.login.action="login.php?action=login";
	document.login.submit();
        }
        if (user_to=="2"){
	document.login.action="login.php?action=ACTUsr";
	document.login.submit();
        }
        if (user_to=="3"){
	document.login.action="login.php?action=ASTUsr";
	document.login.submit();
        }
        if (user_to=="4"){
	document.login.action="login.php?action=login";
	document.login.submit();
        }
       if (user_to=="5"){
	document.login.action="http://en.iance.net/login.php?action=login";
	document.login.submit();
        }
       if (user_to=="6"){
	document.login.action="http://mail.iance.net/";
	document.login.submit();
        }
        if (user_to=="7"){
	document.login.action="http://job.iance.com/Into.php?action=person";
	document.login.submit();
        }
       if (user_to=="8"){
	document.login.action="http://job.iance.com/Into.php?action=company";
	document.login.submit();
        }
       if (user_to=="9"){
	document.login.action="http://bbs.iance.com/login.php?action=login";
	document.login.submit();
        }
       
}	

function checkdata() {

        if( form.key.value == "") {
                alert("请输入关键字 !!")
                return false;
        }
        return true;
}

function urlencode(inputString) {

              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;

}
function emptySearchBox(searchbox) {
    if (searchbox.value.substring(0,3) == "请输入") {
      searchbox.value='';      
    }
}
function clean(j,k,n){
var i;
for (i=j; i<k; i++){
dva= "sc"+i;
dvb="sc"+n;
tra="tab"+i;
trb="tab"+n;
eval(dva).style.display='none';
eval(dvb).style.display='';
eval(tra).className='scgray';
eval(trb).className='scred';
eval(trb).style.cursor='hand';
}
}
 function TreSearch() {
    var v = iShce.KeyWords.value;
    if(v.length > 50){
    alert("您输入的关键字过长！");
    return false;
    }
        if (iShce.KeyWords.value ==""){
	alert("请输入您的商业信息搜索关键字");
	iShce.KeyWords.focus();
	return false;
        }
		        if (iShce.KeyWords.value.substring(0,3) == "请输入"){
	alert("请输入您的商业信息搜索关键字");
	return false;
        }
   }
 function ProSearch() {
    var v = iAbc.KeyWords.value;
    if(v.length > 50){
    alert("您输入的关键字过长！");
    return false;
    }
        if (iAbc.KeyWords.value ==""){
	alert("请输入您的产品信息搜索关键字");
	iAbc.KeyWords.focus();
	return false;
        }
		        if (iAbc.KeyWords.value.substring(0,3) == "请输入"){
	alert("请输入您的商业信息搜索关键字");
	return false;
        }
   }
 function CorpSearch() {
    var v = iAce.KeyWords.value;
    if(v.length > 50){
    alert("您输入的关键字过长！");
    return false;
    }
        if (iAce.KeyWords.value ==""){
	alert("请输入您的企业信息搜索关键字");
	iAce.KeyWords.focus();
	return false;
        }
				        if (iAce.KeyWords.value.substring(0,3) == "请输入"){
	alert("请输入您的商业信息搜索关键字");
	return false;
        }
   }
    function Search() {
    var v = iAoce.KeyWords.value;
    if(v.length > 50){
    alert("您输入的关键字过长！");
    return false;
    }
        if (iAoce.KeyWords.value ==""){
	alert("请输入您需要查找的产品、商机、公司及电子样本名称信息搜索关键字");
	iAoce.KeyWords.focus();
	return false;
        }
	 if (iAoce.KeyWords.value.substring(0,3) == "请输入"){
	alert("请输入您需要查找的产品、商机、公司及电子样本名称信息搜索关键字");
	return false;
        }
   }

function showSub(j,k,n){
var i;

for (i=j; i<k; i++){
dta= "st"+i;
dtb="st"+n;
sra="tsb"+i;
srb="tsb"+n;
xra="trb"+i;
xrb="trb"+n;
iam="image/n_n_"+i+".gif";
ibm="image/n_n_"+n+"_1.gif";
eval(dta).style.display='none';
eval(dtb).style.display='';
eval(sra).src=iam;
eval(srb).src=ibm;
eval(xra).className='';
eval(xrb).className='';
eval(xrb).style.cursor='hand';
}
}

function closeNotice(){
	try{	
	document.getElementById('notice').style.display='none';
	if(moveBox){
		
	}else{
		moveBox = new MoveBox(document.getElementById('menu_list'));
		initMoveBox(moveBox,true)
	}
	}catch(e){
	}
}

function sr_init(){
var n = $("sr_n").value
var c = $("tl_"+n).className
$("tl_"+n).className = c.replace("_","_v_")
$("tl_"+n).onclick = $("tl_"+n).onmouseover = function(){return false}
}
function getCookie(sName) {
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}
return null;
}
function initHistory(){
var keys_str = getCookie('h_keys');
if(keys_str != null  )
{
var keys_array = keys_str.split("#");
if(keys_array.length >= 5){
var strlen =0;
var str="最近搜索记录：";
for(var i=0;i<keys_array.length && i<9;i++){
var type = keys_array[i].substring(keys_array[i].length-3,keys_array[i].length);
var key = keys_array[i].substring(0,keys_array[i].length-3);
strlen = strlen + key.length;
if(strlen < 30){
if(type =='[供]')
str+=" <a target=_blank href=http://search.iance.com/selloffer/"+encodeURI(key)+".html?tracelog=jy_homepage_historyky class=textwhite onMouseDown=\"return aliclick(this,'?tracelog=ui_homepage_searchbuy');\">"+ key +"</a> ";
else
str+=" <a target=_blank href=http://search.iance.com/buyoffer/"+encodeURI(key)+".html?tracelog=jy_homepage_historyky class=textwhite onMouseDown=\"return aliclick(this,'?tracelog=ui_homepage_searchsellerkey');\">"+ key +"</a> ";
}
}
document.getElementById("sform_1").innerHTML=str;
}
}
}
var searchActivedItem=1;
//结构化搜索
function SB_OnBlur_x(ctrlObj,ctrlMenuID, event){
if(searchActivedItem == 1){
return SB_OnBlur(ctrlObj,ctrlMenuID, event)
}else{
return true;
}
}
function SB_OnKeyDown_x(ctrlObj,ctrlMenuID, event){
if(searchActivedItem == 1){
return SB_OnKeyDown(ctrlObj,ctrlMenuID, event)
}else{
return true;
}
}
function SB_OnKeyUp_x(ctrlObj,ctrlMenuID, event){
if(searchActivedItem == 1){
return SB_OnKeyUp(ctrlObj,ctrlMenuID, event)
}else{
return true;
}
}
//new
function initDefaultValue(){
var keyW = getQuery("KeyWords");
if(keyW&&keyW!="")document.getElementById("sr_keyw").value = decodeURI(keyW);
}
function getQuery(name)
{
　　var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
　　var r = location.href.substr(location.href.indexOf("\?")+1).match(reg);
　　if (r!=null) return r[2]; return null;
}
function getkeyword(obj){
var skey = document.getElementById("sr_keyw").value;
if(trim(skey)==""||"请输入"==skey.substring(0,3)){
return true;
}else{
window.location.href=obj.href+"?KeyWords="+encodeURI(skey);
return false;
}
}

/*  ObjectSwap for ie
Author: Karina Steffens, www.neo-archaic.net
simplify by xiaoma<xiaoma@taobao.com> at 2007-01-17
*/
//document.write('<style id="hideObject">object{visibility:hidden;}</style>');
(function(){
/*
var style = document.createElement("style");
style.setAttribute("type", "text/css");
style.setAttribute("id", "hideObject");
style.styleSheet.cssText = "object{visibility:hidden;}";
document.getElementsByTagName("head")[0].appendChild(style);
*/
var objects = document.getElementsByTagName("object");
for (var i=0; i<objects.length; i++){
var o = objects[i];
if (o.className.indexOf("NoSwap") != -1) continue;
var h = o.outerHTML;
var params = "";
var hasFlash = true;
for (var j = 0; j<o.childNodes.length; j++) {
var p = o.childNodes[j];
if (p.tagName == "PARAM")
params += p.outerHTML;
}
var tag = h.split(">")[0] + ">";
var newObject = tag + params + o.innerHTML + " </OBJECT>";
o.outerHTML = newObject;
}
//document.getElementById("hideObject").disabled = true;
})();

	function switchsear(no){
		document.getElementById('sear1').className='c_unsel';
		document.getElementById('sear2').className='c_unsel';
		document.getElementById('sear3').className='c_unsel';
		document.getElementById('c_Trade').style.display="none";
		document.getElementById('c_Corp').style.display="none";
		document.getElementById('c_Product').style.display="none";
		document.getElementById('sear'+no).className='c_sel';
		switch(no){
			case 3:
				document.getElementById('c_Corp').style.display="block";
				break;
			case 2:
				document.getElementById('c_Product').style.display="block";
				break;
			default:
				document.getElementById('c_Trade').style.display="block";
				break;
		}
		return false;
	}
	function guide(no){
		document.getElementById('guide1').className='c_unsel';
		document.getElementById('guide2').className='c_unsel';
		document.getElementById('guide3').className='c_unsel';
		document.getElementById('a_guide').style.display="none";
		document.getElementById('c_guide').style.display="none";
		document.getElementById('b_guide').style.display="none";
		document.getElementById('guide'+no).className='c_sel';
		switch(no){
			case 3:
				document.getElementById('c_guide').style.display="block";
				break;
			case 2:
				document.getElementById('b_guide').style.display="block";
				break;
			default:
				document.getElementById('a_guide').style.display="block";
				break;
		}
		return false;
	}
	function products(no){
		document.getElementById('pro1').className='c_unsel';
		document.getElementById('pro2').className='c_unsel';
		document.getElementById('pro_1').style.display="none";
		document.getElementById('pro_2').style.display="none";
		if(no==1){
			document.getElementById('pro1').className='c_sel';
		}else{
			document.getElementById('pro2').className='c_sel';
		}
		switch(no){
			case 1:
				document.getElementById('pro_1').style.display="block";
				break;
			case 2:
				document.getElementById('pro_2').style.display="block";
				break;
			default:
				document.getElementById('pro_1').style.display="block";
				break;
		}
		return false;
	}
