Viewing favicon through javascript

Hello,
I’m trying to figure out how to display a favicon on a page with the source of the favicon inside a frame called “win”. Here is my code:


Javascript:
 
if (document.getElementById) {
favicon = new Image(16, 16);
document.getElementById('favicon').src = win.location.href + '/favicon.ico';
}
 
HTML:
 
<img src="about:blank" border="0" alt="Icon" name="favicon" id="favicon">

so if the framed page was google.com the path to the favicon would be google.com/favicon.ico in the image tag
Thanks for the help :rambo: