为什么执行到num=0时,没有打开新网页
<!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=UTF-8" />
<title>Untitled Document</title>
<script type="text/javascript">
var num=5;
function five(){
if(num==0){
window.open('http://www.imooc.com');
}
else{
document.getElementById("button").value=num;
num=num-1;
setTimeout("five()",1000);
}}
</script>
</head>
<body>
<input id="button" type="button" onclick="five()" value="倒数五秒进入幕客网" style="color:#C00;width:1000px;background:#0F0">
</body>
</html>