jQuery(document).ready(function(){

// < CAPTCHA feedback
var url = window.location.pathname;
var filename = url.substring(url.lastIndexOf('/')+1);
if(filename == 'retry-captcha')
	jQuery('#contact-validate').focus(); // Auto-select the captcha for them to try again
// CAPTCHA feedback >

// < Auto-format text input for structured data
	jQuery('input[name="phone"]').mask('(999) 999-9999');
// Auto-format text input for structured data >

// < Fancybox
	jQuery('.hentry a[href*=".jpg"],.hentry a[href*=".png"]').attr('rel','lightbox'); // Group lightbox images together so they can be navigated using Fancybox's left/right navigation
	jQuery('.hentry a[href*=".jpg"],.hentry a[href*=".png"]').fancybox({
		'transitionIn': 'elastic',
		'transitionOut': 'elastic',
		'easingIn': 'easeOutCirc',
		'easingOut': 'easeInCirc',
		'cyclic': true
	});
// Fancybox >

// < IE Drop Down Support
	jQuery('#nav li').hover(function(){
		jQuery(this).addClass('sfhover');
	},function(){
		jQuery(this).removeClass('sfhover');
	});
// IE Drop Down Support >

// < Input Placeholder
	jQuery('input[type=text]:not(".un-placeholder"),textarea:not(".un-placeholder"),.text-input:not(".un-placeholder"),textarea:not(".un-placeholder")').addClass('placeholder').each(function(){
		jQuery(this).attr('defaultValue',jQuery(this).val());
	});
	jQuery('input[type=text],textarea,.text-input').focus(function(){
		if(jQuery(this).hasClass('placeholder') && jQuery(this).val() == jQuery(this).attr('defaultValue')){
			jQuery(this).val('');
		}
	});
	jQuery('input[type=text],textarea,.text-input').focus(function(){
		jQuery(this).removeClass('placeholder');
	});
	jQuery('input[type=text],textarea,.text-input').blur(function(){
		if(jQuery(this).val() == ''){
			jQuery(this).val(jQuery(this).attr('defaultValue'));
			jQuery(this).addClass('placeholder');
		}
	});
// Input Placeholder >
});
