/* Author: Bob Sherron

*/

$(document).ready(function() {
	var contactForm = $('#contact_form');
		
	$('#contact_link').click(function(event) {
		event.preventDefault();
		contactForm.slideDown();
		return false;
	});
	
	$('#cancel_form').click(function(event) {
		event.preventDefault();
		contactForm.slideUp();
		return false;
	});
	
	$('#download_brochure').click(function(event) {
		_gaq.push(['_trackEvent', 'PDF', 'Download', 'Black Has Never Felt So Red White and Blue']);
	});
	
	$('#submit_form').click(function(event) {
		// custom validation
		var phoneFilled = ($('#phone_ac').val() !== '' && $('#phone_pf').val() !== '' & $('#phone_nm') !== '');
		var addressFilled = ($('#address_1').val() !== '' && $('#city').val() !== '' && $('#zip').val() !== '')
		if (phoneFilled || $('#email').val() !== '' || addressFilled) {
			// 2 legit 2 quit
			$('#the_form').submit();
		}
		else {
			// ruh roh
			$('.exp').css('color','#fb5353');
			$('.req').css('border-color','#fb5353');
			return false;
		}
	});
	
});





















