$(document).ready(function(){
    $(document).find('input[name=name]').select();
});
function ToggleForm(Form){
    $(Form).children().each(function(){
        if($(this).children().attr('disabled')){
            $(this).children().attr('disabled',false);
        }else{
            $(this).children().attr('disabled',true);
        }
    });
}
function sendmail(Form){
    ToggleForm(Form);
    $.post('send/',{name:Form.name.value,email:Form.email.value,subject:Form.subject.value,message:Form.message.value},function(data){
        if(data == 1){
            $('#contact').slideUp(function(){
                $(this).html('<span><p>Email sent. Thanks for getting in touch :)</p></span>').slideDown();
            });
        }else{
            alert(data);
            ToggleForm(Form);
        }
    });
    return false;
}
