$(document).ready(function() {


/* 	Sniff out IE6 and make sure we don't give it stomach ache */
	// Using jquery.browserplugin.js
/*
	var $browserMake = $.browser.name;
	var $browserVer = $.browser.versionX;
	var $iecrud = $browserMake+$browserVer;
*/
/* <script language="JavaScript" type="text/javascript" src="/scripts/plugins/jqbp.2.3/jquery.browserplugin.js"></script> */


	$('#brochureButton').click(function() {
		$('div#brochureSection').css({'height':'911px'});
		$('div#brochureSection').slideDown('fast', function() {
			$.scrollTo('div#brochureSection');
		});
	});

	$('.yNbuttons span.yes').click(function() {
		$('#brochureSection div.announce').hide();
		$('div#brochureSection').css({'padding-bottom':'70px', 'height':'auto'});
		$('form.brochure').slideDown('fast', function() {
			$.scrollTo('div#brochureSection');
		});
	});

	$('.yNbuttons span.yes').hover(function() {
		$(this).css({'cursor':'pointer' , 'border-width':'0', 'margin':'1px'});
	}, function() {
		$(this).css({'cursor':'default' , 'border-width':'1px', 'margin':'0px'});
	});



	$('p#brochureButton span.inner').hover(function() {
		$(this).css({'cursor':'pointer' , 'background':'url(/images/brochure-button.png) no-repeat 0 -50px'});
	}, function() {
		$(this).css({'background':'url(/images/brochure-button.png) no-repeat 0 0'});
	});

//	Fawn to IE6 (only IE6 needs this - pah)
	$('p#brochureButton span.outer').hover(function() {
		$('p#brochureButton span.outer').css({'display':'block'});
	});


	$('#howFind input#f_FoundBy_4').click(function() {
		$('input#f_FoundBy_5').slideDown();
	});

	$('#howFind input#f_FoundBy_0, #howFind input#f_FoundBy_1, #howFind input#f_FoundBy_2, #howFind input#f_FoundBy_3').click(function() {
		$('input#f_FoundBy_5').slideUp();
	});



	$('#wantChat input#f_wantachat_0').click(function() {
		$('p#howChat').slideDown();
	});

	$('#wantChat input#f_wantachat_1').click(function() {
		$('p#howChat').slideUp();
	});


	$('#howChat input#f_howchat_1').click(function() {
		$('input#f_howchat_2').slideDown();
		$('span#howChatAdvice1').show();
	});

	$('#howChat input#f_howchat_0').click(function() {
		$('input#f_howchat_2').slideUp();
		$('span#howChatAdvice1').hide();
	});




	$('#body_home p:empty').hide();


	$("#brochureSection #testimonial").validate({
		errorElement: "p",
		rules:
		{
			email: "required",
			email_chk: {
				equalTo: "#email"
			},
			f_Day: {
				required: true,
				range: [1, 31]
			},
			f_Month: {
				required: true,
				range: [1, 12]
			},
			f_Year: {
				required: true,
				range: [2009, 2050]
			},
			f_Day2: {
				required: false,
				range: [1, 31]
			},
			f_Month2: {
				required: false,
				range: [1, 12]
			},
			f_Year2: {
				required: false,
				range: [2009, 2050]
			}
		}
	});


	$('span#addMoreDates').click(function() {
		$('p#alternateDate').slideDown('fast');
	});


	$('.submit input').click(function() {
		if($("#brochureSection #testimonial").validate().form()) {
			$('#sendingNow').html('<strong class="warn">Sending&#8230;</strong>');
		} else {
		}
	});


/* 	Testimonials */

	$('form#testimonial p.input.radio label.choice').mouseover(function() {
		$(this).css({'text-decoration':'underline', 'cursor':'pointer'});
	});
	$('form#testimonial p.input.radio label.choice').mouseout(function() {
		$(this).css({'text-decoration':'none', 'cursor':'inherit'});
	});

	$('form#testimonial p.input.checkbox label.choice').mouseover(function() {
		$(this).css({'text-decoration':'underline', 'cursor':'pointer'});
	});
	$('form#testimonial p.input.checkbox label.choice').mouseout(function() {
		$(this).css({'text-decoration':'none', 'cursor':'inherit'});
	});


	$('#body_testimonials p:empty').hide();


	$("#body_testimonials #testimonial").validate({

		errorElement: "p",

		rules:
		{
			email: "required",
			email_chk: {
				equalTo: "#email"
			},
			f_Overall: "required",
			f_Day: {
				required: true,
				range: [1, 31]
			},
			f_Month: {
				required: true,
				range: [1, 12]
			},
			f_Year: {
				required: true,
				range: [2007, 2050]
			}
		}
	});


});

/*
	$('.submit input').mousedown(function() {
		if($("#brochureSection #testimonial").validate().form()) {
			$('.submit input').attr('disabled', 'disabled');
			$('.submit input').attr('value', 'Sending...');
		} else {
		}
	});
*/


/*
	$(function() {
		if ($iecrud == ('msie6' || 'msie7')) {
		} else {
			$('.submit input').click(function() {
				if($("#brochureSection #testimonial").validate().form()) {
					$('.submit input').attr('disabled', 'disabled');
					$('.submit input').attr('value', 'Sending...');
				} else {
				}
			});
		}
	});
*/






















