/* <![CDATA[ */
function onBlur(el) {
    if (el.value == '') {
        el.value = el.defaultValue;
    }
}
function onFocus(el) {
    if (el.value == el.defaultValue) {
        el.value = '';
    }
}
 
 
 /* Cufon Script - Font Image Replacement*/
 /* 
 Cufon.replace('#header #navi', {
  fontFamily: 'TrajanPro',
  color: '-linear-gradient(#666666,#4C4C4C,#333333)',
  textShadow: '1px 1px #fff'
});
 */
  $(document).ready(function (){
  
  $(".fvideo").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
		return false;
  });
  
  
$('.articles div').hide();
	$('.leftimg a').click(function(){
		var index = $(this).attr('rel');
		
	$('.articles div').hide();
		$("."+index).fadeIn();
	});
	
//$('.myclass:eq(1)')
var left = 353;
var position = $('.active').position();
/*if(position.left != null){
var width = $('.active').width();
 width = width + 15 + "px";
 left = left + position.left + "px";
$("#linker").animate({left :left, width:width,speed:"fast" } );
}*/
$("#header #navi li a").hover(function(){
	left = 353;
	var position = $(this).position();
	var width = $(this).width();
	width = width + 15 + "px";
	left = left + position.left + "px";
	$("#linker").animate({left :left, width:width }, 500);
},function(){
	$("#linker").stop();
});	

	$(".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 : 4	
	});
	
  	$("body").ready(function(){ 
			$("body").animate({opacity:"0.2",speed:"fast"});
			$("body").animate({opacity:"1",speed:"fast"}, function(){
					$('dl:eq(0)').animate({opacity:1}, 600, function(){ 
												$('dl:eq(1)').animate({opacity:1}, 1000, function(){
																				$('dl:eq(2)').animate({opacity:1}, 1200);				  
																								  });	
												
												});												   
			});
		
			
			
		});
	
	
/*Jquery Fancybox */ 
  $(".fancypic").fancybox({
    'titleShow'		: false,
    'transitionIn'	: 'elastic',
    'transitionOut'	: 'elastic'
  });
/*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");  
       $("#quickForm").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"
    }
  });
  /*Jquery Validator */  
    
      });
/* ]]> */
