(function($){ 
	$(function(){
		// Subnav jQuery
		if ($('#subnav').length > 0){
			// First and last classes
			$('#subnav li').hover(function(){
				$(this).addClass('current');
				$(this).prev().find('a').addClass('previous-current');
				$(this).next().find('a').addClass('next-current');
				$(this).find('.dropdown').css('display','block');
			},function(){
				$(this).removeClass('current');
				$(this).prev().find('a').removeClass('previous-current');
				$(this).next().find('a').removeClass('next-current');
				$('#subnav li.current_page_item').prev().find('a').addClass('previous-current');
				$('#subnav li.current_page_item').next().find('a').addClass('next-current');
				$(this).find('.dropdown').delay(100).hide(0);
			});
			$('.dropdown li').hover(function(){
				$(this).find('.dropdownPullout').css('display','block');
			},function(){
				$(this).find('.dropdownPullout').delay(100).hide(0);
			});
			$('#subnav li.current_page_item').prev().find('a').addClass('previous-current');
			$('#subnav li.current_page_item').next().find('a').addClass('next-current');
		}
		if ($('#homePageBigImg').length > 0){
			// First and last classes
			$('#homePageBigImg li a').mouseover(function(){
				$('#homePageBigImg').addClass($(this).attr('id'));
			});
			$('#homePageBigImg li a').mouseout(function(){
				$('#homePageBigImg').removeClass($(this).attr('id'));
			});
		}
		if ($('.pullout').length > 0){
			$('.leftBarMenu li').hover(function(){
				$(this).find('.pullout').css('display','block');
			},function(){
				$(this).find('.pullout').delay(100).hide(0);
			});
		}
		if ($('form').length > 0){
			$("#contactForm").validate();
		}
		function homeImgSlider() {
			$("#imageSlide img").css('left','0');
			for(imgSlidercounter = 0;imgSlidercounter < 1752;imgSlidercounter+=219){
				$("#imageSlide img").animate({left: "-"+imgSlidercounter+"px"}, {duration: 2000}).delay(2000);
			}
			$("#imageSlide img").animate({left: "-1752px"}, {duration: 2000, complete: homeImgSlider});
		}
		if ($('#imageSlide').length > 0){
			$(document).ready(homeImgSlider);
		}
	});
})(jQuery);

