$(document).ready(function() {
    $('a').focus(function() {
        $(this).blur();
    });
    
    $(".nav_bg .nav > li:last > a").css("border-right","1px solid #163155");
    
    if ($("#box-weather").length) {
        $.simpleWeather({
            zipcode: '48302',
            unit: 'f',
            success: function(weather) {
                $("#box-weather").append('<div class="weatherpic"><img width="120" src="'+weather.image+'" /></div>');
                $("#box-weather").append('<h2>'+weather.temp+'&deg; '+weather.units.temp+'</h2>');
                $("#box-weather").append("<span>"+weather.currently+"</span>");
            
               	$("#box-weather").append('<a href="'+weather.link+'">View Forecast &raquo;</a>');
            },
            error: function(error) {
                $("#box-weather").html('<p>'+error+'</p>');
            }
        });
    }
    
    $("ul.nav li").hover(function(){

        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');

    }, function(){

        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');

    });

    $("ul.nav li ul li:has(ul)").find("a:first").append(" &raquo; ");
    
    
    $("ul.nav li ul li a").hover(function(){

        $(this).parent("li").addClass("hover");
        $(this).parent("li").children("ul").css("top",($(this).offset().top-87));
        
    }, function(){
        
    });
    
});
