function SetWidth(obj,childClassName){
    var innerDiv = obj.getElementsByTagName('DIV');
    var divCount = 0;
    var innerDivWidth = 0;
    var checkDiv;
    for(var i = 0,checkDiv;checkDiv = innerDiv[i]; i++){
        if(checkDiv.className == childClassName){
            divCount++;
            innerDivWidth = checkDiv.offsetWidth;
        }
    }
    obj.style.width = (innerDivWidth * divCount) + 'px';
}

function init(className,childClassName){
    var divs = document.getElementsByTagName('DIV');
    var checkDiv;
    for(var i = 0,checkDiv;checkDiv = divs[i];i++) if(checkDiv.className == className) SetWidth(checkDiv,childClassName);
}

window.onload = function(){
    init('listaInterventi','intervento');
}

function popUp(url,name,param) {
  var popUp;

  popUp=window.open(url,name,param);
//Se l'apertura del pop up viene bloccata, esce
  if (popUp==null) 
  {
    return null;
  }
  else
  {
    popUp.focus();
    return popUp;
  }  
}
function OpenCredits(url, target)
{

  leftVal = (screen.width - 365) / 2;
  topVal = (screen.height - 270) / 2;

  popUp(url, target, 'width=365,height=270,left='+leftVal+',top='+topVal+',scrollbars=no,resizable=no,status=no');
  
  return false;
}

function OpenUserDetails(url, target)
{
    
  leftVal = (screen.width - 450) / 2;
  topVal = (screen.height - 270) / 2;
    
  popUp(url, target, 'width=450,height=270,left='+leftVal+',top='+topVal+',scrollbars=no,resizable=yes,status=no');
  
  return false;
}