// JavaScript Document
		
		function slideSwitch() {
			var active = $('#slideshow IMG.active');
		
			if ( active.length == 0 ) active = $('#slideshow IMG:last');
		
			// use this to pull the images in the order they appear in the markup
			var next =  active.next().length ? active.next()
				: $('#slideshow IMG:first');
		
			active.addClass('last-active');
		
			next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					active.removeClass('active last-active');
				});
		}
		
		$(function() {
			setInterval( "slideSwitch()", 4500 );
		});
		
		function slideSwitch1() {
			var active = $('#slideshow1 IMG.active');
		
			if ( active.length == 0 ) active = $('#slideshow1 IMG:last');
		
			// use this to pull the images in the order they appear in the markup
			var next =  active.next().length ? active.next()
				: $('#slideshow1 IMG:first');
		
			active.addClass('last-active');
		
			next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					active.removeClass('active last-active');
				});
		}
		
		$(function() {
			setInterval( "slideSwitch1()", 5000 );
		});
		
		function slideSwitch2() {
			var active = $('#slideshow2 IMG.active');
		
			if ( active.length == 0 ) active = $('#slideshow2 IMG:last');
		
			// use this to pull the images in the order they appear in the markup
			var next =  active.next().length ? active.next()
				: $('#slideshow2 IMG:first');
		
			active.addClass('last-active');
		
			next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					active.removeClass('active last-active');
				});
		}
		
		$(function() {
			setInterval( "slideSwitch2()", 4800 );
		});
		
		function slideSwitch3() {
			var active = $('#slideshow3 IMG.active');
		
			if ( active.length == 0 ) active = $('#slideshow3 IMG:last');
		
			// use this to pull the images in the order they appear in the markup
			var next =  active.next().length ? active.next()
				: $('#slideshow3 IMG:first');
		
			active.addClass('last-active');
		
			next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					active.removeClass('active last-active');
				});
		}
		
		$(function() {
			setInterval( "slideSwitch3()", 4000 );
		});
		
		function slideSwitch4() {
			var active = $('#slideshow4 IMG.active');
		
			if ( active.length == 0 ) active = $('#slideshow4 IMG:last');
		
			// use this to pull the images in the order they appear in the markup
			var next =  active.next().length ? active.next()
				: $('#slideshow4 IMG:first');
		
			active.addClass('last-active');
		
			next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					active.removeClass('active last-active');
				});
		}
		
		$(function() {
			setInterval( "slideSwitch4()", 6000 );
		});
		
		function slideSwitch5() {
			var active = $('#slideshow5 IMG.active');
		
			if ( active.length == 0 ) active = $('#slideshow5 IMG:last');
		
			// use this to pull the images in the order they appear in the markup
			var next =  active.next().length ? active.next()
				: $('#slideshow5 IMG:first');
		
			active.addClass('last-active');
		
			next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					active.removeClass('active last-active');
				});
		}
		
		$(function() {
			setInterval( "slideSwitch5()", 3500 );
		});
		
		function slideSwitch6() {
			var active = $('#slideshow6 IMG.active');
		
			if ( active.length == 0 ) active = $('#slideshow6 IMG:last');
		
			// use this to pull the images in the order they appear in the markup
			var next =  active.next().length ? active.next()
				: $('#slideshow6 IMG:first');
		
			active.addClass('last-active');
		
			next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					active.removeClass('active last-active');
				});
		}
		
		$(function() {
			setInterval( "slideSwitch6()", 5500 );
		});
		
		$(function() {
        	$('.outer2 a').lightBox();
			$('.outer3 a').lightBox();
			$('#carousel1 a').lightBox();
			$('#cLB1').lightBox();
			$('#cLB2').lightBox();
			$('#cLB3').lightBox();
			$('#cLB4').lightBox();
			$('#cLB5').lightBox();
			$('#cLB6').lightBox();
			$('#cLB7').lightBox();
			$('#cLB8').lightBox();
			$('#cLB9').lightBox();
			$('#cLB10').lightBox();
			$('#cLB11').lightBox();
			$('#cLB12').lightBox();
			$('#cLB13').lightBox();
			$('#cLB14').lightBox();
			$('#cLB15').lightBox();
			$('#cLB16').lightBox();
			$('#cLB17').lightBox();
			$('#cLB18').lightBox();
			$('#cLB19').lightBox();
			$('#cLB20').lightBox();
			$('#cLB21').lightBox();
			$('#cLB22').lightBox();
		});
		
		function checkFields(which) {
		var val = which.value;
		var nme = which.name;
		if (val.length <= 2 || val == '' || val == null) {
			document.getElementById(nme).style.borderColor = 'red';
		}
		else {
			document.getElementById(nme).style.borderColor = '#000000';
		}
	}
	
	function checkForm() {
		var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;

		if (document.forms['pkContact']['name'].value.length <= 2 || document.forms['pkContact']['name'].value == '' || document.forms['pkContact']['name'].value == null) {
			document.forms['pkContact']['name'].style.borderColor = 'red';
			document.getElementById('status').innerHTML = 'Please enter a valid name';
		}
		else {
			document.forms['pkContact']['name'].style.borderColor = '#00FF00';
			if (document.forms['pkContact']['email'].value.length <= 2 || document.forms['pkContact']['email'].value == '' || document.forms['pkContact']['email'].value == null || document.forms['pkContact']['email'].value.search(emailRegEx)) {
			document.forms['pkContact']['email'].style.borderColor = 'red';
			document.getElementById('status').innerHTML = 'Please enter a valid email address';
			}
			else {
				document.forms['pkContact']['email'].style.borderColor = '#00FF00';
				if (document.forms['pkContact']['phone'].value.length != 10 || document.forms['pkContact']['phone'].value == '' || document.forms['pkContact']['phone'].value == null || isNaN(document.forms['pkContact']['phone'].value))  {
					document.forms['pkContact']['phone'].style.borderColor = 'red';
					document.getElementById('status').innerHTML = 'Please use only numbers';
				}
				else {
					document.forms['pkContact']['phone'].style.borderColor='#00FF00';
					if (document.forms['pkContact']['comments'].value.length <= 2 || document.forms['pkContact']['comments'].value == '' || document.forms['pkContact']['comments'].value == null || document.forms['pkContact']['comments'].value == 'Type Comments Here') {
			document.forms['pkContact']['comments'].style.borderColor = 'red';
			document.getElementById('status').innerHTML = 'Please enter comments';
					}
					else {
						document.forms['pkContact']['comments'].style.borderColor = '#00FF00';
						$.ajax({
							   type: "POST",
							   url: "formMailer.php", 
							   data: "name="+$('#name').val()+"&email="+$('#email').val()+"&phone="+$('#phone').val()+"&comments="+$('#comments').val(),
							   success:function(msg){
    								$('#status').html(msg);
									$('#name').val("Philip Kessler");
									$('#email').val("philkphotos@gmail.com");
									$('#phone').val("2127217388");
									$('#comments').val("Thank you for your email, I will contact you as soon as possible.");
  								}
						});
					}
				}
			}
		}
	}
	
	function changeQuote(quo) {
				$('#quot').html('<p>'+quotes[quo]+'</p>');
				$('#testimImg').html('<img src="http://www.menacewebdesign.com/philKess/images/testimonials/testimonials'+quo+'.jpg" alt="Testimonials" style="border: 1px solid #000000;" />');
	}
