$(function(){
	/* remove bg from topnav last-child */
	$('.top-level:last-child').css({'background': 'none'});
	
	/* add/remove class */
	$('#menu li').hover(function() {
		$(this).addClass("over");
	},function(){
		$(this).removeClass("over");
	});
	
	/* assigns ids to quick links */
	$('#quicklinks li').each(function(i) {
		var n = i + 1;
		$(this).attr('id', 'quicklink-' + n);
	});
	
	/* assigns ids to topnav */
	var t = 0;
	$('#topnav > li').each(function(i) {
		t++;
		$(this).attr('id', 'top-' + t);
	});
	
	/* fades each drop down menu */
	$('nav li').each(function(){
		$(this).find('ul').css({ 'opacity': '0' });
		$(this).mouseover(function(){
			$(this).find('ul:eq(0)').stop().fadeTo('medium', 1);
		});
		$(this).mouseout(function(){
			$(this).find('ul:eq(0)').stop().fadeTo('fast', 0);
		});
	});
	
	/* quicklinks animations */
	$('#quicklinks li').hover(function(e) {
		$(this).addClass('over');
		$(this).find('span').hoverFlow(e.type, ({ 'margin-left': '5px' }), 'fast');
	}, function(e) {
		$(this).removeClass('over');
		$(this).find('span').hoverFlow(e.type, ({ 'margin-left': '0' }), 'fast');
	});
	
	/* cellspacing */
	$('.content-index table').attr({ 'cellspacing': '10', 'cellpadding': '0' });
	
	/* clearfix for vault */
	$('#email-container,#password-container').addClass('cf');
	
	/* add arrows */
	$('.top-level,#quicklinks li').append('<span class="arrow"></span>');
	
});
