updated code with new show win msg and tore and put all js code back together