// remap jQuery to $
(function($){})(window.jQuery);


/* trigger when page is ready */
$(document).ready(function (){

	
	/* Contact Form UX enhancements */
	/*------------------------------*/
	
	// Set focus on the first name field
    $("#Name").focus().addClass('focus').siblings('label').addClass('focus');

    // Highlight active input
    $('form input, form select, form textarea, form input').bind("focus", function () {
        var field = $(this);
        field.addClass('focus').siblings('label').addClass('focus');
    }).bind("blur", function () {
       $('.focus').removeClass('focus');
    });
   
    // Display the Other box if the user selects other for their referral source
    $("#Found").bind("click", function () {
        var field = $(this);
        if (field.val() == "Other") {
            $('#FoundNote').removeClass('hidden').show('fast').addClass('visible').addClass('focus').siblings('label').addClass('focus');
            $('#FoundNote').focus().addClass('focus');
        } else {
            $('#FoundNote').hide('fast').removeClass('visible');
        }
    });

 
    $(".home-services ul").tabs(".item", {
        // enable "cross-fading" effect
        effect: 'fade',
        fadeOutSpeed: 'fast',
        event: 'mouseover',
        // start from the beginning after the last tab
        rotate: true
        // use the slideshow plugin. It accepts its own configuration
    }).slideshow({autoplay: true, interval: 5000, clickable: false});

    // Add date picker to date/time elements
    $(":date").dateinput();
});


/* optional triggers

$(window).load(function() {
	
});

$(window).resize(function() {
	
});

*/
