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("buser")){
		if (D("buser").value==""){
			alert("请填写您的姓名！");
			D("buser").focus();
			return;
		}
   }
   if(D("bemail")){
		if (D("bemail").value==""){
			alert("请填写您的Email！");
			D("bemail").focus();
			return;
		}
   }
   	if(D("Bcontent")){
		if (D("Bcontent").value==""){
			alert("请填写您的留言内容！");
			D("Bcontent").focus();	
			return;
		}
   }
   if(D("Bhcontent")){
		if (D("Bhcontent").value==""){
			alert("请填写您的回复内容！");
			D("Bhcontent").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();
	}
}
