$(document).ready(function(){
	$('#submitbtn').click(function() {
		
		$('#waiting').show(500);
		$('#fpnews').hide(0);
		$('#message').hide(0);
		
		$.ajax({
			type : 'POST',
			url : 'php/emailgrab.php',
			dataType : 'json',
			data: {
				email : $('#email').val()
			},
			success : function(data){
				$('#waiting').hide(500);
				$('#message').removeClass().addClass((data.error === true) ? 'error' : 'emailsuccess')
					.text(data.msg).show(500);
				if (data.error === true)
					$('#fpnews').show(500);
			},
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				$('#waiting').hide(500);
				$('#message').removeClass().addClass('error')
					.text('There was an error.').show(500);
				$('#fpnews').show(500);
			}
		});
		
		return false;
	});
});

jQuery(function($){
		
			// get public API from slider
			var api = $(".peKenBurns").peKenburnsSlider({api:true})
			
			// bind to button click
			$(".sldrbtn").click(apiHandler)
			
			function apiHandler(e) {
				switch (e.currentTarget.id) {
					case "1":
						api.show(1)
					break;
					case "2":
						api.show(2)
					break;
					case "3":
						api.show(3)
					break;
					case "4":
						api.show(4)
					break;
					case "5":
						api.show(5)
					break;
					case "6":
						api.show(6)
					break;
					case "7":
						api.show(7)
					break;
					case "8":
						api.show(8)
					break;
					case "9":
						api.show(9)
					break;
					case "10":
						api.show(10)
					break;
					case "11":
						api.show(11)
					break;
					case "12":
						api.show(12)
					break;
					case "13":
						api.show(13)
					break;
				}
				return false;
			}
			
		})

function doClear(theText) 
{
if (theText.value == theText.defaultValue) 
{
theText.value = ""
}
}
