Cufon.replace('#menu-sub-menu > li > a', { fontFamily : 'Impact', hover : { color: '#b50144' } });
Cufon.replace('.box-nav ul li a', { fontFamily : 'Impact', hover : { color: '#b50144' } });
Cufon.replace('.dropdown a', { fontFamily : 'Impact', hover : { color: '#999999' } });

Cufon.replace('.contacts h3, .contacts h4', { fontFamily : 'Impact' });
Cufon.replace('#footer .col h3 a', { fontFamily : 'Impact', hover : { color: '#C95A2E' } });
Cufon.replace('.box-head h2, .box-head2 h2', { fontFamily : 'Impact' });
Cufon.replace('.fan_box .name_block', { fontFamily: 'Impact'});
Cufon.replace('.box-countdown h2, .box-featured h3', { fontFamily : 'Impact' });
Cufon.replace('.box-nav ul li a, .box-facebook h3', { fontFamily : 'Impact' });
Cufon.replace('.box-news h3', { fontFamily : 'Impact' });
Cufon.replace('.box-video-player .title span', { fontFamily : 'Impact' });
Cufon.replace('.box-video-cat .info h2', { fontFamily : 'Impact' });
Cufon.replace('.request-form h3, .tabs ul li a', { fontFamily : 'Impact' });
Cufon.replace('.news-holder h2, .some-info h2, .tab-body h4', { fontFamily : 'Impact' });

(function($) {
	$(document).ready(function() {
		$('.entries div.event:last-child').addClass('last');
		$('#menu-main-menu > li:last').addClass('last');
		$('.prayer-form').submit(function() {
			var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
			var ok = true;
			$(this).find('.blink').each(function() {
				if ($(this).val() == '' || $(this).val() == $(this).attr('title') || ($(this).attr('name') == 'cmail' && !$(this).val().match(reg)) ) {
					switch($(this).attr('name')) {
						case 'cname':
							alert('Please enter your name!');
							break;
						case 'cmail':
							alert('Please enter your valid email address!');
							break;
						case 'cphone':
							alert('Please enter your phone number!');
							break;
						case 'cmsg':
							alert('Please enter your prayer request!');
							break;
					}
					ok = false;
					$(this).focus();
					return false;
				};
			});
			return ok;
		});
		$('.get-connected-form').submit(function() {
			var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
			var ok = true;
			$(this).find('.blink').each(function() {
				if ($(this).val() == '' || $(this).val() == $(this).attr('title') || ($(this).attr('name') == 'cmail' && !$(this).val().match(reg)) ) {
					switch($(this).attr('name')) {
						case 'cname':
							alert('Please enter your name!');
							break;
						case 'cmail':
							alert('Please enter your valid email address!');
							break;
						case 'cphone':
							alert('Please enter your phone number!');
							break;
						case 'cmsg':
							alert('Please tell us how would you like to help!');
							break;
					}
					ok = false;
					$(this).focus();
					return false;
				};
			});
			return ok;
		});
		$('.box-newsletter form').submit(function() {
			var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
			var ok = true;
			$(this).find('.blink').each(function() {
				if ($(this).val() == '' || $(this).val() == $(this).attr('title') || ($(this).attr('name') == 'from' && !$(this).val().match(reg)) ) {
					switch($(this).attr('name')) {
						case 'name':
							alert('Please enter your name!');
							ok = false;
							return false;
						case 'from':
							alert('Please enter your valid email address!');
							ok = false;
							return false;
					}
					ok = false;
					$(this).focus();
					return false;
				};
			});
			return ok;
		});
	});
		
	$(function() {
		// nav
		$(".sub-nav .sub-menu li:last-child").addClass('last');
		$(".sub-nav .sub-menu").wrap('<div class="dd"><div class="dd-c">');
		$(".dd").prepend('<div class="dd-t"></div>');
		$(".sub-nav ul li").hover(function() {
			$(this).css({ 'z-index' : 100 });
			$(this).find(".dd").show();
			$(this).find("a:eq(0)").addClass('hover');
		}, function() {
			$(this).css({ 'z-index' : 1 });
			$(this).find(".dd").hide();
			$(this).find("a:eq(0)").removeClass('hover');
			Cufon.replace('.sub-nav > ul > li > a', { fontFamily : 'Impact', hover : { color: '#b50144' } });
		});
		// focus
		$('.blink')
			.focus(function(){
				if( $(this).val() == $(this).attr('title') ) {
					$(this).val('');
				}
			})
			.blur(function(){
				if( $(this).val() == '' ) {
					$(this).val( $(this).attr('title') );
				}
			});
		
		// btn hover
		$('.submit-form .button, .box-newsletter .button, .request-form .button').hover(function () {
			$(this).addClass('hover');
		}, function () {
			$(this).removeClass('hover');
		});
		
		$('#media-gallery .item').hover(function() {
			$(this).addClass('active');
		}, function() {
			$(this).removeClass('active');
		});
		
		// slider
		$('.slider').jcarousel( {
			initCallback: slider_initCallback,
			scroll: 1,
			wrap: 'both',
			// This tells jCarousel NOT to autobuild prev/next buttons
			buttonNextHTML: null,
			buttonPrevHTML: null
		});
		
		// dropdown
		$('.dropdown .head').click(function () {
			$('.dropdown ul').slideToggle();
			return false;
		});
		$('.dropdown ul a').click(function () {
			$('.dropdown .head').text($(this).text());
			$(this).parents('ul').slideToggle();
			Cufon.replace('.dropdown a', { fontFamily : 'Impact', hover : { color: '#999999' } });
		});
		
		// tabs
		$('.tab-body').addClass('hide');
		$('.tab-body:eq(0)').removeClass('hide');
		$('.tabs ul li a').click(function () {
			$('.tab-body').addClass('hide');
			var index = $('.tabs ul li a').index($(this));
			$('.tab-body').eq(index).removeClass('hide');
			
			$('.tabs ul li a').removeClass('active');
			$(this).addClass('active');
			
			return false;
		});
	});
	
	function slider_initCallback (carousel) {
		$(".prev").click(function () {
			carousel.prev();
			return false;
		});
		
		$(".next").click(function () {
			carousel.next();
			return false;
		});
	}
	
})(jQuery)

