$(document).ready(function(){
//	$("ul#navigation li.current_page_item a, ul#navigation li.page_item a").pir({font: "ComfortaaB.ttf", wrap: true});
$.reject({
	reject: { 
		msie: false, msie5: true, msie6: true, msie7: true, msie8: false, // MSIE Flags (Global, 5-8) 
		firefox: false, firefox1: true, firefox2: true, firefox3: false, // Firefox Flags (Global, 1-3) 
		konqueror: false, konqueror1: true, konqueror2: true, konqueror3: false, // Konqueror Flags (Global, 1-3) 
		chrome: false, chrome1: true, chrome2: false, chrome3: false, chrome4: false, // Chrome Flags (Global, 1-4) 
		safari: false, safari2: true, safari3: false, safari4: false, // Safari Flags (Global, 1-4) 
		opera: false, opera7: true, opera8: true, opera9: true, opera10: false, // Opera Flags (Global, 7-10) 
		gecko: false, webkit: false, trident: false, khtml: false, presto: false, // Rendering Engines (Gecko, Webkit, Trident, KHTML, Presto) 
		win: false, mac: false, linux : false, solaris : false, iphone: false, // Operating Systems (Win, Mac, Linux, Solaris, iPhone) 
		unknown: false // Unknown covers everything else 
	},
		closeCookie: true // Set cookie to remmember close for this session
});

//Important Announcements banner
$('ul#important').innerfade({
	animationtype: 'fade',
	speed: 1000,
	timeout: 4000,
	type: 'random_start',
	containerheight: '40px',
	runningclass: 'innerfade'
});
$('ul#important').css({'display' : ''});

//Pulse the important banner
$('ul#important li a').pulse({
	backgroundColor: ['red', 'green'],
    opacity: [0,1]
}, {
    duration: 1000, // duration of EACH individual animation
    times: 4, // Will go three times through the pulse array [0,1]
    easing: 'linear', // easing function for each individual animation
    complete: function() {
        //alert("I'm done pulsing!");
	}
});



//Banner fader
//$('ul#banner').innerfade({
//	animationtype: 'fade',
//	speed: 1000,
//	timeout: 8000,
//	type: 'random_start',
//	containerheight: '458px',
//	runningclass: 'innerfade'
//});
//$('ul#banner').css({'display' : ''});


//Watermark for the search box
$('#s').watermark('Search', {className: 'searchwatermark'});

//Rounded Corners
/*$('#footer').corner('bottom', '10px');
$('.footer-column').corner('10px');
$('.firefox .sf-menu li').corner('top','10px');
$('.firefox .sf-menu li ul li').uncorner();
$('.firefox .sf-menu li ul li:last-child').corner('bottom','10px');
$('.firefox .sf-menu li ul li ul li:last-child').uncorner();
$('.firefox .sf-menu li ul li ul li:first-child').corner('tr','10px');
$('.firefox .sf-menu li ul li ul li:last-child').corner('br','10px');
$('.firefox .sf-shadow ul').corner('10px');
$('.moduleBody').corner('top','10px');
$('.moduleFooter').corner('bottom','10px');
$('#page #content .video').corner('10px');
$('#page #content .video .wordtube').corner('7px');
$('#page #content .nook .nookImage').corner('7px');
$('.confirmation').corner('7px');
$('ul#important li').corner('10px');
*/

//Begin Superfish Menu
$('ul.sf-menu').superfish({ 
		delay:       1200,                             // one second delay on mouseout 
		animation:   {opacity:'show', height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                           // faster animation speed 
		autoArrows:  false,                             // disable generation of arrow mark-up 
		dropShadows: true                              // disable drop shadows 
	}); 
//End Superfish Menu

//Begin LazyLoad images
	$('img').lazyload({ 
		placeholder : 'images/grey.gif',
		effect : 'fadeIn'
	});
//End LazyLoad

//Begin Activebar2
	if ( $.browser.msie6 ) { 
		$('<div></div>').html('This page may not be displayed correctly in this browser. You are strongly encouraged to update to a current release of <a href="http://mozilla.org/firefox">Firefox</a>')
			.activebar({
				'font': 'Verdana',
				'fontSize':'14px',
				'icon': 'http://www.tgrayimages.com/wp-content/themes/tg2/images/activebar-information.png',
				'button':'http://www.tgrayimages.com/wp-content/themes/tg2/images/activebar-closebtn.png',
				'url': 'http://mozilla.org/firefox'
			});
		}
//End Activebar2

//begin contact form
	$('.error').hide();
	$('input.text-input').css({backgroundColor:"#FFFFFF"});

	$('input.text-input').focus(function(){
		$(this).css({backgroundColor:"#cffdbd"});
	});
	$('input.text-input').blur(function(){
		$(this).css({backgroundColor:"#FFFFFF"});
	});
	
	// validate and process form
  $(".contactbutton").click(function() {
		// first hide any error messages
		$('.error').hide();
		
		var name = $("input#name").val();
		if (name == "") {
			$("label#name_error").show();
			$("input#name").focus();
			return false;
		}
		var email = $("input#email").val();
		if (email == "") {
			$("label#email_error").show();
			$("input#email").focus();
			return false;
		}
		var message = $("textarea#message").val();
			if (message == "") {
			$("label#message_error").show();
			$("input#message").focus();
			return false;
		}
		
		var dataString = $("form").serialize();
		//alert (dataString);return false;
		
		$.ajax({
			type: "POST",
			url: "http://desotohillsbaptist.com/wp-content/themes/dhbc5/js/processcontactform.php",
			data: dataString,
			success: function() {
				$('#contact').slideUp();
				$('#messages').show()
				.append("<h2>Your message has been sent!</h2><h2>Thank You!</h2>")
				.hide()
				.fadeIn(1500);
			}
		});
		return false;
	});
//end contact pricing form


	$('#commentform input').focus(function(){
		$(this).css({backgroundColor:"#cffdbd"});
	});
	$('#commentform input').blur(function(){
		$(this).css({backgroundColor:"#FFFFFF"});
	});
	
	$('#commentform textarea').focus(function(){
		$(this).css({backgroundColor:"#cffdbd"});
	});
	$('#commentform textarea').blur(function(){
		$(this).css({backgroundColor:"#FFFFFF"});
	});

}); 