var xmlHttp;
function createXMLHttpRequest() {
  if (window.ActiveXObject) {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  else if (window.XMLHttpRequest) {
      xmlHttp = new XMLHttpRequest();                
  }
  if (!xmlHttp) { // 异常，创建对象实例失败
	window.alert("不能创建XMLHttpRequest对象实例.");
	return false;
  }
}

function createXMLHttpRequestByObject(xmlObject) {
  if (window.ActiveXObject) {
      xmlObject = new ActiveXObject("Microsoft.XMLHTTP");
  }
  else if (window.XMLHttpRequest) {
      xmlObject = new XMLHttpRequest();                
  }
  if (!xmlObject) { // 异常，创建对象实例失败
	window.alert("不能创建XMLHttpRequest对象实例.");
	return false;
  }
  
  return xmlObject;
}

/**
 * 重新获取验证码
 * @param id
 * @param type
 * @return
 */
function showsec(id,type){
	  var objseccode = document.getElementById("seccode");
	  objseccode.value = '';
	  var objImage=document.getElementById(id);
	  if(objImage.style.display=="none"){
		  objImage.style.display="";
	  }
	  str = "/Captcha.jpg?random="+Math.random();
	  if(type && type!='')
	     str += "&type="+type;  
	   objImage.src=str;
	}

