function showid(oid)
{
	var obj=document.getElementById(oid);
	obj.style.display=obj.style.display=="none"?"block":"none";
	return false;
}
function hiddenid(oid)
{
	var obj=document.getElementById(oid);
	obj.style.display="none";
	return false;
}


//w是图片宽度,h是图片高度, w=0时按高度缩小, h=0时按宽度缩小
function drawpic(obj,w,h)
{
	if (w==0)
	{if (obj.clientHeight>h){obj.style.height=h+'px';}return true;}
	
	if (h==0)
	{if (obj.clientWidth>w){obj.style.width=w+'px';}return true;}
	
	if (obj.clientHeight/obj.clientWidth>(h/w))
	{obj.style.height=h+'px';}
	else
	{obj.style.width=w+'px';}
}

//更换验证码
function chgvcode()
{
	var obj=document.getElementById("verify");
	obj.src=obj.src+"?rnd=2";
	return false;
}

function showmenu(mid)
{
	var obj=document.getElementById(mid);
	obj.style.display='block';
}
function closemenu(mid)
{
	var obj=document.getElementById(mid);
	obj.style.display='none';
}

function showstag(id1,id2,c)
{
	var objtag1=document.getElementById(id1+'_tag');
	var objtag2=document.getElementById(id2+'_tag');
	var obj=document.getElementById("searchkey");
	obj.name=id1;
	obj.value=c;
	objtag1.className='h_s_on';
	objtag2.className='h_s_off';
}

//客户端检查验证码
function ajaxvcode(myform){
var xmlHttp;
eval('var vcode=document.all.'+myform+'.vcode.value;');

try{xmlHttp=new XMLHttpRequest();}
catch (e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
 catch (e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
    catch (e){alert("您的浏览器不支持AJAX！");return false;}
    }
  }
  xmlHttp.onreadystatechange=function(){
    if(xmlHttp.readyState==4)
      {
      	if (xmlHttp.responseText=='ok'){eval('document.all.'+myform+'.submit();');}
      	else{alert('验证码输入有误，请检查');}
      }
    }
  xmlHttp.open("GET","/m/api.php?a=checkvcode&vcode="+vcode,true);
  xmlHttp.send(null);
}

