
function openclose(div) {
	var newdiv;
	if(newdiv = document.getElementById(div)){
		if(newdiv.style.display == 'none'){		
			newdiv.style.display = 'block';
		} else {
			newdiv.style.display = 'none';
		}
	}
}

function switchdivs(div1, div2) {
	document.getElementById(div1).style.display = 'inline';
	document.getElementById(div2).style.display = 'none';
}

function httpUpdate(url, div, nowaitflag) {
	var http = getHTTPObject(); // We create the HTTP Object
	if(nowaitflag != 1){
		document.getElementById(div).innerHTML = '<img src="/cmn/se/lg/wait.gif">';
	}
	var httpdiv = div;
	http.open("GET", url + '&random='+Math.random(), true);
	http.onreadystatechange = function() {
			if (http.readyState == 4) {
				document.getElementById(httpdiv).innerHTML = http.responseText;
				document.getElementById(httpdiv).style.display = 'inline';
			} 
	}
	http.send(null);
}

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}