Calling function with integer webpage communication

I am doing this in my webpage containing the player:

function SaySomethingToUnity(var objindex){
u.getUnity().SendMessage("ObjectManager", "MyFunction", objindex);
}

and this:

<button type="button" onclick="SaySomethingToUnity(1)">Click Me!</button>

then in Unity

private var focusobject:int;

function MyFunction(param: int){

focusobject=param;
FocusOnObjects();
}

function FocusOnObjects () {
...
var bounds = new Bounds(GameObjects[focusobject].transform.position, Vector3.zero);
...		
}

This is in order to pass a value depending on which object I am going to focus on when I click a web button.

The player does not load, if I use the original form from the documentation everything is fine, can anyone tell me why?
Many thanks
Nic

Not sure if this is the right way to do it but it has been solved by creating a variable at the top of the java script in the webpage and passing that variable as argument in the function.