var $j = jQuery.noConflict();
$j(document).ready(function(){
$j('#container-5').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'normal' });
}); 
$j(document).ready(function(){  
            $j('div.more-views a').lightBox({fixedNavigation:true});
}); 

$j(function() {
  $j('.error').hide();
  $j('input.text-input').css({backgroundColor:"#FFFFFF"});
  $j('input.text-input').focus(function(){
    $j(this).css({backgroundColor:"#FFDDAA"});
  });
  $j('input.text-input').blur(function(){
    $j(this).css({backgroundColor:"#FFFFFF"});
  });

  $j(".button").click(function() {
		// validate and process form
		// first hide any error messages
    $j('.error').hide();
		
	  var name = $j("input#name").val();
		if (name == "") {
      alert($j("label#name_error").text());
      $j("input#name").focus();
      return false;
    }
		var email = $j("input#email").val();
		if (email == "") {
      alert($j("label#email_error").text());
      $j("input#email").focus();
      return false;
    }
		var phone = $j("#phone").val();
		if (phone == "") {
      alert($j("label#phone_error").text());
      $j("#phone").focus();
      return false;
    }
		
		var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone;
		//alert (dataString);return false;
		
		$j.ajax({
      type: "POST",
      url: "http://www.scdcustompergolas.com/contactform/process.php",
      data: dataString,
      success: function() {
        $j('#contact_form').html("<div id='message'></div>");
        $j('#message').html("<h2>Contact Form Submitted!</h2>")
        .append("<span>We will be in touch soon.</span>")
        .hide()
        .fadeIn(1500, function() {
          $j('#message').append("<img id='checkmark' src='images/check.png' />");
        });
      }
     });
    return false;
	});
});
