$(function () {
        $('#delay-load').jail({callback : function(){ $('body').css('background-image', "url('" + $('#delay-load').attr('src') + "')"); }});
        $('#menu-menu a').text('');
        $('#facebook-link').feedback({ position: 'left' });
        $('#twitter-link').feedback();
	var jqTranformPath='/wp-content/themes/eyedentity/images/jqtransform';
	$('h1:contains("eyedentity "),h2:contains("eyedentity "),h3:contains("eyedentity "),h4:contains("eyedentity "),p:contains("eyedentity "),h1:contains(" eyedentity"),h2:contains(" eyedentity"),h3:contains(" eyedentity"),h4:contains(" eyedentity"),p:contains(" eyedentity")').each(function() { $(this).html($(this).html().replace('eyedentity','<span class="brand-eye">eye</span><span class="brand-dentity">dentity</span>')) });
	$('#slideshow-holder').jqFancyTransitions({ effect: 'wave', width: 450, height: 300, delay: 10000 });	
	$("#contact_phone").mask("999-999-9999"); 
	$("form.wpcf7-form").jqTransform({ imgPath: jqTranformPath }); 
	$("form.wpcf7-form").validate({ 
		errorClass: "invalid", 
		highlight: function (a, b) { 
			$(a).addClass(b) 
		} 
	}); 
	$("form.wpcf7-form").ajaxForm({ 
		beforeSubmit: function (a, b, c) { 
			var d = $(b).valid(); 
			if (!d) { 
				alert("Please include your Name, Email and a Brief Message, Phone Number Optional.") 
			} 
			return d 
		}, 
		success: function (a, b, c, d) { 
			alert("Your message has been sent.  Please allow 24 hours for one of our staff to contact you.\r\n\r\nTo book an appointment, you can also call during office hours."); 
			$("form.wpcf7-form").resetForm() 
		}, 
		error: function (a, b, c, d) { 
			alert("Sorry there was a problem sending the message.  Please try again or contact us directly at 647.345.3833.") 
		} 
	});
});
