/**
 * @author francisco
 */
$(document).ready(function(){
        
        headers = $('li.has_subnav, #home_li, #blog_li');
		active = $('li.active').attr('id');
        $.each(headers, function(index, value) {

                var object = $(value);
				

                position = object.position();
                
                object.children('.sub_nav').css('top', position.top + 16);
                object.children('.sub_nav').css('left', position.left + 5);
                
                object.hover(function(e){
                        object.children('.sub_nav').show();
						object.addClass("active");
						object.removeClass("normal");
                    }, function(e){
                    object.children('.sub_nav').hide();
					object.addClass("normal");
					object.removeClass("active");
                    $('#'+active).addClass("active");
					$('#'+active).removeClass("normal");
                    });
            });
			
	
    });