// JavaScript Document
$(document).ready(function() {	

$('.footer_form_holder, .about_us_opened, .about_us_sales_opened').hide();//Hide some stuff
$('.staff_member img').css({ opacity: 0.6 }); //Set staff opacity for hover state effect
$('.about_us_trigger h2').click(function() { $('.about_us_opened').slideToggle(300); });
$('.about_us_sales_trigger h2').click(function() { $('.about_us_sales_opened').slideToggle(300); });
$('a.footer_sales_button').click(function(){ //Opening forms
$(this).next('.footer_form_holder').slideToggle(300); 
var elementClicked = $(this); // scroll down so user can see the new open form
var destination = $(elementClicked).offset().top;
$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-100}, 1200 );
return false;
});
$('a.footer_lettings_button').click(function(){ //Opening forms
$(this).next('.footer_form_holder').slideToggle(300); 
var elementClicked = $(this); // scroll down so user can see the new open form
var destination = $(elementClicked).offset().top;
$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-100}, 1200 );
return false;
});
$('#slider').coinslider({ width: 940, height: 350, navigation: true, delay: 3000, sDelay:20, links: false, hoverPause: false });//home page slider
$('.staff_member img').hover(function() { $(this).stop().animate({ opacity: 1.0}, 350); }, function() { $(this).stop().animate({ opacity: 0.6}, 150);});
$('#commentForm').validate();
$('#commentFormTwo').validate();
});
