$(function(){
		
	$('.navBar .link:last')
	.css('background-image','url()')
	.find('.drop')
	.css({'left':'auto','right':'-3px'});
	
	$('.navBar .link:has(.drop)').safeHover(function(){
		$(this).addClass('temp_active');
		$(this).find('.drop').stop(false,true).show(200);
	},function(){
		$(this).removeClass('temp_active');
		$(this).find('.drop').stop(false,true).hide(200);
	},200,200,'indep');
	
	$('.drop').each(function(){
		$(this).find('.item:last').css('border-bottom','none');
	});
	
	$('.drop .item').hover(function(){
		$(this).css('background-color','#f3f3f3');
	},function(){
		$(this).css('background-color','transparent');
	});
	
	if($('.sidequote:visible').length == 1){
		var bar = $('.sidequote');
		var barOffset = bar.offset();
		var upperLimit = 0;
		var lowerLimit = ($('.subBody .subContent').outerHeight() - bar.outerHeight() - upperLimit);
		
		if(lowerLimit < 0){
			lowerLimit = bar.outerHeight();
		}
	
		$(window).scroll(function(){
			var theScroll = $(this).scrollTop();
			var scrollStart = barOffset.top;
			
			if((theScroll > scrollStart) && (theScroll < (scrollStart + lowerLimit))){
				bar.stop().animate({
					marginTop: (upperLimit + (theScroll - scrollStart) + 10)+'px'
				},300);
			}
			else if(theScroll >= (scrollStart + lowerLimit)){
				bar.stop().animate({
					marginTop: (lowerLimit + upperLimit + 10) +'px'
				},300);
			}
			else{
				bar.stop().animate({
					marginTop: upperLimit + 'px'
				},300);
			}
		});
	};
	
	$('.inputbox').leftAlign();
	$('.align1').leftAlign();
	$('.align2').leftAlign();
	
	$('.cleanme').each(function(){
		$(this).cleanForm({
			inputActive:'#b6bdc7',
			textColor: '#3a3a3a',
			requiredMessage: '<span class="color">*</span>'
		});
	});
	
	var tab = 1;
	$('[tabindex]').each(function(){
		$(this).attr('tabindex',tab);
		tab++;
	});
	
});
