sequentially executing functions

sequentially executing functions

hi all,
I am making a web page which requires three main functions

the layout is like this
function main()
{
update();
showResult();
}


function update()
{
setTimeOut('alert("process finished")' , 1000);
}

function showResult()
{
 alert("updated result");
}

now, my problem is when I am calling main() method, right now, if i call update() method, the showResult() method is also getting executed simultaneously. I dont understand how.

I am unable to fix this problem after trying many things.

can anyone tell me how I can make the flow of programs sequential??