Habría que ver cómo estás llamando a tu función (quizá los parámetros no tienen el tipo correcto). Lo siguiente, por ejemplo, funciona sin problemas:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<script>
function verificar(contador,nuevoValor){
if(document.getElementById('checkbox'+contador).checked){
document.getElementById('checkbox'+contador).value=nuevoValor;
}
alert(document.getElementById('checkbox'+contador).value);
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<input type="checkbox" name="checkbox1" id="checkbox1" />
<input type="checkbox" name="checkbox2" id="checkbox2" />
<input type="checkbox" name="checkbox3" id="checkbox3" />
<input type="button" name="a" value="verificar1" onclick="verificar(1,500)" /><input type="button" name="aa" value="verificar2" onclick="verificar(2,'hola')" /><input type="button" name="aaa" value="verificar3" onclick="verificar(3,'chau')" />
</form>
</body>
</html>