// JavaScript Document

/* <![CDATA[ */
		$(function(){
			var snip = "//snip";
			var snap = "//snap";
			$("pre.get-content").each(function(){
				var code = $("#"+$(this).attr("rel")).text();
				$(this).text(code.split(snip)[1].split(snap)[0].replace(/\t/g, "  ") );
			});
		});
	/* ]]> */


$(document).ready(function() {
	

	function megaHoverOver(){
		$(this).find(".sub").stop().fadeTo('fast', 1).show();
			
		//Calculate width of all ul's
		(function($) { 
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				//Calculate row
				$(this).find("ul").each(function() {					
					rowWidth += $(this).width(); 
				});	
			};
		})(jQuery); 
		
		if ( $(this).find(".row").length > 0 ) { //If row exists...
			var biggestRow = 0;	
			//Calculate each row
			$(this).find(".row").each(function() {							   
				$(this).calcSubWidth();
				//Find biggest row
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
			});
			//Set width
			$(this).find(".sub").css({'width' :biggestRow});
			$(this).find(".row:last").css({'margin':'0'});
			
		} else { //If row does not exist...
			
			$(this).calcSubWidth();
			//Set Width
			$(this).find(".sub").css({'width' : rowWidth});
			
		}
	}
	
	function megaHoverOut(){ 
	  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
		  $(this).hide(); 
	  });
	}


	var config = {    
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 100, // number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
	};

	$("ul#topnav li .sub").css({'opacity':'0'});
	$("ul#topnav li").hoverIntent(config);



});


$(function(){
	$('.icon').imgslide({
		top: '-100px'
	});
});



/* wait until document is fully scriptable
// This was shut down because it wasn't being used, and because the offsite hosted jQuery tools file was corrupt as of this morning 12/17/2010.
$(function() {

	// select #flowplanes and make it scrollable. use circular and navigator plugins
	$("#flowpanes").scrollable({ circular: true, mousewheel: false }).navigator({

		// select #flowtabs to be used as navigator
		navi: "#flowtabs",

		// select A tags inside the navigator to work as items (not direct children)
		naviItem: 'a',

		// assign "current" class name for the active A tag inside navigator
		activeClass: 'current',

		// make browser's back button work
		history: true

	});
});
*/


// JavaScript Document

	$(function() {
		$( ".accordion" ).accordion({
			autoHeight: false,
			navigation: true,
			collapsible: true,
			active: false
		});
	});

// Tax Tip Popups

	//Footer
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-footer-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-footer" ).click(function() {
			$( "#taxtip-footer-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - State Refund
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-state-refund-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-state-refund" ).click(function() {
			$( "#taxtip-state-refund-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Moving Expenses
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-moving-expenses-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-moving-expenses" ).click(function() {
			$( "#taxtip-moving-expenses-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Social Security Income
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-social-security-income-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-social-security-income" ).click(function() {
			$( "#taxtip-social-security-income-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Rental Property
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-rental-property-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-rental-property" ).click(function() {
			$( "#taxtip-rental-property-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Mortgage Insurance
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-mortgage-insurance-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-mortgage-insurance" ).click(function() {
			$( "#taxtip-mortgage-insurance-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Traditional IRA
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-traditional-ira-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-traditional-ira" ).click(function() {
			$( "#taxtip-traditional-ira-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Unreimbursed Employee Expenses
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-unreimbursed-employee-expenses-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-unreimbursed-employee-expenses" ).click(function() {
			$( "#taxtip-unreimbursed-employee-expenses-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Business Miles Driven For Employer
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-business-miles-driven-for-employer-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-business-miles-driven-for-employer" ).click(function() {
			$( "#taxtip-business-miles-driven-for-employer-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - First Time Homebuyer
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-first-time-homebuyer-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-first-time-homebuyer" ).click(function() {
			$( "#taxtip-first-time-homebuyer-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Self Employment
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-self-employment-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-self-employment" ).click(function() {
			$( "#taxtip-self-employment-dialog" ).dialog( "open" );
			return false;
		});
	});
	
		// Tax Tip - Spouse Self Employment
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-spouse-self-employment-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-spouse-self-employment" ).click(function() {
			$( "#taxtip-spouse-self-employment-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Short Term Capital Gains
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-short-term-capital-gains-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-short-term-capital-gains" ).click(function() {
			$( "#taxtip-short-term-capital-gains-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	// Tax Tip - Long Term Capital Gains
	$.fx.speeds._default = 400;
	$(function() {
		$( "#taxtip-long-term-capital-gains-dialog" ).dialog({
			autoOpen: false,
			show: "fade",
			hide: "fade"
		});

		$( "#taxtip-long-term-capital-gains" ).click(function() {
			$( "#taxtip-long-term-capital-gains-dialog" ).dialog( "open" );
			return false;
		});
	});
	
	
	
// End Tax Tip Popups

// Show Hide
/* Married Status
$(document).ready(function() {
  $('.spouse-dob').hide();
  $('.SpousesIncome').hide();
  $('.SpouseEarlyWithdrawal').hide();
  $('#married').mousedown(function() {
  $('.spouse-dob').show('fast');
  $('.SpousesIncome').show('fast');
  $('.SpouseEarlyWithdrawal').show();
 	return false;
  });

  $('#single').mousedown(function() {
  $('.spouse-dob').hide('fast');
  $('.SpousesIncome').hide('fast');
  $('.SpouseEarlyWithdrawal').hide();
 	return false;
  });

  $('#hoh').mousedown(function() {
  $('.spouse-dob').hide('fast');
  $('.SpousesIncome').hide('fast');
  $('.SpouseEarlyWithdrawal').hide();
  	return false;
  });

});
*/

$(document).ready(function() {
	$('.spouse-dob').hide(); 
	$('.SpousesIncome').hide(); 
	$('.SpouseEarlyWithdrawal').hide();
	
    $("#status").change(function(){
		
        var status = $("#status").val();  

        if (status == "single") {
            $('.spouse-dob').hide('fast'); 
			$('.SpousesIncome').hide('fast'); 
			$('.SpouseEarlyWithdrawal').hide('fast');          
        } else if (status == "hoh") {
            $('.spouse-dob').hide('fast'); 
			$('.SpousesIncome').hide('fast'); 
			$('.SpouseEarlyWithdrawal').hide('fast');             
        } else {
            $('.spouse-dob').show('fast');
            $('.SpousesIncome').show('fast');
			$('.SpouseEarlyWithdrawal').show('fast');
        }
    });
}); 

/* Traditional IRA
$(document).ready(function() {
  //$('.TraditionalIRA').hide();
  //$('.TraditionalIRASlider').hide();
  $('#TraditionalIRAW2').mousedown(function() {
  $('.TraditionalIRA').toggle('fast');
  $('.TraditionalIRASlider').toggle('fast');
 	return false;
  });

});

/* Spouse Traditional IRA
$(document).ready(function() {
  //$('.SpouseTraditionalIRA').hide();
  //$('.SpouseTraditionalIRASlider').hide();
  $('#SpouseTraditionalIRAW2').mousedown(function() {
  $('.SpouseTraditionalIRA').toggle('fast');
  $('.SpouseTraditionalIRASlider').toggle('fast');
 	return false;
  });

});
*/

// Itemized Deductions
$(document).ready(function() {
  $('.ItemizedYes').hide();
  $('#StandardDeduction').mousedown(function() {
  $('.ItemizedYes').toggle('fast');
  $('.ItemizedNo').toggle('fast');
 	return false;
  });

});

// Did you buy a home?
$(document).ready(function() {
  $('.HomePurchasePrice').hide();
  $('#BuyHome').mousedown(function() {
  $('.HomePurchasePrice').toggle('fast');
 	return false;
  });

});

// Close all the collaspable panels when hitting the clear button
$(document).ready(function() {
  $('#StartOver').mouseup(function() {
  $('.HomePurchasePrice').hide();
  $('.CollegeAttendFirstFourYearsDependents').hide();
  $('.TraditionalIRA').hide();
  $('.SpouseTraditionalIRA').hide();
 	return false;
  });

});

// College Attend First Four Years
$(document).ready(function() {
  $('.CollegeAttendFirstFourYearsDependents').hide();
  $('#CollegeAttendFirstFourYears').mousedown(function() {
  $('.CollegeAttendFirstFourYearsDependents').toggle('fast');
 	return false;
  });

});

// Instant Online Quote - Question Number 2
$(document).ready(function() {
  $('.SelfEmployed_0_yes').hide();
  $('#SelfEmployed_0').mousedown(function() {
  $('.SelfEmployed_0_yes').show('fast');
 	return false;
  });
  
  $('#SelfEmployed_0_label').mousedown(function() {
  $('.SelfEmployed_0_yes').show('fast');
 	return false;
  });

  $('#SelfEmployed_1').mousedown(function() {
  $('.SelfEmployed_0_yes').hide('fast');
 	return false;
  });
  
  $('#SelfEmployed_1_label').mousedown(function() {
  $('.SelfEmployed_0_yes').hide('fast');
 	return false;
  });

});

// Instant Online Quote - Question Number 3
$(document).ready(function() {
  $('.W2_0_yes').hide();
  $('#W2_0').mousedown(function() {
  $('.W2_0_yes').show('fast');
 	return false;
  });
  
  $('#W2_0_label').mousedown(function() {
  $('.W2_0_yes').show('fast');
 	return false;
  });

  $('#W2_1').mousedown(function() {
  $('.W2_0_yes').hide('fast');
 	return false;
  });
  
  $('#W2_1_label').mousedown(function() {
  $('.W2_0_yes').hide('fast');
 	return false;
  });

});

// Instant Online Quote - Question Number 4
$(document).ready(function() {
  $('.ScheduleD').hide();
  $('#DidYouSellInvestments_0').mousedown(function() {
  $('.ScheduleD').show('fast');
 	return false;
  });
  
  $('#DidYouSellInvestments_0_label').mousedown(function() {
  $('.ScheduleD').show('fast');
 	return false;
  });

  $('#DidYouSellInvestments_1').mousedown(function() {
  $('.ScheduleD').hide('fast');
 	return false;
  });
  
  $('#DidYouSellInvestments_1_label').mousedown(function() {
  $('.ScheduleD').hide('fast');
 	return false;
  });

});

// Instant Online Quote - Question Number 4
$(document).ready(function() {
  $('.DidYouLiveOutsideOfArizona_0_yes').hide();
  $('#DidYouLiveOutsideOfArizona_0').mousedown(function() {
  $('.DidYouLiveOutsideOfArizona_0_yes').show('fast');
 	return false;
  });
  
  $('#DidYouLiveOutsideOfArizona_0_label').mousedown(function() {
  $('.DidYouLiveOutsideOfArizona_0_yes').show('fast');
 	return false;
  });

  $('#DidYouLiveOutsideOfArizona_1').mousedown(function() {
  $('.DidYouLiveOutsideOfArizona_0_yes').hide('fast');
 	return false;
  });
  
  $('#DidYouLiveOutsideOfArizona_1_label').mousedown(function() {
  $('.DidYouLiveOutsideOfArizona_0_yes').hide('fast');
 	return false;
  });

});

// Instant Online Quote - Question Number 5
$(document).ready(function() {
  $('.ScheduleEOwn').hide();
  $('#DidYouOwnRentalProperty_0').mousedown(function() {
  $('.ScheduleEOwn').show('fast');
 	return false;
  });
  
  $('#DidYouOwnRentalProperty_0_label').mousedown(function() {
  $('.ScheduleEOwn').show('fast');
 	return false;
  });

  $('#DidYouOwnRentalProperty_1').mousedown(function() {
  $('.ScheduleEOwn').hide('fast');
 	return false;
  });
  
  $('#DidYouOwnRentalProperty_1_label').mousedown(function() {
  $('.ScheduleEOwn').hide('fast');
 	return false;
  });

});

$(document).ready(function() {
  $('.ScheduleESell').hide();
  $('#DidYouSellRentalProperty_0').mousedown(function() {
  $('.ScheduleESell').show('fast');
 	return false;
  });
  
  $('#DidYouSellRentalProperty_0_label').mousedown(function() {
  $('.ScheduleESell').show('fast');
 	return false;
  });

  $('#DidYouSellRentalProperty_1').mousedown(function() {
  $('.ScheduleESell').hide('fast');
 	return false;
  });
  
  $('#DidYouSellRentalProperty_1_label').mousedown(function() {
  $('.ScheduleESell').hide('fast');
 	return false;
  });

});

// Instant Online Quote - Question Number 11
$(document).ready(function() {
  $('.BusinessUseOfHome_0_yes').hide();
  $('#BusinessUseOfHome_0').mousedown(function() {
  $('.BusinessUseOfHome_0_yes').show('fast');
 	return false;
  });
  
  $('#BusinessUseOfHome_0_label').mousedown(function() {
  $('.BusinessUseOfHome_0_yes').show('fast');
 	return false;
  });

  $('#BusinessUseOfHome_1').mousedown(function() {
  $('.BusinessUseOfHome_0_yes').hide('fast');
 	return false;
  });
  
  $('#BusinessUseOfHome_1_label').mousedown(function() {
  $('.BusinessUseOfHome_0_yes').hide('fast');
 	return false;
  });

});


$(function() {
		// run the currently selected effect
		function runEffect() {
			// get effect type from 
			var selectedEffect = $( "#effectTypes" ).val();
			
			// most effect types need no options passed by default
			var options = {};
			// some effects have required parameters
			if ( selectedEffect === "blind" ) {
				options = { percent: 0 };
			} else if ( selectedEffect === "size" ) {
				options = { to: { width: 200, height: 60 } };
			}
			
			// run the effect
			$( ".filing-status-married" ).toggle( selectedEffect, options, 1000 );
		};
		
		// set effect from select menu value
		$( ".spouse-income" ).click(function() {
			runEffect();
			return false;
		});
	});


$(function() {
		$( ".datepicker" ).datepicker({
			changeMonth: true,
			changeYear: true,
			yearRange: '1930:2010'
		});
	});




$(function() {
		$( ".WageSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 500,
			slide: function( event, ui ) {
	$( "#Wage" ).val( ui.value );
			}
		});
	$( "#Wage" ).val( $( ".WageSlider" ).slider( "value" ) );
	});

$(function() {
		$( ".InterestSlider" ).slider({
			value:0,
			min: 0,
			max: 25000,
			step: 100,
			slide: function( event, ui ) {
	$( "#Interest" ).val( ui.value );
			}
		});
	$( "#Interest" ).val( $( ".InterestSlider" ).slider( "value" ) );
	});

$(function() {
		$( ".DividendSlider" ).slider({
			value:0,
			min: 0,
			max: 25000,
			step: 100,
			slide: function( event, ui ) {
	$( "#Dividend" ).val( ui.value );
			}
		});
	$( "#Dividend" ).val( $( ".DividendSlider" ).slider( "value" ) );
	});
	
$(function() {
		$( ".SpouseWageSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 500,
			slide: function( event, ui ) {
	$( "#SpouseWage" ).val (ui.value );
			}
		});
	$( "#SpouseWage" ).val( $( ".SpouseWageSlider" ).slider( "value" ) );
	});

$(function() {
		$( ".SpouseInterestSlider" ).slider({
			value:0,
			min: 0,
			max: 25000,
			step: 100,
			slide: function( event, ui ) {
	$( "#SpouseInterest" ).val( ui.value );
			}
		});
	$( "#SpouseInterest" ).val( $( ".SpouseInterestSlider" ).slider( "value" ) );
	});

$(function() {
		$( ".SpouseDividendSlider" ).slider({
			value:0,
			min: 0,
			max: 25000,
			step: 100,
			slide: function( event, ui ) {
	$( "#SpouseDividend" ).val( ui.value );
			}
		});
	$( "#SpouseDividend" ).val( $( ".SpouseDividendSlider" ).slider( "value" ) );
	});

$(function() {
		$( ".StateRefundSlider" ).slider({
			value:0,
			min: 0,
			max: 50000,
			step: 100,
			slide: function( event, ui ) {
	$( "#StateRefund" ).val( ui.value );
			}
		});
	$( "#StateRefund" ).val( $( ".StateRefundSlider" ).slider( "value" ) );
	});

$(function() {
		$( ".AlimonyReceivedSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#AlimonyReceived" ).val( ui.value );
			}
		});
	$( "#AlimonyReceived" ).val( $( ".AlimonyReceivedSlider" ).slider( "value" ) );
	});

$(function() {
		$( ".SelfEmployedSlider" ).slider({
			value:0,
			min: -250000,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#SelfEmployed" ).val( ui.value );
			}
		});
	$( "#SelfEmployed" ).val( $( ".SelfEmployedSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".SelfEmployedMilesSlider" ).slider({
			value:0,
			min: 0,
			max: 25000,
			step: 100,
			slide: function( event, ui ) {
	$( "#SelfEmployedMiles" ).val( ui.value );
			}
		});
	$( "#SelfEmployedMiles" ).val($( ".SelfEmployedMilesSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".SpouseSelfEmployedSlider" ).slider({
			value:0,
			min: -250000,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#SpouseSelfEmployed" ).val( ui.value );
			}
		});
	$( "#SpouseSelfEmployed" ).val( $( ".SpouseSelfEmployedSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".SpouseSelfEmployedMilesSlider" ).slider({
			value:0,
			min: 0,
			max: 25000,
			step: 100,
			slide: function( event, ui ) {
	$( "#SpouseSelfEmployedMiles" ).val( ui.value );
			}
		});
	$( "#SpouseSelfEmployedMiles" ).val($( ".SpouseSelfEmployedMilesSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".ShortTermCapitalGainsSlider" ).slider({
			value:0,
			min: -250000,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#ShortTermCapitalGains" ).val( ui.value );
			}
		});
	$( "#ShortTermCapitalGains" ).val( $( ".ShortTermCapitalGainsSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".LongTermCapitalGainsSlider" ).slider({
			value:0,
			min: -250000,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#LongTermCapitalGains" ).val( ui.value );
			}
		});
	$( "#LongTermCapitalGains" ).val( $( ".LongTermCapitalGainsSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".RetirementDistributionsSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#RetirementDistributions" ).val( ui.value );
			}
		});
	$( "#RetirementDistributions" ).val( $( ".RetirementDistributionsSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".SpouseRetirementDistributionsSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#SpouseRetirementDistributions" ).val( ui.value );
			}
		});
	$( "#SpouseRetirementDistributions" ).val( $( ".SpouseRetirementDistributionsSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".RentalPropertyNetSlider" ).slider({
			value:0,
			min: -250000,
			max: 250000,
			step: 500,
			slide: function( event, ui ) {
	$( "#RentalPropertyNet" ).val( ui.value );
			}
		});
	$( "#RentalPropertyNet" ).val( $( ".RentalPropertyNetSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".RentalPropertySlider" ).slider({
			value:0,
			min: 0,
			max: 500000,
			step: 100,
			slide: function( event, ui ) {
	$( "#RentalProperty" ).val( ui.value );
			}
		});
	$( "#RentalProperty" ).val( $( ".RentalPropertySlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".UnemploymentIncomeSlider" ).slider({
			value:0,
			min: 0,
			max: 25000,
			step: 100,
			slide: function( event, ui ) {
	$( "#UnemploymentIncome" ).val( ui.value );
			}
		});
	$( "#UnemploymentIncome" ).val( $( ".UnemploymentIncomeSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".SpouseUnemploymentIncomeSlider" ).slider({
			value:0,
			min: 0,
			max: 25000,
			step: 100,
			slide: function( event, ui ) {
	$( "#SpouseUnemploymentIncome" ).val( ui.value );
			}
		});
	$( "#SpouseUnemploymentIncome" ).val( $( ".SpouseUnemploymentIncomeSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".SocialSecurityIncomeSlider" ).slider({
			value:0,
			min: 0,
			max: 50000,
			step: 500,
			slide: function( event, ui ) {
	$( "#SocialSecurityIncome" ).val( ui.value );
			}
		});
	$( "#SocialSecurityIncome" ).val( $( ".SocialSecurityIncomeSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".SpouseSocialSecurityIncomeSlider" ).slider({
			value:0,
			min: 0,
			max: 50000,
			step: 500,
			slide: function( event, ui ) {
	$( "#SpouseSocialSecurityIncome" ).val( ui.value );
			}
		});
	$( "#SpouseSocialSecurityIncome" ).val( $( ".SpouseSocialSecurityIncomeSlider" ).slider( "value" ) );
	})
	
$(function() {
		$( ".GamblingWinningsSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 500,
			slide: function( event, ui ) {
	$( "#GamblingWinnings" ).val( ui.value );
			}
		});
	$( "#GamblingWinnings" ).val( $( ".GamblingWinningsSlider" ).slider( "value" ) );
	});
	
$(function() {
		$( ".MovingExpensesSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#MovingExpenses" ).val( ui.value );
			}
		});
	$( "#MovingExpenses" ).val( $( ".MovingExpensesSlider" ).slider( "value" ) );
	});
	
$(function() {
		$( ".BusinessIncomeSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#BusinessIncome" ).val( ui.value );
			}
		});
	$( "#BusinessIncome" ).val( $( ".BusinessIncomeSlider" ).slider( "value" ) );
	});
	
$(function() {
		$( ".SelfEmploymentTaxSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 100,
			slide: function( event, ui ) {
	$( "#SelfEmploymentTax" ).val( ui.value );
			}
		});
	$( "#SelfEmploymentTax" ).val( $( ".SelfEmploymentTaxSlider" ).slider( "value" ) );
	});
	
	
$(function() {
		$( ".FederalTaxWithholdingsSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 500,
			slide: function( event, ui ) {
	$( "#FederalTaxWithholdings" ).val( ui.value );
			}
		});
	$( "#FederalTaxWithholdings" ).val( $( ".FederalTaxWithholdingsSlider" ).slider( "value" ) );
	});
	
$(function() {
		$( ".EstimatedFederalTaxPaymentsSlider" ).slider({
			value:0,
			min: 0,
			max: 250000,
			step: 500,
			slide: function( event, ui ) {
	$( "#EstimatedFederalTaxPayments" ).val( ui.value );
			}
		});
	$( "#EstimatedFederalTaxPayments" ).val( $( ".EstimatedFederalTaxPaymentsSlider" ).slider( "value" ) );
	});
	
	
$(function() {
		$( ".TraditionalIRASlider" ).slider({
			value:0,
			min: 0,
			max: 6000,
			step: 500,
			slide: function( event, ui ) {
	$( "#TraditionalIRA" ).val( ui.value );
			}
		});
	$( "#TraditionalIRA" ).val( $( ".TraditionalIRASlider" ).slider( "value" ) );
	});
	
$(function() {
		$( ".SpouseTraditionalIRASlider" ).slider({
			value:0,
			min: 0,
			max: 6000,
			step: 500,
			slide: function( event, ui ) {
	$( "#SpouseTraditionalIRA" ).val( ui.value );
			}
		});
	$( "#SpouseTraditionalIRA" ).val( $( ".SpouseTraditionalIRASlider" ).slider( "value" ) );
	});
	


//jQuery ajax submit - Just displays the calculated amount to the right of the estimator
$(function() {
	$(".button-display").click(function() {
	  // validate and process form here
	  	var queryString = $('#tre').formSerialize();
	
		$.ajax({
		  type: "POST",
		  url: "http://www.taxtip.net/tax-return-estimator-results.php",
		  data: queryString,
		  success: function(response) {
			$('.amount').html("<div id='amount'></div>");
			$('#amount').html(response)
			.append("")
			.hide()
			.fadeIn(1500, function() {
			  $('#amount').append(calculate());
			});
		  }
		 });
		return false;
	});
});

//jQuery ajax submit - Just displays the calculated amount to the right of the instant online quote
$(function() {
	$(".button-display-quote-advanced").click(function() {
	  // validate and process form here
	  	var queryString = $('#ioqAdvanced').formSerialize();
	
		$.ajax({
		  type: "POST",
		  url: "http://www.taxtip.net/instant-online-quote-advanced-results.php",
		  data: queryString,
		  success: function(response) {
			$('.quote').html("<div id='quote'></div>");
			$('#quote').html(response)
			.append("")
			.hide()
			.fadeIn(1500, function() {
			  $('#quote').append(quote());
			});
		  }
		 });
		return false;
	});
});

//jQuery ajax submit - Just displays the calculated amount to the right of the instant online quote
$(function() {
	$(".button-display-quote").click(function() {
	  // validate and process form here
	  	var queryString = $('#ioq').formSerialize();
	
		$.ajax({
		  type: "POST",
		  url: "http://www.taxtip.net/instant-online-quote-results.php",
		  data: queryString,
		  success: function(response) {
			$('.quote').html("<div id='quote'></div>");
			$('#quote').html(response)
			.append("")
			.hide()
			.fadeIn(1500, function() {
			  $('#quote').append(quote());
			});
		  }
		 });
		return false;
	});
});


runOnLoad(function(){
  $("input#Wage").select().focus();
});

// Confirmation box that pops up when the Start Over button is clicked for the tax return estimator.
function confirmation() {
	var answer = confirm("Are you sure that you want to start over? This will clear all the tax information that you have entered.")
	if (answer){
		$('.amount').html("<div id='amount'></div>");
		document.tre.reset(); 
		window.location = "/tax-return-estimator";
	} 
}

// Confirmation box that pops up when the Start Over button is clicked for the instant online quote.
function confirmationquote() {
	var answerQuote = confirm("Are you sure that you want to start over? This will clear all the quote information that you have entered.")
	if (answerQuote){
		$('.quote').html("<div id='quote'></div>");
		document.ioq.reset(); 
		window.location = "/instant-online-quote";
	} 
}

// Confirmation box that pops up when the Start Over button is clicked for the instant online quote.
function confirmationquoteadvanced() {
	var answerQuote = confirm("Are you sure that you want to start over? This will clear all the quote information that you have entered.")
	if (answerQuote){
		$('.quote').html("<div id='quote'></div>");
		document.ioqAdvanced.reset(); 
		window.location = "/instant-online-quote-advanced";
	} 
}
