// JavaScript Document

    $(function() {  
      $('.error').hide();  
      $(".button").click(function() {  
        // validate and process form here  
          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 phone = $("input#phone").val();  
            if (phone == "") {  
          $("label#phone_error").show();  
          $("input#phone").focus();  
          return false;  
        }  
		
			var inquiry = $("textarea#inquiry").val();  
            if (inquiry == "") {  
          $("label#inquiry_error").show();  
          $("textarea#inquiry").focus();  
          return false;  
			}
		  var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone + '&inquiry=' + inquiry;  
    //alert (dataString);return false;  
    $.ajax({  
      type: "POST",  
      url: "process.php",  
      data: dataString,  
      success: function() {  
        $('#contact_form').html("<div id='message'></div>");  
        $('#message').html("<h2>Contact Form Submitted!</h2>")  
        .append("<p>Thank you and I will be in touch shortly.</p>")  
        .hide()  
        .fadeIn(1500, function() {  
          $('#message');  
        });  
      }  
    });  
    return false;  
      
      });   
    }); 
	
	
	$(window).load(function() {
	$('#slider').css('display','block'); 
    $('#slider').nivoSlider({
        effect: 'random', // Specify sets like: 'fold,fade,sliceDown'
        slices: 15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed: 300, // Slide transition speed
        pauseTime: 5000, // How long each slide will show
        startSlide: 0, // Set starting Slide (0 index)
        directionNav: true, // Next and Prev navigation
        directionNavHide: false, // Only show on hover
        controlNav: false, // 1,2,3... navigation
        controlNavThumbs: false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel: false, // Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', // Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
        keyboardNav: true, // Use left and right arrows
        pauseOnHover: true, // Stop animation while hovering
        manualAdvance: false, // Force manual transitions
        captionOpacity: 0.8, // Universal caption opacity
        prevText: 'Prev', // Prev directionNav text
        nextText: 'Next', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
});



