The problem was the statement:
windows.onload = myfunction();
by modifying it to:
windows.onload = myfunction;
all problems went away! This is not flagged as a syntax error but just gets choked on! same code works fine locally on pc on the chrome browser. Terrible debug!
Sorry about this.