$(document).ready(function() {


        var options2 = {
            caption:    false,
            navigation: 'permanent',
            direction:  'left'
        }
        var optionsL = {
            caption:    'permanent',
            opacity:    1,
            direction:  'left'
        }
        var optionsR = {
            caption:    'permanent',
            opacity:    1,
            direction:  'right'
        }
    
//        $('#ppy1').popeye();
//        $('#ppy2').popeye(options2);
        $('.viewR').popeye(optionsR);
        $('.viewL').popeye(optionsL);

$('body').nivoZoom();


//// *** AJAX *** ////  
   
    // Form submissions
	$(".submitform").click( function() {
	
		// Set this for use later
		var $this = $(this);
		
		var name = $("input#name").val(); 
		var email = $("input#email").val(); 
		var subject = $("input#subject").val(); 
		var message = $("textarea#message").val(); 
		
		// Grab deleting information
		var dataString = 'name='+ name + '&email=' + email + '&subject=' + subject + '&message=' + message;  
//   		var dataString = 'info=' + $this.attr("title");
			
		$.ajax({
			type: "POST",
			url: "ajax/sendmail.php",
			data: dataString,
			success: function(data){
				// Add the filename to the confirm message
				$('.messages').html(data);
				if(data == '<div class="success">Thank you for the email. I look forward to reading it..</div>'){
				$("input#name").val(''); 
				$("input#email").val(''); 
				$("input#subject").val(''); 
				$("textarea#message").val(''); 
			};
			}
		});
	});


});
