jQuery(document).ready(function($) {
	
	// Navigation hovers.
	$('ul#navigation .nav').hover( function() {
		if ($(this).hasClass('active')) {
			return;
		}
		$(this).find('div.nav-inactive').stop(true, true).fadeOut(100);
	}, function() {
		if ($(this).hasClass('active')) {
			return;
		}
		$(this).find('div.nav-inactive').stop(true, true).fadeIn(100);
	});
	
	// Get Quote banner
	$('#get-quote').animate({opacity:"1.0"}, 5000).slideDown('slow');
	
	$('#get-quote').hover ( function() {
		$('ul#navigation #n_contact').find('div.nav-inactive').stop(true, true).fadeOut(100);
	}, function() {
		$('ul#navigation #n_contact').find('div.nav-inactive').stop(true, true).fadeIn(100);
	});
	
	$('.file-wrapper input[type=file]').bind('change focus click', function() {
		var $this = $(this),
		$val = $this.val(),
		valArray = $val.split('\\'),
		newVal = valArray[valArray.length-1],
		$button = $this.siblings('.button'),
		$fakeFile = $this.siblings('.file-holder');
		if(newVal !== '') {
			$button.text('File Chosen');
			if($fakeFile.length === 0) {
				$button.after('' + newVal + '');
			} else {
				$fakeFile.text(newVal);
			}
		}
	});

});
