There is nothing wrong with having Javascript and PHP on the same page. You must remember that they are different animals, though, and understand how they work.
When a page is requested from a PHP-enabled site, PHP takes over and executes all PHP code on the page. It renders the document as HTML, then sends it to the client. At that point, any Javascript that's set up to run will run.
Assuming you know all this, and that you are effectively reloading the page when you hit one of the buttons, then you have an error on your page. Your first two lines should be rewritten like this:
<?php // this is my personal preference. There is nothing wrong with <?, of course
$btn1 = $_POST('btn1');
if($btn1 == "ON"){
...
Incidentally, I am not sure why you chose to use PHP here:
<? echo '<form name="myForm1" action=hello.php method="post">'; ?>
You could just as easily used
<form name="myForm1" action="hello.php" method="post">
Hope this helps! Good Luck.