function CLink(obj,ref)
{
var rc=0;
rc=window.open(ref,'popup','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbar=no, resizable=no, width=600, height=400, top=100, left=100')
event.returnValue = false;
}

function CShow(ref)
{
var rc=0;
rc = eval("document.all." + ref + ".value");
document.all.txtNews.value=rc;
rc = eval("document.all.tit" + ref + ".value");
document.all.tblNews.rows[0].cells[0].innerText=rc; 
event.returnValue = false;
}

function calcDatiEco()
{
var cell
var cap=0;
var fatt=0;
var utnet=0;
var P_E=0;
var P_F=0;
var interv;

  if (document.all.f_res.value == 'T')
  {
    cap = document.all.NAzioni.value*document.all.CPrice.value/1000000;
    if (cap > 0)
    { 
      document.all.tblCapital.rows[0].cells[7].innerText=(Math.round(cap*Math.pow(10,2))/Math.pow(10,2)) + " mln €"; 
      for (var intC = 1; intC < document.all.TabDati.rows.length; intC++) 
      {
        interv=document.all.TabDati.rows[intC].cells[2].innerText;   
        fatt=document.all.TabDati.rows[intC].cells[3].innerText;
        utnet=document.all.TabDati.rows[intC].cells[7].innerText;

        if ((fatt > 0) && (interv=='A'))
        {
          P_F=(Math.round(cap/fatt*Math.pow(10,2))/Math.pow(10,2));
          document.all.TabDati.rows[intC].cells[9].innerText=P_F;
        }
	
        if ((utnet > 0)  && (interv=='A'))
        {
          P_E=(Math.round(cap/utnet*Math.pow(10,2))/Math.pow(10,2));
          document.all.TabDati.rows[intC].cells[10].innerText=P_E; 
        }
      }
    } 
    else
    {
      document.all.tblCapital.rows[0].cells[6].innerText='-'; 
      for (var intC = 1; intC < document.all.TabDati.rows.length; intC++) 
      {
        document.all.TabDati.rows[intC].cells[9].innerText='-';
        document.all.TabDati.rows[intC].cells[10].innerText='-';
      }
    }
  }
}   


function formatValuta()
{
  document.all.f_res.value='T';
  if (((event.keyCode < 48) || (event.keyCode > 57)) && (event.keyCode != 46))
  {
    document.all.f_res.value='F' ;
    if (event.keyCode == 44)
    {
      event.keyCode = 46; 
    } 
    else
    { 
      //alert(event.keyCode);
      event.returnValue=false; 
    }
  }
}   
