// prevent flickering background images in IE6
try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

$(document).ready(function() {

    // disable rootNav clicks
    $('#rootNav a.rootItem').click(function() {
        $(this).blur();
        return false;
    });
    
    // show subNav - face
    $('#rootNav a.rootItem.face').mouseover(function() {
        $(this).siblings('a.rootItem').removeClass('active');
        $(this).addClass('active');
        $('.subNav.active').removeClass('active');
        $('.subNav.face').addClass('active');
    });

    // show subNav - body
    $('#rootNav a.rootItem.body').mouseover(function() {
        $(this).siblings('a.rootItem').removeClass('active');
        $(this).addClass('active');
        $('.subNav.active').removeClass('active');
        $('.subNav.body').addClass('active');
    });

    // show subNav - skin
    $('#rootNav a.rootItem.skin').mouseover(function() {
        $(this).siblings('a.rootItem').removeClass('active');
        $(this).addClass('active');
        $('.subNav.active').removeClass('active');
        $('.subNav.skin').addClass('active');
    });

    // show subNav - spa
    $('#rootNav a.rootItem.spa').mouseover(function() {
        $(this).siblings('a.rootItem').removeClass('active');
        $(this).addClass('active');
        $('.subNav.active').removeClass('active');
        $('.subNav.spa').addClass('active');
    });
    
    // hide subNav
    $('#sideNav').hover(function() {}, function() {
        $('#rootNav a.rootItem.active').removeClass('active');
        $('.subNav.active').removeClass('active');
    });
        
    // location submission
    $('#location a.goButton').click(function() {
        location.href = $('#locale').val();
        return false;
    });

});
