var myRequest = null;

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/sharethis.asp?id=' + id);
    myRequest.send(null);
    }else{
    e.style.visibility = 'hidden';
    }
}

function chiudi(id){
e = document.getElementById('share' + id);
e.style.visibility = 'hidden';
}
