function nuModifica(e) {
	if (!e) var e = window.event;
	if (e.keyCode) e.keyCode=null;
	else if (e.which) e.which=null;
}


function isNumber(cuVirgula,e)  // se pune pe evenimentul onkeypress
{
	if (!e) var e = window.event;
	if (e.keyCode) mycode = e.keyCode;
	else if (e.which) mycode = e.which;
  if (cuVirgula && mycode == 44) // transforma virgula in punct
	{
    e.keyCode?e.keyCode=46:e.which=46;
		mycode=46;
	}	
  if (mycode < 48 || mycode > 57)
	{ 
    if (cuVirgula && mycode != 46)
      e.keyCode?e.keyCode=null:e.which=null;
    if (!cuVirgula)
      e.keyCode?e.keyCode=null:e.which=null;
	}		
} 

function isDigit(c)
    {
    var test = "" + c;
    if (test == "0" || test == "1" || test == "2" || test == "3" || test == "4" 
    || test == "5" || test == "6" || test == "7" || test == "8" || test == "9")
        {
        return true;
        }
    return false;
    }

function isAllDigits(s)
    {
    var test = "" + s;
    for (var k = 0; k < test.length; k++)
        {
        var c = test.substring(k, k+1);
        if (isDigit(c) == false)
            {
            return false;
            }
        }
    return true;
    }

function campPreluat(obiect, nume)
{
  if (obiect.value.length == 0 )         
	{
	  alert("Nu ati completat valoarea pentru "+nume);
		obiect.focus();
    return false;
  }
  return true;
}


function calcValoare(fromObj, toObj, valoare)
{
  toObj.value = fromObj.value*valoare;  
}

function calcTotalValoare(fromObj, toObj, valori)
{
  var totVal;
	totVal = 0; 
  for (i=0; fromObj.length; i++)
	  totVal = totVal + fromObj[i].value*valori[i];
  toObj.value = totVal;  
}
