you have to define a prototype of the function.

function emit_sphere(); //prototype of the function

... // other functions...

function emit_sphere() // implementation of the function
{

}