/* <![CDATA[ */
$(document).ready(function (){

/* var options2 = {
            caption:    false,
            navigation: 'permanent',
            direction:  'left'
        }
        var options3 = {
            caption:    'permanent',
            opacity:    1
        }
        $('#ppy1').popeye();
        $('#ppy2').popeye(options2);
        $('#ppy3').popeye(options3); */

/*    $('#loopedslider').loopedSlider({
            addPagination: true,
            autoStart: 5000
          });*/
		  
		  $('#show div.item').hide();
		  $('#show ul:first').show();
		  
		  $('#photogal a').click(function(){
			var index = $(this).attr('title');
			$('.gallery3').hide();
			$('#show div.item').hide();
			$('#'+index).fadeIn();
		  });
		  
		  $('.gallery3 a').click(function(){
			var index = $(this).attr('title');
			$('.gallery3').hide();
			$('#show div.item').hide();
			$('#'+index).fadeIn();
		  });
		  
		  
          $('#loopedslider .container .slides').cycle({
            /*prev:   '#prev', 
            next:   '#next',*/
            speed:  2000
          });
        
        $(".inline").fancybox({
              'padding'			: 0,
              'autoScale'			: false,
              'transitionIn'		: 'none',
              'transitionOut'		: 'none'
            });        
          
         $(".frame").fancybox({
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'width'				: 668,
				'height'			: 376
			});

		$(".youtube").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'fade',
			'title'			: this.title,
			'width'			: 854,
			'height'		: 505,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			'wmode'				: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});
		return false;
		});
		 
	$(".gallery a span").ready(function(){
    $(".gallery a span").animate({opacity:"0.50",speed:"fast"});
	});
	
	$(".gallery a").hover(function() {
		$(this).find('span').addClass("hover").stop()
			.animate({
        opacity: '0.5'
        
			}, 1000);
		
		} , function() {
		$(this).find('span').removeClass("hover").stop()
			.animate({
        opacity: '1'
			}, 2000);
	});
	
	/* Pajinate Script */
	$('#category').pajinate({
		num_page_links_to_display : 5,
		items_per_page : 18
	});
	
  /*	$("body").ready(function(){
			$("body").animate({opacity:"0.2",speed:"fast"});
			$("body").animate({opacity:"1",speed:"fast"});
		});*/
/*Jquery Fancybox */ 
  $("a[rel=fancypic] ,a[rel=fancypic1] ,a[rel=fancypic2] ,a[rel=fancypic3] ,a[rel=fancypic4] ,a[rel=fancypic5] ,a[rel=fancypic6] ").fancybox({
    'titleShow'		: true,
    'titlePosition': 'inside',
    'transitionIn'	: 'elastic',
    'transitionOut'	: 'elastic'
  });

  
    $("a.fancypic").fancybox({
    'titleShow'		: true,
    'titlePosition': 'inside',
    'transitionIn'	: 'elastic',
    'transitionOut'	: 'elastic'
  });
  
$("a[rel=commercial], a[rel=bw], a[rel=richmond], a[rel=scenic], a[rel=portrait], a[rel=architectural]").fancybox({
  'transitionIn'		: 'elastic',
  'transitionOut'		: 'elastic',
  'titlePosition'		: 'inside',
  'width': '1500%',
	'height': '1500%'
});


            
           
/*Jquery Validator */ 
              jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
    phone_number = phone_number.replace(/\s+/g, ""); 
  return this.optional(element) || phone_number.length > 9 &&
    phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
}, "Please specify a valid phone number");
  jQuery.validator.addMethod("lettersonly", function(value, element) {
    return this.optional(element) || /^[a-z\s]+$/i.test(value);
  }, "Letters only please");  
       $("#Contact_Form").validate({
    rules: {
      NameTxt:{
        required: true,
      lettersonly:true
      },
      EmailTxt: {
        required: true,
        email: true
      },
    /*AddressTxt: "required",
    CityTxt: "required",
    StateTxt: "required",
    ZipTxt: "required",*/
    CountryLst: "required",
    MessageTxt: "required",
    PhoneNum: {
        /*required: true,*/
        phoneUS: true
      },
     FaxNum: {
        /*required: true,*/
        phoneUS: true
      },
      SubjectTxt: "required",
      CaptchaTxt: "required"
    }
  });
  /*end of Jquery Validator */  
      });
/* ]]> */
