(function($) {
	$(document).ready( function() {

		$('#contact').click( function(event) {
			$(this).css('display', 'none');
			$('#contact-copy').css('display', 'block');
		});
		
		$('#contact-copy').click( function(event) {
			$(this).css('display', 'none');
			$('#contact').css('display', 'block');
		});

		$('.drop-down').each( function(index) {
			$(this).find('a:first').click( function(event) {
				event.preventDefault();
				if( $(this).parent('li').hasClass('open') == false ) {
					$('.sub-nav .open').find('a:first').css('background', 'none');
					$(this).css("background", '#f1f1f1 url(img/li-bg-v-grey.png) no-repeat scroll right top');
			
					$('.sub-nav .open ul').slideUp( function() {
						$(this).parent('li').removeClass('open');
					});
					
					$(this).siblings('ul').slideDown( function() {
						$(this).parent('li').addClass("open");
					});
					
				} else {
					/* makes the category collapse when on page of that category */
					/* comment to lock the nav */
					$('.sub-nav .open ul').slideUp( function() {
						$('.sub-nav .open').find('a:first').css('background', 'none');
						$(this).parent('li').removeClass('open');
					});
				}
			});
		});

	});
})(jQuery);
