Remove div for mac users

I am new to javascript and I was wondering what is the best way to solve my problem below:

I have 2 navigation menus one using flash and one using images. I wanted to use javascript to detect if the viewer is using a mac and then remove the div that contains the flash and if they are not using a mac then remove the div that contains the images.

If there is a better way to resolve this problem I am all ears.

Thanks in advance.

The solution is to provide the images first. Then, if the computer supports Flash, you can add the Flash content. This means you’re not just blindly targetting one type of users, but providing exactly the content people can support.

The easiest way to do this is to use SWFObject (google it), as it does the detection and creation of the Flash objects all for you.

By the way, Flash menus are generally pretty horrible and it is not what Flash should really be used for. If you want sliding animations and fading effects, you don’t need Flash for that. JavaScript is perfectly capable of those things, especially if you use something like jQuery UI (again, google it).

I see what you are saying I just started to mess with Javascript and Jquery so I plan on using them instead of flash in the future. Unfortunately all of the images and flash that makes up the menu is coming from a .swf and .as file so I was hoping to just use a separate menu for when flash is not supported.

Below is the script I am using to remove the div, but it is removing the div on the iphone as well.

<script type=“text/javascript”>
function removeElement(){
var element = document.getElementById();
element.parentNode.removeChild(element);
}
if(navigator.userAgent.indexOf(“Windows”) != -1){
removeElement(navigation);

}
</script>

But now it looks like I just need to remove the non flash div for users with an ipad.

This is my first website and its for a small local company and I would probably not worry about ipad users for now since it is very unlikely one would use the site, but the owner has one.

Here is the test site in case you were curious to see how deep I am into the project and why I am looking for a quick fix.

In an effort to resolve the issue, it would be useful to know why you don’t want the Mac users to view the Flash. Is it anti-Mac propaganda? :wink:

Thanks Datura I was under the impression it was mac in general, so that is good to know.

MAC computers do support flash, the ipad does not.

The flash based menu does not work on my friends ipad and I read that mac does not support flash so I need a non-flash menu for mac users.