	
	$(document).ready(function() {
 $('.quote_p a[href][title]').qtip({
    style: { 
    padding: 5,
      background: '#FEC18B',
      color: '#333',
      textAlign: 'left',
    width: 250,
     border: {
         width: 5,
         radius: 5,
         color: '#f7891e'
      },

    tip: true },
    
       position: {
      corner: {
         target: 'bottomLeft',
         tooltip: 'topRight'
      }
   }

    
    });


 
$('#freq_div, .frequency, #other_type, #workers, #periodic, #first_periodic, #final_payment, #guaranteed_div, #increase, #increase1, #increase2, #lumpsum, #bottom').hide(); //hide donation choice children

$('input[name="payment_type"]').click(function() { //donation choice radio button click
//$(this).next().css('border', '1px solid blue');
//$(this).next().find('ul:first').css('border', '1px solidred');
//$(".donation_children").slideToggle('slow');

switch ( $(this).val() ) {
    
case 'Structured Settlement' : //if by cause, show cause, hide foundation

$('#freq_div').slideDown();
$('#workers').slideUp();
$('#other_type').slideUp();
$('html, body').animate({ 
      scrollTop: $('#freq_div').offset().top 
  }, 1000);

break;

case 'Annuity' : //if by cause, show cause, hide foundation

$('#freq_div').slideDown();
$('#workers').slideUp();
$('#other_type').slideUp();
$('html, body').animate({ 
      scrollTop: $('#freq_div').offset().top 
  }, 1000);

break;

case 'Lottery' : //if by cause, show cause, hide foundation

$('#freq_div').slideDown();
$('#workers').slideUp();
$('#other_type').slideUp();
$('html, body').animate({ 
      scrollTop: $('#freq_div').offset().top 
  }, 1000);

break;

case 'Worker\'s Compensation' : //if by cause, show cause, hide foundation

$('#workers').slideDown();
$('#other_type').slideUp();
$('#freq_div').slideUp();
$('#lumpsum').slideUp();
$('#bottom').slideUp();
$('.frequency').slideUp();
$('#increase').slideUp();
$('#increase1').slideUp();
$('#increase2').slideUp();
$('#periodic').slideUp();
$('#first_periodic').slideUp();
$('#guaranteed_div').slideUp();
$('#final_payment').slideUp();

$('html, body').animate({ 
      scrollTop: $('#workers').offset().top 
  }, 1000);

break;

case 'Other' : //if by cause, show cause, hide foundation

$('#other_type').slideDown();
$('#freq_div').slideDown();
$('#workers').slideUp();
$('html, body').animate({ 
      scrollTop: $('#other_type').offset().top 
  }, 1000);

break;
}

});


$('input[name="payment_freq"]').click(function() { 

switch ( $(this).val() ) {
    
case 'Periodic Payments' : //if by cause, show cause, hide foundation

$('.frequency').slideDown();
$('#lumpsum').slideUp();
$('#bottom').slideUp();
$('html, body').animate({ 
      scrollTop: $('.frequency').offset().top 
  }, 1000);

break;

case 'Lump Sum Payments' : //if by cause, show cause, hide foundation

$('#lumpsum').slideDown();
$('#bottom').slideDown();
$('.frequency').slideUp();
$('#increase').slideUp();
$('#increase1').slideUp();
$('#increase2').slideUp();
$('#periodic').slideUp();
$('#first_periodic').slideUp();
$('#guaranteed_div').slideUp();
$('#final_payment').slideUp();
$('html, body').animate({ 
      scrollTop: $('#lumpsum').offset().top 
  }, 1000);

break;

case 'Both' : //if by cause, show cause, hide foundation

$('#lumpsum').slideDown();
$('.frequency').slideDown();
$('#bottom').slideUp();
$('html, body').animate({ 
      scrollTop: $('.frequency').offset().top 
  }, 1000);

break;
}

});



$('input[name="payment_frequency"]').click(function() { 

switch ( $(this).val() ) {
    
case 'Monthly' : //if by cause, show cause, hide foundation

$('#periodic').slideDown();
$('#first_periodic').slideDown();
$('#final_payment').slideDown();
$('html, body').animate({ 
      scrollTop: $('#periodic').offset().top 
  }, 1000);

break;

case 'Quarterly' : //if by cause, show cause, hide foundation

$('#periodic').slideDown();
$('#first_periodic').slideDown();
$('#final_payment').slideDown();
$('html, body').animate({ 
      scrollTop: $('#periodic').offset().top 
  }, 1000);

break;

case 'Semi-Annual' : //if by cause, show cause, hide foundation

$('#periodic').slideDown();
$('#first_periodic').slideDown();
$('#final_payment').slideDown();
$('html, body').animate({ 
      scrollTop: $('#periodic').offset().top 
  }, 1000);

break;

case 'Annual' : //if by cause, show cause, hide foundation

$('#periodic').slideDown();
$('#first_periodic').slideDown();
$('#final_payment').slideDown();
$('html, body').animate({ 
      scrollTop: $('#periodic').offset().top 
  }, 1000);

break;
}

});


$('input[name="amount_guarantee"]').click(function() { 

switch ( $(this).val() ) {
    
case 'Yes' : //if by cause, show cause, hide foundation

$('#guaranteed_div').slideDown();
$('#increase').slideDown();
$('#bottom').slideUp();
$('html, body').animate({ 
      scrollTop: $('#guaranteed_div').offset().top 
  }, 1000);

break;

case 'No' : //if by cause, show cause, hide foundation

$('#bottom').slideDown();
$('#guaranteed_div').slideUp();
$('#increase').slideUp();
$('html, body').animate({ 
      scrollTop: $('#bottom').offset().top 
  }, 1000);

break;


}

});

$('input[name="increases"]').click(function() { 

switch ( $(this).val() ) {
    
case 'Yes' : //if by cause, show cause, hide foundation

$('#increase1').slideDown();
$('#increase2').slideDown();
$('#bottom').slideDown();
$('html, body').animate({ 
      scrollTop: $('#increase1').offset().top 
  }, 1000);

break;

case 'No' : //if by cause, show cause, hide foundation

$('#bottom').slideDown();
$('#increase1').slideUp();
$('#increase2').slideUp();
$('html, body').animate({ 
      scrollTop: $('#bottom').offset().top 
  }, 1000);

break;


}

});


});

	$(function() {
		$('#datepicker').datepicker({
			changeMonth: true,
			changeYear: true
		});

	});



	$(document).ready(function() {
// hide all of the elements with a class of \'toggle\'
$('.toggle').hide();

// capture clicks on the toggle links
$('.toggleLink').hover(function() {

// change the link depending on whether the element is shown or hidden

// toggle the display

$(this).parent().next('.toggle').toggle('slow');

// return false so any link destination is not followed
return false;

});

					   
});	
	
	$(function() {
     $("form.jqtransform").jqTransform();
       });
      
$(document).ready(function() {
	$('input[title]').each(function() {
		if($(this).val() === '') {
			$(this).val($(this).attr('title'));	
		}
		
		$(this).focus(function() {
			if($(this).val() == $(this).attr('title')) {
				$(this).val('').addClass('focused');	
			}
		});
		$(this).blur(function() {
			if($(this).val() === '') {
				$(this).val($(this).attr('title')).removeClass('focused');	
			}
		});
	});
/*	$("#submit").click(function(){
		$(".loadImage").html("<img src=\"../img/ajax-loader.gif\" style=\"float:left; margin-left:53px;margin-top:12px; border:none; margin-bottom: 10px;\" />");
        

		var firstName = $("#firstName").val();
        var lastName = $("#lastName").val();
        var email = $("#email").val();
        var phone = $("#phone").val();

       
       

		$(".quoteInputs").load("../includes/process.php",{"firstName" : firstName, "lastName" : lastName, "phone" : phone, "email" : email}, function() {        	
             $(".ch").html("Thank You");
       		$(".quoteInputs").effect("pulsate", { times: 1 }, 1000);
          
		});
        });
*/

});

			   