//使用onload=DrawImage(this,长,宽);
function DrawImage(ImgD,w,h){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= w/h){
if(image.width>w){
ImgD.width=w;
ImgD.height=(image.height*w)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
//ImgD.alt=image.width+"×"+image.height;
}
else{
if(image.height>h){
ImgD.height=h;
ImgD.width=(image.width*h)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
//ImgD.alt=image.width+"×"+image.height;
}
}
}
function addBookmark(title,url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}
function userchek()
{
	var co=document.form1
	if (co.username.value=="")
	{
		alert("对不起,用户名不能为空!");
		co.username.focus();
		return false;
		}
     if (co.password.value=="")
	 {
		 alert("对不起,密码不能为空!");
		 co.password.focus();
		 return false;
		 }
	 return true;
	}
function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"cur":"";
  con.style.display=i==cursel?"block":"none";
  //document.getElementById(name+"_link").href=url;
 }
}

function setTtab(name,cursel,n){
 for(i=1;i<=n;i++){
  //var menu=document.getElementById(name+i);
  var menu=document.getElementById(name);
  var con=document.getElementById("con_"+name+"_"+i);
  //menu.className=i==cursel?"qh_over":"";
  menu.className="ager"+cursel;
  con.style.display=i==cursel?"block":"none";
 }
}

function setTabc(name,cursel,n){
 for(i=1;i<=n;i++){
  //var menu=document.getElementById(name+i);
  var menu=document.getElementById(name);
  var con=document.getElementById("con_"+name+"_"+i);
  //menu.className=i==cursel?"qh_over":"";
 // menu.className="ager"+cursel;
  con.style.display=i==cursel?"block":"none";
 }
}


function chekk()
{
	if (document.myformm.keyword.value=="")
	{
		alert("对不起,请输入关键字!");
		document.myformm.keyword.focus();
		return false;
		}
	}
	
function navChange(formName, popupName, target)
{
	var popup = document[formName].elements[popupName];
	if (popup.options[popup.selectedIndex].value != "")
	{
		window.open(popup.options[popup.selectedIndex].value, target);
		popup.selectedIndex=0;
	}
}
function lme(id)
{
	 var v=document.getElementById("img"+id).alt;
	 if (v=="2")
	 {
		document.getElementById("img"+id).src="images/j1.gif";
		document.getElementById("img"+id).alt="1";
		 }
	 else
	 {
		document.getElementById("img"+id).src="images/j2.gif";
		document.getElementById("img"+id).alt="2";
		 }
	}




