$(document).ready(function (){
  //dropdown menu
  $("#nav>li").hover(function () { $(this).children("ul").show(); },
                         function () { $(this).children("ul").hide(); });

    if ($.fn.media) {
        $('a.cms-link-media[href$=.mp3]').each(function() {
            var data = $(this).metadata();
            var options = $.extend({
                skin: '/swf/ajef.swf',
                autostart: 'false',
                name: $(this).text(),
                title: $(this).attr('title')
            }, data);
            $(this).text('');
            if ((options.name != '')||(options.title != '')) {
                var playerHeight = '115px';
            } else {
                var playerHeight = '70px';
            }
            var playerOptions={
                width: '400px',
                height: playerHeight,
				flashVersion:'10',
                flashvars: {
                    skin: options.skin,
                    autostart: options.autostart,
                    name: options.name,
                    title: options.title
                },
                params: {
                    allowfullscreen: 'true',
                    allowscriptaccess: 'always'
                }
            }
            $(this).media(playerOptions);
        });
    }
});
