var xmlHttp
var subMenuState

//Used to maintain the currentActive image
ActiveImage = 1
function GetXmlHttpObject(handler) { 
  objXmlHttp = false

  if (window.XMLHttpRequest) { // Mozilla, Safari,...
      objXmlHttp = new XMLHttpRequest();
      if (objXmlHttp.overrideMimeType) {
          objXmlHttp.overrideMimeType('text/xml');
      }
  } else if (window.ActiveXObject) { // IE
      try {
          objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
          try {
          objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (e) {}
      }
  }

  if (!objXmlHttp) {
      alert('Giving up :( Cannot create an XMLHTTP instance');
      return false;
  }
  objXmlHttp.onreadystatechange = handler
  return objXmlHttp
} 

var imgXmlHttp
function changeImage() {    
  if (ActiveImage > 5){ActiveImage=1}
  if (ActiveImage < 1){ActiveImage=5}
	var url="xml/getNewImage.xml.asp?Id="+ActiveImage
	//window.open(url)
	imgXmlHttp=GetXmlHttpObject(updateImgCont)
	imgXmlHttp.open("GET", url , true)
	imgXmlHttp.send(null)
}

function updateImgCont(){
  if (imgXmlHttp.readyState==4 || imgXmlHttp.readyState=="complete") { 
    document.getElementById('ImgCont').innerHTML = imgXmlHttp.responseText
  }
}

