/* parte dedicata al codice AJAX PER UN CARICAMENTO NORMALE*/

function Richiesta(pagina,responsediv,numerorighe){

	var nomediv = new Array(20);
	nomediv[1]="dettaglio1"
	nomediv[2]="dettaglio2"
	nomediv[3]="dettaglio3"
	nomediv[4]="dettaglio4"
	nomediv[5]="dettaglio5"
	nomediv[6]="dettaglio6"
	nomediv[7]="dettaglio7"
	nomediv[8]="dettaglio8"
	nomediv[9]="dettaglio9"
	nomediv[11]="dettaglio10"
	nomediv[12]="dettaglio11"
	nomediv[13]="dettaglio12"
	nomediv[14]="dettaglio13"
	nomediv[15]="dettaglio14"
	nomediv[16]="dettaglio15"
	nomediv[17]="dettaglio16"
	nomediv[18]="dettaglio17"
	nomediv[19]="dettaglio18"
	
	
	for (i=1; i<=numerorighe; i++) { 
		updatepage1('',nomediv[i]);
		
	}
 
	 url  = pagina +"&rand="+escape(Math.random())
	 var xmlHttpReq = false;
    var self = this;
    // Xhr per Mozilla/Safari/Ie7
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // per tutte le altre versioni di IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
			// Quando pronta, visualizzo la risposta del form
            updatepage1(self.xmlHttpReq.responseText,responsediv);
        }
		else{
			// In attesa della risposta del form visualizzo il msg di attesa
			updatepage1('<img src="images/preload4.gif">',responsediv);

		}
    }
     self.xmlHttpReq.open('GET', url, true);
    self.xmlHttpReq.send(null);
}


function updatepage1(str,responsediv){
    document.getElementById(responsediv).innerHTML = str;
}
/* FINE parte dedicata al codice AJAX PER UN CARICAMENTO NORMALE*/


    function ApriImmagini(file)
    {
      var prop = "top=100, left=100, scrollbars=1";
      window.open(file, null, prop);
    }