html and javascript work properly there as you can see. but when I add this to a htmlbox in google sites, it shows an error saying "1+1: URI unknown:///unknown is malformed"
Help me, thanks
Here's my html and javascript
[1]: http://jsfiddle.net/TvHdU/4/
Copy the html you provided, and pasted it into the page and below it wrote script tags to contain the javascript you provided.
Since Google restricts their sites, you have to use Google APIs to obtain the js code you need in order to make the Google Gadget work. Here's the API site
This should give you what you need in order to get you Google Gadget working with JavaScript.
You can view the working google site I just created here, then click on "include html" link on left bar under "Home".