jQuery(document).ready(function($) {
	
		
	$('#slider').nivoSlider({ //nivoSlider
		animSpeed:1000,
		pauseTime:7000,
		effect: 'fade'
		});
		
	
	$('#signup').submit(function() {
		// update user interface
		$('#response').html('Processing, please wait...');
		
		// Prepare query string and send AJAX request
		$.ajax({
			url: 'http://kingjesusministry.org/wp-content/themes/KingJesusMinistry/includes/subscribe/store-address.php',
			data: 'ajax=true&email=' + escape($('#email').val()),
			success: function(msg) {
				$('#response').html(msg);
			}
		});
	
		return false;
	});

	//Countdown to 10-07-2011 - CAP 2011
	  $(function () {
		  var austDay = new Date();
		  austDay = new Date(austDay.getFullYear(), 10-1, 07);
		  $('#defaultCountdown').countdown({until: austDay});
		  $('#year').text(austDay.getFullYear());
	  });

		

	$("#tip4").click(function() { //Fancybox  
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'			: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			    'wmode'				: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
		return false;
	});
	
	$(".tip4").click(function() { //Fancybox  
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'			: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			    'wmode'				: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
		return false;
	});
	
	
	$("a.pset").fancybox({ //Fancybox  
	});
	
	$("a.myvideo").fancybox({ //Fancybox  
	});
	
	$("a.myslideshow").fancybox({ //Fancybox
	});

	$("a.randomFlickr").fancybox({ //Fancybox  
	});
	
	$("#locations_nav").tooltip({ //tooltip for bottom locations
	// tweak the position
   	offset: [8, 2],
	delay: 300,
	effect: 'slide'
	});
	
	 $('.blink').blink(); // default is 500ms blink interval.
        //$('.blink').blink({delay:100}); // causes a 100ms blink interval.
	
	
	//in field labels	
	$("label").inFieldLabels({ fadeOpacity:0.5 });	

});

