var myRequest = null;

/*function CreateXmlHttpReq(handler) {
  var xmlhttp = null;
  xmlhttp = new XMLHttpRequest();
  xmlhttp.onreadystatechange = handler;
  return xmlhttp;
} */

function CreateXmlHttpReq(handler) {
  var xmlhttp = null;
  try {
    xmlhttp = new XMLHttpRequest();
  } catch(e) {
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  xmlhttp.onreadystatechange = handler;
  return xmlhttp;
}

function myHandler() {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        e.innerHTML = myRequest.responseText;
        //return e.scrollHeight;
    }
}

function sharethis(id) {
    e = document.getElementById('share' + id);
    if(e.style.visibility == 'hidden' || e.style.visibility == ''){
     e.style.visibility = 'visible';
     myRequest = CreateXmlHttpReq(myHandler);
     myRequest.open('GET','./sharethis/archivio.asp');
     myRequest.send(null);
    }else{
     myRequest = CreateXmlHttpReq(myHandler);
     myRequest.open('GET','./sharethis/blank.asp');
     myRequest.send(null);
     e.style.visibility = 'hidden';
	// e.style.height = 0;
	 //e.style.zIndex = 100;
    }
}

function chiudi(id){
	
e = document.getElementById('share' + id);
myRequest = CreateXmlHttpReq(myHandler);
myRequest.open('GET','./sharethis/blank.asp');
myRequest.send(null);
e.style.visibility = 'hidden';
//e.style.height = 0;
//e.style.zIndex = 100;

}
