// setup audio player
AudioPlayer.setup("http://speak.fm/player.swf", {
    width: 1,
    noinfo: "yes",
    initialvolume: 100,
    animation: "yes",
    loader: "006990",
});

// for contact form
$(document).ready(function() {
    // embed audio player
    AudioPlayer.embed("demo_player", {
        soundFile: "http://speak.fm/speakfmdemo.mp3",
        
    });
    
    
    $('#email').addClass('idle_field');
    
    // on focus
    $('#email').focus(function() {
        $(this).removeClass('idle_field').addClass('focus_field');
        if (this.value == this.defaultValue) {
            this.value = '';
        } else {
            this.select();
        }
    });
    
    // on blur
    $('#email').blur(function() {
        if (this.value == '') {
            this.value = this.defaultValue;
            $(this).removeClass('focus_field').addClass('idle_field');
        }
    });
    
    
    $('#contact_form').ajaxForm(function(data) {
        if (data == 1) {
            $('#success').fadeIn("slow");
            $('#contact_form').resetForm();
        } else if (data == 2) {
            $('#badserver').fadeIn("slow");
        } else if (data == 3) {
            $('#bademail').fadeIn("slow");
        }
    });
});
