function $(x){
    return document.getElementById(x);
}

function showMenu(menuName,isIndex){
	var obj=$("menu"+menuName);
	var objList=$("menuList");
	if(obj){
		obj.className="menuHere";
		if(menuName=="Home"){
			obj.style.backgroundImage="url(pic2/menuHere.gif)";
			obj.style.paddingLeft="0px";
		} else if(menuName=="Web"){
			if(objList)
				objList.style.background="none";
				objList.style.width="600px";
				document.getElementById("headMenu").style.width="600px";
		}
	}
}


 /* var speed		= 15;//滚动速度
  var rows		= 14;//每行高度
  var stim		= 100; //停留时间倍数 * speed
  var stop		= 0; //初始化值，不管
  demo2.innerHTML	= demo1.innerHTML 
  function Marquee(){
    if(demo.scrollTop%rows==0 && stop<=stim){
      stop++;
      return;
    }
    stop = 0;
    if(demo2.offsetTop-demo.scrollTop<=0)
      demo.scrollTop-=demo1.offsetHeight
    else{
      demo.scrollTop++
    }
  }
  var MyMar	   = setInterval(Marquee,speed)
  demo.onmouseover = function() {clearInterval(MyMar)}
  demo.onmouseout  = function() {MyMar=setInterval(Marquee,speed)}*/
 
	function logout(){
		if (confirm("你真的要退出系统吗?")){
			window.location.href="logout.asp"
		}
	}

	function checkproform(form)
	{
		var flag=true;
		if(form("seekword").value==""){alert("请输入查询关键字!");form("seekword").focus();return false};
	
		return flag;
	}

	function checkform2(form)
	{
		var flag=true;
		if(form("username").value==""){alert("请输入会员号!");form("username").focus();return false};
	
		return flag;
	}

	function mmcx()
	{
		window.open("password_query.asp","","scrollbars=yes,width=350,height=100,left=120,top=100")
	}

function do_search_switch(u,val){
	var url = '';
	switch(val){
		case 'product':
			url = 'http://www.hg17.com/pro_search.html';
			//document.do_search.image.value = "输入产品内容关键词";
		break;
		case 'article':
			url = 'http://www.hg17.com/pro_search.html';
			//document.do_search.image.value = "输入产品品牌关键词";
		break;
		case 'price':
			url = 'http://www.hg17.com/info_search.html';
			//document.do_search.image.value = "输入站内资料关键词";
		break;
		case 'down':
			url = 'http://www.hg17.com/down_search.html';
			//document.do_search.image.value = "输入下载资料关键词";
		break;
		default:
			url = 'http://www.hg17.com/pro_search.html';
			//document.do_search.image.value = "输入产品内容关键词";
		break;
	}
	document.do_search.url.value = url;
	document.do_search.q.focus();
	return true;
}

function do_search_submit(){
	var q = document.do_search.q.value;
	document.do_search.keyWordf.value	= q;
	var url = document.do_search.url.value;
	if(url==''){
		url = 'http://www.hg17.com/pro_search.html';
	}
	document.do_search.method = 'POST';
	document.do_search.action = url;
	if(document.do_search.keyWordf.value=="")
	{
	alert("您忘记输入关键词啦！")
	return false;
	}else
	{return true;}
}
function do_search_switch1(u,val,v){
	var url = '';
	switch(val){
		case 'product':
			url = '../pro_search.html';
			search_type.innerHTML = "产品内容：";
		break;
		case 'article':
			url = '../pin_search.asp';
			search_type.innerHTML = "产品品牌：";
		break;
		case 'price':
			url = '../info_search.html';
			search_type.innerHTML = "站内资料：";
		break;
		default:
			url = '../pro_search.html';
			search_type.innerHTML = "产品内容：";
		break;
	}

	document.Image1.src = '../images/n_1_1.gif';
	document.Image2.src = '../images/n_1_2.gif';
	document.Image3.src = '../images/n_1_3.gif';
	u.src = v;
	document.do_search.url.value = url;
	document.do_search.q.focus();
	return true;                 
}

  var Obj;
	var imgOpen = new Image()
	var imgClose = new Image()
	imgOpen.src="./open.gif"
	imgClose.src="./close.gif"
	
	function expand(el)
	{
		Obj = eval("child"+el)
		var   radio   =   document.all.imgid;
	for(var   i=1;i<radio.length+1;i++){  
			 eval("child"+i).style.display = "none"
			srcfile = imgClose.src
		}
			if(Obj.style.display == "none")
			{
			Obj.style.display = "block"
			srcfile = imgOpen.src
			}
	}  
	
	function change_Topinfo(num){
for(var i=1;i<=2;i++){
eval('place_Topinfo_0'+i).className = 'menu_off';
eval('change_Topinfo_0'+i).style.display = 'none';
}
eval('place_Topinfo_0'+num).className = 'menu_on';
if(num==1) {change_Topinfo_01.style.display="block";}
if(num==2) {change_Topinfo_02.style.display="block";}
}


  var   flagimg=false;     
  function   DrawImage(ImgD){     
    var   image=new   Image();     
    var   iwidth   =   280;     //定义允许图片宽度     
    var   iheight   =   210;     //定义允许图片高度     
    image.src=ImgD.src;     
    if(image.width>0   &&   image.height>0){     
    flagimg=true;     
    if(image.width/image.height>=   iwidth/iheight){     
      if(image.width>iwidth){         
      ImgD.width=iwidth;     
      ImgD.height=(image.height*iwidth)/image.width;     
      }else{     
      ImgD.width=image.width;         
      ImgD.height=image.height;     
      }     
      ImgD.alt=image.width+"×"+image.height;     
      }     
    else{     
      if(image.height>iheight){         
      ImgD.height=iheight;     
      ImgD.width=(image.width*iheight)/image.height;         
      }else{     
      ImgD.width=image.width;         
      ImgD.height=image.height;     
      }     
      ImgD.alt=image.width+"×"+image.height;     
      }     
    }     
  }       
