﻿// File JavaScript

var xmlhttp = null ;

function winvis() { 
    w=screen.width;
    h=screen.height-30;
    window.moveTo(0,0);
    window.resizeTo(w,h);
    // window.resizeTo(1024, h);
}

function getxmlhttp() {
     
     var xhttp = null;
      try {
        xhttp = new XMLHttpRequest();
      } catch(e) {
        try {
            xhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e) {
            xhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
      }
     return xhttp;
    
}
function xmlhttpChange()
        {
        // if xmlhttp shows "loaded"
        if (xmlhttp.readyState==4)
          {
          // if "OK"
          if (xmlhttp.status==200)
            {
            // risposta dal server
            
            var jws = xmlhttp.responseText;
                    
            var idmap = document.getElementById("selMap");
            
            idmap.innerHTML = xmlhttp.responseText ;
            
            
            //    if (e.style.visibility == 'hidden') {
            //        e.style.visibility = 'visible';
            //        e.style.display = 'block';
            //    } else {
            //        e.style.visibility = 'hidden';
            //        e.style.display = 'none';
            //    }

                       
            }
          else
            {
            //alert("Impossibile ricevere i dati")
            }
          }
        }
        
function viewReg(regName)
{
   // var xmlhttp;
    var url = 'setReg.aspx?reg=' + regName
    xmlhttp = getxmlhttp();
    xmlhttp.onreadystatechange = xmlhttpChange;
    xmlhttp.open("GET",url,true)
    xmlhttp.send(null)
    
}

function setInfoDOC(regName)
{
  var url = 'setW.aspx?jws=' + regName
  xmlhttp = getxmlhttp();
  xmlhttp.onreadystatechange = xmlhttpback;
  xmlhttp.open("GET",url,true)
  xmlhttp.send(null)
   
      
}

function xmlhttpback()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
  // if "OK"
  if (xmlhttp.status==200)
    {
    // risposta dal server
    
    var jws = xmlhttp.responseText;
   // in realta della risposta non me ne frega niente          
  //  window.location ="PrimaPagina.aspx?OK=" + jws;
        window.location.reload(true);
    }
  else
    {
  //  window.location ="PrimaPagina.aspx";
    //alert("Impossibile ricevere i dati")
    }
  }


}


