/*切换*/
function setTab(name,cursel,n,t){
	for(var i=1;i<=n;i++){	
		var menu=document.getElementById(name+i);
		if(!menu){
			if (t==0)cursel++;
			continue;
		}
		var con=document.getElementById("con_"+name+"_"+i);
		menu.className=(i==cursel?"hover":"");
		con.style.display=(i==cursel?"block":"none");
	}
}

/*显示联系方式*/
function linkinfo(id)
{
document.getElementById('link_id').style.display="";
document.getElementById('link_id').src='/inc/showlink.shtml?id='+id;
}

function DrawImage(ImgD){
   var flag=false;
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= 200/200){
     if(image.width>200){  
     ImgD.width=500;
	 ImgD.height=(image.height*500)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }

     }
    else{
     if(image.height>200){  
     ImgD.height=500;
     ImgD.width=(image.width*500)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }

     }
    }
   }
function changeImg(ImgD,width,height) {
   var flag=false;
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= 1){
     if(image.width>width){ 
		  if ((image.height*width/image.width)<height)
		  {
             ImgD.width=width;
	         ImgD.height=(image.height*width)/image.width;

		  }
          else{
			 ImgD.height=height;
			 ImgD.width=(image.width*height)/image.height;     
		  }
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }

     }
    else{
     if(image.height>height)
	 {  
         if ((image.width*height/image.height)<width)
         {
            ImgD.height=height;
            ImgD.width=(image.width*height)/image.height;     
         }
		 else{
             ImgD.width=width;
	         ImgD.height=(image.height*width)/image.width;
		 }
     }
	 else
	 {
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     }
    }
   }

function actCheckbox(){
    var obj = document.getElementsByName("cmpId");
    for(var i = 0;i < obj.length;i++){
      //全选复选框
        obj[i].checked = true;

    }
  }
  
function cleanChecked(){ 
  if(confirm("您确认执行清空操作吗？")){
    var obj = document.getElementsByName("cmpId");
    for(var i = 0;i < obj.length;i++){
      //清空复选框
      if(obj[i].checked){
        obj[i].checked = false;
      }

    }
  }
}

function Logger(logname)
{
	if(logname == null || logname == "")
		return;
	try {
	  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	  try {
	    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (e2) {
	    xmlHttp = false;
	  }
	}
	
	if (!xmlHttp && typeof(XMLHttpRequest) != 'undefined') {
	  xmlHttp = new XMLHttpRequest();
	}


	if(xmlHttp){
		var bust = Math.random()* 1000000000000000000;
		var url = "/search/log.html?type="+logname + "&rnd=" + bust;
		try {
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
		} catch (e3) {
		
		}
	}
	
}

$=function(id){return document.getElementById(id)}

function chbg_1(_this,ev){
	if(ev==2) {
		_this.className="current";
		for(i=1;i<=10;i++){
			tag_1Obj = eval("$('tag" + i +"_1')");
			//sContent = eval("$('searchcontent_1" + i + "')");
			if(tag_1Obj==_this) {
				tag_1Obj.style.backgroundPosition="0 -46px";
				tag_1Obj.style.color="#fff";
				tag_1Obj.style.fontWeight="bold";  
				//tag_1Obj.className="fontb";
				//$("searchkeywords").innerHTML=sContent.innerHTML;
			}else{
				tag_1Obj.style.backgroundPosition="0 0";
				tag_1Obj.style.color="#333";
				tag_1Obj.style.fontWeight="normal";  
				tag_1Obj.className="";
			}
		}		
	}
	if(_this.className!="current"){
		if(ev==1) _this.style.backgroundPosition="0 -46px";
	}
}


function getObj(objName){return(document.hyformnew.elements[objName]);}
function tag_1(id){
	
	var k = document.getElementById("hyformnew").k.value;
	if(k == "" || k == "输入关键字" || k=="请输入您感兴趣的产品"||k=="请输入产品名的关键字"||k=="请输入公司名的关键字"||k=="请输入您感兴趣的关键字")
	{
		switch(id){
		case 1:
		getObj('k').value="请输入您感兴趣的关键字"; getObj('c').value="supply"; break;
		case 2:
		getObj('k').value="请输入您感兴趣的关键字"; getObj('c').value="need"; break;
		case 3:
		getObj('k').value="请输入您感兴趣的关键字"; getObj('c').value="product"; break;
		case 4:
		getObj('k').value="请输入您感兴趣的关键字"; getObj('c').value="company";break;
		case 5:
		getObj('k').value="请输入您感兴趣的关键字"; getObj('c').value="brand"; break;
		case 6:
		getObj('k').value="请输入您感兴趣的关键字"; getObj('c').value="site"; break;
		case 7:
		getObj('k').value="请输入您感兴趣的关键字"; getObj('c').value="news";break;
		case 8:
		getObj('k').value="请输入您感兴趣的关键字"; getObj('c').value="job";break;
		case 9:
		getObj('k').value="请输入您感兴趣的关键词"; getObj('c').value="bbs";break;
		case 10:
		getObj('k').value="请输入您感兴趣的关键词"; getObj('c').value="blog";break;
		}
	}
	else {
		document.getElementById("hyformnew").k.value = k;
		switch(id) {
		case 1:
			getObj('c').value="supply";  break;
		case 2:
		 	getObj('c').value="need"; break;
		case 3:
		 	getObj('c').value="product";  break;
		case 4:
		 	getObj('c').value="company"; break;
		case 5:
		 	getObj('c').value="brand"; break;
		case 6:
		 	getObj('c').value="site"; break;
		case 7:
		 	getObj('c').value="news";break;
 		case 8:
		 	getObj('c').value="job";break;
 		case 9:
		 	getObj('c').value="bbs";break;
		case 10:
			getObj('c').value="blog";break;

		}
	}
}


document.write("<script src=http://ad.oy66.com/ip.asp?loc=wenzhou><\/script>");
function check(theForm)
{
	k=theForm.k.value;
	
	if (k.substring(0,3) =="请输入" || k == "")
	{
		alert("请输入查询内容！");
		theForm.k.focus();
		return false;
	}
	if (theForm.c.value=="supply")
	{
		theForm.action="http://i.wenzhouglasses.com/Trade.shtml?L=1&K=" + k;
	}
	else if (theForm.c.value=="need")
	{
		theForm.action="http://i.wenzhouglasses.com/Trade.shtml?L=2&K=" + k;
	}
	else if (theForm.c.value=="product")
	{
		theForm.action="http://i.wenzhouglasses.com/Pro.shtml?K=" + k;
	}
	else if (theForm.c.value=="company")
	{
		theForm.action="http://i.wenzhouglasses.com/Company.shtml?K=" + k;
	}
	else if (theForm.c.value=="brand")
	{
		theForm.action="http://i.wenzhouglasses.com/brand.shtml?K=" + k;
	}

	else if (theForm.c.value=="site")
	{
		theForm.action="http://i.wenzhouglasses.com/site.shtml?K=" + k;
	}
	else if (theForm.c.value=="news")
	{
		theForm.action="http://i.wenzhouglasses.com/News.shtml?K=" + k;
	}
	else if (theForm.c.value=="job")
	{
		theForm.action="http://i.wenzhouglasses.com/Job.shtml?K=" + k;
	}
	else if (theForm.c.value=="bbs")
	{
		theForm.action="http://bbs.wenzhouglasses.com/query.asp?boardid=0&keyword=" + k;
	}
	else if (theForm.c.value=="blog")
	{
		theForm.action="http://blog.wenzhouglasses.com/listLog.shtml?keyword=" + k;
	}
	return true;
}

function Show_Sub_n(id_num,num){ //舌签功能
	for(var i = 1;i <= 3;i++){
		if(GetObj("S_Menu_" + id_num + i)){GetObj("S_Menu_" + id_num + i).className = '';}
		if(GetObj("S_Cont_" + id_num + i)){GetObj("S_Cont_" + id_num + i).style.display = 'none';}
	}
	if(GetObj("S_Menu_" + id_num + num)){GetObj("S_Menu_" + id_num + num).className = 'selectd';}
	if(GetObj("S_Cont_" + id_num + num)){GetObj("S_Cont_" + id_num + num).style.display = 'block';}
}

function Show_Sub_n2(id_num,num){ //舌签功能
	for(var i = 1;i <= 3;i++){
		if(GetObj("y_Menu_" + id_num + i)){GetObj("y_Menu_" + id_num + i).className = '';}
		if(GetObj("y_Cont_" + id_num + i)){GetObj("y_Cont_" + id_num + i).style.display = 'none';}
	}
	if(GetObj("y_Menu_" + id_num + num)){GetObj("y_Menu_" + id_num + num).className = 'selectd';}
	if(GetObj("y_Cont_" + id_num + num)){GetObj("y_Cont_" + id_num + num).style.display = 'block';}
}

function GetObj(objName){
	if(document.getElementById){
		return eval('document.getElementById("' + objName + '")');
	}else{
		return eval('document.all.' + objName);
	}
}
function showPic(pic){
	document.all.Pic.src=pic;
	return true;
}


function show(n,num)
{ 
		 var oa = document.getElementById("list"+n+"_1");
		 for(var j = 1;j <=6;j++){
             if(j == n){
                    if(oa.style.display == "block"){
					  for(var i = 1;i <= num;i++){
					  document.getElementById("list"+n+"_"+i).style.display = "none";}
					  document.getElementById("Layer"+n).innerHTML = "<a href='javascript:void(0)'  onclick='show("+n+","+num+")'><img src='/08images/mdot.gif'>&nbsp;<font color=#07519A>更多..</font></a>";
					  document.getElementById("ClassBox"+n).className  = 'ClassBox';
					  oa.style.display = "none";
					 }else{
						 for(var i = 1;i <= num;i++){
						  document.getElementById("list"+n+"_"+i).style.display = "block";}
						  document.getElementById("Layer"+n).innerHTML = "<a href='javascript:void(0)' onclick='show("+n+","+num+")'><img src='/08images/ldot.gif'>&nbsp;<font color=#07519A>收缩..</font></a>";
						  document.getElementById("ClassBox"+n).className ='ClassBox1';
						  oa.style.display = "block";
		              }
		      }
			  else{
			          var z;
		              var oa1 = document.getElementById("list"+j+"_1");
                      if(oa1.style.display == "block"){
					         for(var x = 1;x <=20;x++){
								  if(document.getElementById("list"+j+"_"+x)!=null){
									  document.getElementById("list"+j+"_"+x).style.display = "none";
									  z=x;
								   } 
								  else{
									  break;
								  }
							  }
					         document.getElementById("Layer"+j).innerHTML = "<a href='javascript:void(0)'  onclick='show("+j+","+z+")'><img src='/08images/mdot.gif'>&nbsp;<font color=#07519A>更多..</font></a>";
					         document.getElementById("ClassBox"+j).className  = 'ClassBox';
					  }

			  }
			  
		 }
         return false;
}





