My idea is to build a html krpano, so i'll need to execute veryous javascript functions.
this is possible, have a look at the javascript examples,
How can i switch to the fullscreen mode with a JavaScript function call?
an interesting question

it's only possible to change the fullscreen mode in follow of an user-interaction,
e.g. a mouse click or key press, this is an flash security feature,
maybe this can be faked with javascript but I don't know a solution for it...