
function winResize() {
  if ('<%=session("mainScroll")%>' != 'N') {
        var topSize = document.getElementById ('topDiv').offsetHeight;
        var botSize = document.getElementById ('bottomDiv').offsetHeight;
        var diff;
        if (!isNaN(document.body.clientTop)) topSize -= document.body.clientTop;
        try {
		document.getElementById ('mainDiv').style.height =
		document.body.clientHeight - (topSize + botSize);
		document.getElementById ('mainDiv').style.overflow = 'auto';
                diff = (parseInt (document.body.clientHeight, 10) -
                     (parseInt(document.getElementById ('topDiv').offsetHeight, 10) +
                      parseInt(document.getElementById ('mainDiv').offsetHeight, 10) +
                      parseInt(document.getElementById ('bottomDiv').offsetHeight, 10)));
                if (diff != 0) {
                   //
                   // in questa cosa fireFox mi ha fatto dannare non poco a causa del fatto che
                   // style.height è una stringa e lui non pratica la conversione automatica
                   //
		   document.getElementById ('mainDiv').style.height = document.body.clientHeight - (topSize + botSize) + diff;
		}
        }
        catch (e) {}
    }
}

//
// sysNav: è la funzione base per la navigazione all'interno del sito
// se il browser corrente lo consente, la navigazione avviene attraverso un iframe
// che contiene il codice di navigazione, altrimenti la pagina viene inviata a se
// stessa, specificando il nuovo parametro.
//
//
function sysNav(ref, param, targetWin) {
var lnk = location.pathname + '?ref=' + ref;
	if (param != null) lnk += param;
	if (targetWin != null)
            window.open (lnk)
	else
	    document.location.href = lnk;
}


