
$(document).ready(function() {
    // Drop Down Menu//
    $('#menu ul.tabs li ul').addClass('dropdown');
    //$('#menu ul.tabs li ul li ul').removeClass('dropdown');
    $('#navigation').css('overflow', 'visible');
    //Breadcrumbs //
    $("#breadcrumbs a:last-child").css({ background: "none" });
    // ANDREW TEST
    $('li a').each(function() {
        var me = $(this);
        var firstword = me.text().split(" ")[0];
        if (firstword == 'NEW!') {
            me.html(me.text().replace(/(^\w+!)/, '<span style="color: #B13324">$1</span>'));
        }
    });
    // Flags //
    $(".main_flag").click(function() {
        $(".choose_flag").slideToggle("slow");
        $(".choose_flag").mouseleave(function() {
            $(".choose_flag").fadeOut("quick");
        });
    });
    // IE 7 BUG FIX
    $(function() {
        if ($.browser.msie) {
            $('div').each(function(i) {
                if ($(this).css('position') != 'absolute') $(this).css('zIndex', 1000 - (i * 10));
            });
        }
    })

    //  search text
    $('.search_text').each(function() {
        var str = $(this).val();
        //  remove inactive when focused
        $(this).focus(function() {
            $(this).removeClass('search_text_inactive');
            if ($(this).val() == str) {
                $(this).val('');
            }
        });

        //  add inactive when blurred
        $(this).blur(function() {
            if ($(this).val() == '') {
                $(this).addClass('search_text_inactive');
                $(this).val(str);
            }
        });

    });
    
});







