 $(document).ready(function() {



$("div.give_gift_monthly").css("display","none");


// Sets the style for Minsitry Gift Tabs

	$("li.one_time a").addClass("active");
	
	$("li.monthly a").click(function () { 
	  
		 $("li.monthly a").addClass("active");
	
		 $("li.one_time a").removeClass("active");
	  
		 $("div.give_gift_one_time").fadeOut(function () { 
		 
			 $("div.give_gift_monthly").fadeIn(); 
	  
			 });
	    });


	$("li.one_time a").click(function () { 
	  
		 $("li.one_time a").addClass("active");
	
		 $("li.monthly a").removeClass("active");
	  
		 $("div.give_gift_monthly").fadeOut(function () { 
		 
			 $("div.give_gift_one_time").fadeIn(); 
	  
			 });
	    });


// Creates Check extension

	jQuery.fn.extend({
		check: function() {
		return this.each(function() { this.checked = true; });
		},
		uncheck: function() {
		return this.each(function() { this.checked = false; });
		}
	});

 

// Below Unchecks Products when they don't apply


	$("div.left_col input.one_time").click(function () {
					
			$("div.give_gift_monthly input.checkbox").uncheck();	
	
		});
	
	$("div.left_col input.monthly").click(function () {
	
			$("div.give_gift_one_time input.checkbox").uncheck();	
	
		});
	
	
	$("div.give_gift_one_time input.checkbox").click(function() {
			
			$("div.give_gift_monthly input.checkbox").uncheck();	
	
				if ($("div.give_gift_one_time input.checkbox:checked").val()=='on') {
				
					$("div.left_col input.one_time").check();
				
				};
			
		});
	
	$("div.give_gift_monthly input.checkbox").click(function() {
	
			$("div.give_gift_one_time input.checkbox").uncheck();
	
			if ($("div.give_gift_monthly input.checkbox:checked").val()=='on') {
				
					$("div.left_col input.monthly").check();
				
				};
				
		});

 
});


