
//settings for drop down quickmenu
var obj = null;
function checkHover() {
	if(obj) {
		obj.find('ul').hide('fast');
		$('.menuactive').addClass('menuselect').removeClass('menuactive');
	}
}
$(document).ready(function() {
// on ready functions for drop down quick menu
	$(".submenu").hide();
	
	$(".menuselect").hover(function(){	
		$(this).find('.submenu').show('fast');
		$(this).addClass('menuactive').removeClass('menuselect');
		return false;
	}, function() {
		obj = $(this);
		setTimeout("checkHover()",400);
	});
	
//adds smooth scroll to pages. needs to be fixed to keep browser history
	$('a[href^=#]:not([href=#])').click( function() {
	    var x = $(this.hash);
	    if( x.length ) {
	      $('html,body').animate( { scrollTop: x.offset().top - 20 }, 500 );
	            
				return false;	         
	    }
	  });
	
//thumbnail hover effects	
	$('.imgover').hover(function() {
	//	$(this).find('.thumbclick').fadeIn('fast');
		$(this).find('.thumbclick').animate({top:'179px'},{queue:false,duration:300});
		$(this).find('.gi').animate({margin:'-27px 0 0 0'},{queue:false,duration:300});
	}, function() {
		$(this).find('.thumbclick').animate({top:'206px'},{queue:false,duration:300});
		$(this).find('.gi').animate({margin:'0px 0 0 0'},{queue:false,duration:300});
	});
//basic fade opacity on button hover	
	$('.morebutton').hover(function() {
		$(this).fadeTo('fast', 0.8);
	}, function(){
		$(this).fadeTo('fast', 1.0);
	});

//Validate contact form at bottom of page
	$("#commentForm").validate();
	
	
});
