$(function() {

    if($.browser.msie ){	
        var hideshow = true;
    }
    else{
        var hideshow = false;
    }

    $('.topnavitem').each(function () {
        var time = 450;

        var trigger = $('.parent', this);
	if(hideshow){
		var info = $('.child', this).hide();
	}else{
		var info = $('.child', this).css('opacity', 0);
	}
    var els = [];
    if(trigger.length) els.push(trigger.get(0));
    if(info.length) els.push(info.get(0));
	
	if(hideshow){
		// ie8 can't do animation of opacity on transparent pngs
		$(els).mouseover(function(){
		    $('#header #navigation .top-navigation li.active').css({zIndex:1});
			info.show().css({top: 25, left: -50, zIndex:10});
			$('.mm').css({'margin-left': '10px'});
		}).mouseout(function(){
			info.hide().css({zIndex:1});
			$('#header #navigation .top-navigation li.active').css({zIndex:1});
		});	

	}else{
        $(els).mouseover(function () {
            info.stop(true, false).css({
                top: 25,
                left: -50,
                display: 'block'
            }).animate({
                opacity: 1
            }, time, 'swing');
        }).mouseout(function () {
            info.stop(true, false).animate({
                opacity: 0
            }, time, 'swing', function () {
                shown = false;
                info.css('display', 'none');
            });
        });
	}
    });
	
});

