﻿function $(id)
{
	return document.getElementById(id);
}

function createhttp(it) {
	 if(window.XMLHttpRequest) {
   it = new XMLHttpRequest();
  }
  else if (window.ActiveXObject) { 
    it = new ActiveXObject("Msxml2.XMLHTTP");
   }

  if (!it) { // 异常，创建对象实例失败
   window.alert("不能创建XMLHttpRequest对象实例.");
   return false;
  }
  
  return it;
}

function showdiv(divname) {
    if($(divname).style.display == 'none')
        $(divname).style.display = 'block';
    else
       $(divname).style.display = 'none';           
}

function closediv(divname) {
    $(divname).style.display = "none";      
}

function search(theurl) {
    if($('searchkey') != null){        
        document.location = theurl + "/search.aspx?q=" + $('searchkey').value;  }  
}

function openwin(url) { 
　　window.open (url, "newwindow", "height=200, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
} 
