function getObj(id)
{
  return document.getElementById(id);
}

function attivaDisattivaBody(chi,come)
{
  var obj = document.getElementById(chi);
  obj.style.display = come;
}

function muoviPagina(anchor)
{
  document.getElementById('anchorsessione').value = anchor;
  document.getElementById('curriculum').submit();
}

function aggiungiLaurea(anchor,val,pos)
{
  document.getElementById("contalauree").value =parseInt(document.getElementById("contalauree").value)+ val;
  document.getElementById("poslaurea").value = pos;
  document.getElementById('anchorsessione').value = anchor;
  document.curriculum.submit();
}

function aggiungiMaster(anchor,val,pos)
{
  document.getElementById("contamaster").value =parseInt(document.getElementById("contamaster").value)+ val;
  document.getElementById("posmaster").value = pos;
  document.getElementById('anchorsessione').value = anchor;
  document.curriculum.submit();
}

function aggiungiCorso(anchor,val,pos)
{
  document.getElementById("contacorsi").value =parseInt(document.getElementById("contacorsi").value)+ val;
  document.getElementById("poscorsi").value = pos;
  document.getElementById('anchorsessione').value = anchor;
  document.curriculum.submit();
}

function aggiungiOccupazione(anchor,val,pos)
{
  document.getElementById("contaoccupazione").value =parseInt(document.getElementById("contaoccupazione").value)+ val;
  document.getElementById("posoccupazione").value = pos;
  document.getElementById('anchorsessione').value = anchor;
  document.curriculum.submit();
}

function aggiungiLingua(anchor,val,pos)
{
  document.getElementById("contalingue").value =parseInt(document.getElementById("contalingue").value)+ val;
  document.getElementById("poslingue").value = pos;
  document.getElementById('anchorsessione').value = anchor;
  document.curriculum.submit();
}

function confronta(pass,conpass)
{
  password = document.getElementById(pass).value;
  confpassword = document.getElementById(conpass).value;
  if(password.length<6)
  {
    alert('La password deve essere almeno di 6 caratteri');
    document.getElementById(pass).value='';
    document.getElementById(conpass).value='';
  }
  if(password!=confpassword)
  {
    alert('Reimmettere la Password');
    document.getElementById(pass).value='';
    document.getElementById(conpass).value='';
  }
}
  
function elimina(elimina)
{
  document.getElementById('eliminaFile').value = elimina;
}
function textCounter(textArea, contatore, maxlimit)
{
	if (textArea.value.length > maxlimit)
		textArea.value = textArea.value.substring(0, maxlimit);
	else
        contatore.value = maxlimit - textArea.value.length;
}
  
