function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function loaded(myimg,mywidth,myheight){
var tmp_img = new Image();
tmp_img.src=myimg.src;
image_x=tmp_img.width;
image_y=tmp_img.height;
	if(image_x > mywidth){//?í?è′óóúòa?ó
	tmp_img.height=image_y * mywidth / image_x;
	tmp_img.width=mywidth;
		if(tmp_img.height>myheight){
			tmp_img.width=tmp_img.width * myheight / tmp_img.height;
			tmp_img.height=myheight;
			}
	}else if(image_y > myheight)
	{//???è′óóúòa?ó
	tmp_img.width=image_x * myheight / image_y;
	tmp_img.height=myheight;
		if(tmp_img.width>mywidth){
			tmp_img.height=tmp_img.height * mywidth / tmp_img.width;
			tmp_img.width=mywidth;
			}
	}
	myimg.width=tmp_img.width;
	myimg.height=tmp_img.height;

}

function Search()
{
    var url='';
    var keywords = $('key').value;   
    var type= $('types').value;  
    if(type=='news')
    {
    url='news.html'
    }
    else
    {
    url="product.html"
    }
  
    if(keywords=='' || keywords=='请输入关键字')
    {
        alert('请输入关键字!');
        return;
    }    
    if(keywords!='') url+='?key=' + escape(keywords);
    
   
    location.href = url;
}

function Regedit()
{
    var url='user.aspx';  
   
    location.href = url;
}

function Login()
{
    var url='login.aspx';
    var name = document.getElementById('lgname').value;
    var pws = document.getElementById('lgpws').value;
  
    if(name=='')
    {
        alert('请输入用户名!');
        return;
    }    
     if(pws=='')
    {
        alert('请输入密?');
        return;
    }   
    
     url+='?action=login&lgname=' + name+'&lgpws='+pws;
   
    location.href = url;
}

function $(id){
	return document.getElementById(id);	
}




 

 



