var D=new Function('obj','return document.getElementById(obj);');
function ReImgSize(){
  for (i=0;i<document.images.length;i++){
	   if (document.all){
			if (document.images[i].width>440){ 
			   document.images[i].width="440"
			   try{
				   document.images[i].outerHTML='<a href="'+document.images[i].src+'" target="_blank" title="在新窗口打开图片">'+document.images[i].outerHTML+'</a>'
				}catch(e){}
			 }
	   } else{
		if (document.images[i].width>400) {
		  document.images[i].title="在新窗口打开图片"
		  document.images[i].style.cursor="pointer"
		  document.images[i].onclick=function(e){window.open(this.src)}
		}
	  }
  }
 }

function check(){

	if(D("name")){
		if (D("name").value==""){
			alert("请填写您的姓名！");
			D("name").focus();
			return;
		}
	}
	if(D("qq")&&D("qq").style.display!="none"){
		if (D("qq").value==""){
			alert("请填写您的qq！");
			D("qq").focus();
			return;
		}
	}
	if(D("email")&&D("email").style.display!="none"){
		if (D("email").value==""){
			alert("请填写您的Email！");
			D("email").focus();
			return;
		}
	}
	if(D("weburl")&&D("weburl").style.display!="none"){
		if (D("weburl").value==""){
			alert("请填写您的url！");
			D("weburl").focus();
			return;
		}
	}
	if(D("content")){
		if (D("content").value==""){
			alert("请填写您的留言内容！");
			D("content").focus();	
			return;
		}
	}
	if(D("reply")){
		if (D("reply").value==""){
			alert("请填写您的回复内容！");
			D("reply").focus();
			return;
		}
	}

   
     document.form1.submit();
}

function autocode(){
	D("vcodeImg").innerHTML = "<img id=\"code\" src=\"about:blank\" onerror=\"this.onerror=null;this.src='inc/getcode.asp?s='+Math.random();\" alt=\"验证码\" title=\"看不清楚?换一张\" style=\"cursor:pointer;width:40px;height:18px;\" onclick=\"src='inc/getcode.asp?s='+Math.random()\"  onload=\"this.className='emptyClass';\" />"
}
function showvcode(){
	if (D("GetCode").value == ""){
		D("code").src='inc/getcode.asp?s='+Math.random();
	}
}