function chiamaCalendario(nome){
  var ogg = document.getElementById(nome);
  popcal('Seleziona', nome, ogg.value);
}	

function popcal(vCaption, vField, vDate){
	window.open('../calendario/calendario.asp?caption=' + escape(vCaption) + '&field=' + vField + '&date=' + vDate, 'Calendario', 'resizable=no,scrollbars=no,width=300,height=320');
}

function solonumeri(nome){
	var newElements = document.getElementsByName(nome);
	if (isNaN(newElements[0].value)){
		var dato = newElements[0].value;
		var totex = dato.length;
		var ultimo = dato.substring(totex, totex - 1);
		if (ultimo != ',' && isNaN(ultimo)){
			newElements[0].value = dato.substring(totex - 1, 0);
		}
	}
}

function getElementPosition(obj)
{
  var t = 0;
  var l = 0;
  if (obj.offsetParent){
    while (obj.offsetParent){
      t += obj.offsetTop;
      l += obj.offsetLeft;
      obj = obj.offsetParent;
    }
  }else if (obj.y && obj.x){
    t += obj.y;
    l += obj.x;
  }
  return {left : l, top : t};
}

function getElementSize(obj)
{
  var w = obj.offsetWidth;
  var h = obj.offsetHeight;
  return {width : w, height : h};
}	

function typb(){
	var out = '';
	var nome = navigator.appName;
	if (nome == 'Microsoft Internet Explorer'){
		out = 'MIE';
	}else if (nome == 'Netscape'){
		out = 'NET';
	}
	return out;
}
strScrivi = '';
strScrivi1 = '';

function scriviAttendi(testo){
  strScrivi = testo;
}

function scriviImmagini(quante){
  strScrivi1 = '';
  for (i=0; i<=quante; i++){
    strScrivi1 = strScrivi1 + '<img src="../immagini/quadrato.gif" border="0">';  
  }
}

function compilaDiv(valore, numdiv){
  var oggDiv = document.getElementById('divTitolo' + numdiv);
  if (valore != ''){
    oggDiv.innerHTML = '<font color="red" size="2"><b>' + valore + '</b></font>';
    oggDiv.style.display = 'block';
  }
}
  
function esportaPortale(report, valore, valore1, evento){
  window.open ('../esporta/esporta_frame.asp?report=' + report + '&valore=' + valore + '&valore1=' + valore1 + '&evento=' + evento,'attendi','width=600, height=100, toolbars=no, resizable=no, scrollbars=no, top=0, left=0');
}
