﻿/// <reference path="~/Scripts/Soapi.min-vsdoc.js" />
/// <reference path="~/Scripts/jquery-1.4.4-vsdoc.js" />

$(function () {
    if (!$.browser.msie || ($.browser.msie && $.browser.version >= 9)) {
        $('head').append('<link href="/_css/ff.css" rel="stylesheet" />');
    }

    $('a[rel=external]').click(function () {
        window.open($(this).attr('href'));
        return false;
    });
    $('.contact, #contact_link').click(function () {
        $.scrollTo('footer', 800, { onAfter: function () {
            $('#email_form').find('input').first().focus();
        }
        });
        return false;
    });
    $('#send').click(function () {
        var $emailForm = $('#email_form');
        var data = {
            'name': $emailForm.find('[name=name]').val(),
            'email': $emailForm.find('[name=email]').val(),
            'message': $emailForm.find('[name=message]').val()
        };
        $.post('/home/sendemail', data);
        $emailForm.fadeOut('slow', function () {
            $('#email_success').fadeIn('slow');
        });
        return false;
    });
    $('input, textarea').bind('focus blur', function () {
        $(this).toggleClass('highlight');
    });
});
