$(document).ready(function() {

	$('#tav_slider').anythingSlider({
		width: 900,          // Override the default CSS width
		buildArrows: true,
		autoPlay: true,
		autoPlayLocked: true,
		startStopped: false,
		pauseOnHover: true,
		startText: '',
		stopText: '',
		delay: 5000,
		resumeDelay: 1000,
		animationTime: 2000,
		easing: 'easeInOutExpo'
    });

	// toggle field labels on focus
	$('.quote_name').focus(function() {
		if ($(this).val() == 'Name:') {
			$(this).val('');
		}
	});

	$('.quote_name').blur(function() {
		if ($(this).val().length == 0) {
			$(this).val('Name:');
		}
	});

	$('.quote_email').focus(function() {
		if ($(this).val() == 'Email Address:') {
			$(this).val('');
		}
	});

	$('.quote_email').blur(function() {
		if ($(this).val().length == 0) {
			$(this).val('Email Address:');
		}
	});

	$('.quote_information').focus(function() {
		if ($(this).val() == 'Additional Information:') {
			$(this).val('');
		}
	});

	$('.quote_information').blur(function() {
		if ($(this).val().length == 0) {
			$(this).val('Additional Information:');
		}
	});

	// add/remove rows to/from quote form
	$("#add_quote_row").click(function() {
 		if ( $(this).parent().find("li:hidden:first").attr('id') == 'quote_row10' ){
			$('#add_quote_row').hide();
		}
   		$(this).parent().find("li:hidden:first").slideToggle("fast");
	});

	$('.newsletter_email_address').focus(function() {
		if ($(this).val() == 'Email Address:') {
			$(this).val('');
		}
	});

	$('.newsletter_email_address').blur(function() {
		if ($(this).val().length == 0) {
			$(this).val('Email Address:');
		}
	});

	$('.type_select').change(function() {
		$(this).parent().find('.product_option').hide();
		$(this).find('option:selected').each(function () {
			if ($(this).val() != ''){
				$(this).parent().parent().find(".product_select").val('');
				$(this).parent().parent().find(".product_option" + $(this).val()).show();
			} else {
				$(this).parent().parent().find('.product_option').show();
			}
		});
	});

	$(".type_select").val('');
	$(".product_select").val('');
	$(".quantity_select").val('1');



});

function remove_quote_row(id) {
	$('#'+ id).remove();
}
