/**
 * Author: Sean Dooley
 **/
$(document).ready(function () {
    $('#primary-navigation').superfish({
        animation: { height: 'show' },
        autoArrows: false,
        dropShadows: false,
        speed: 'fast'
    });

    $('#slideshow').css('overflow', 'hidden');
    $('#slides').before('<ul id="nav-controls"><li id="prev"><a href="#">prev</a></li><li id="next"><a href="#">next</a></li>').before('<ol id="nav-paging">').cycle({
        fx: 'fade',
        pager: '#nav-paging',
        prev: '#prev',
        next: '#next',
        timeout: 10000,
        pagerAnchorBuilder: function (idx, slide) {
            return '<li><a href="#">' + idx + '</a></li>';
        }
    });

    if (document.getElementById('contact-form')) {
        $("#aspnetForm").validate({
            rules: {
                'name': { required: true },
                'email': { required: true, email: true },
                'message': { required: true }
            }/*,
            submitHandler: function (form) {
                var href = $(location).attr('href');
                var content = "name=" + $('#name').val() + "&email=" + $('#email').val() + "&message=" + $('#message').val();

                $.fancybox.showActivity();
                $.ajax({
                    type: "POST",
                    url: href,
                    data: content,
                    success: function (msg) {
                        $.fancybox(
		                    '<h2 class="heading">Contact Us</h2><p>Thank you for your enquiry.</p>',
		                    {
		                        'autoDimensions': false,
		                        'width': 350,
		                        'height': 'auto',
		                        'transitionIn': 'none',
		                        'transitionOut': 'none'
		                    }
	                    );
                    }
                });
            }*/
        });
    }
});
























