﻿
Cufon.replace('h1, h2, h3, h4, h5, h6, .dropcap, .dropcap2');



//$(document).ready(function () {
//    zoombox.FLVPlayer = "style/js/zoombox/FLVplayer.swf",   // URL of the FLV Player
//zoombox.MP3Player = "style/js/zoombox/MP3player.swf"  // URL of the MP3 Player
//});


$(document).ready(function () {

    $("#ajax-contact-form").submit(function () {
        $('#load').append('<center><img src="/images/ajax-loader.gif" alt="Currently Loading" id="loading" /></center>');

        var fem = $(this).serialize(),
		note = $('#note');

        $.ajax({
            type: "POST",
            url: "contact/contact.php",
            data: fem,
            success: function (msg) {
                if (note.height()) {
                    note.slideUp(1000, function () { $(this).hide(); });
                }
                else note.hide();

                $('#loading').fadeOut(300, function () {
                    $(this).remove();

                    // Message Sent? Show the 'Thank You' message and hide the form
                    result = (msg === 'OK') ? '<div class="success">Ditt meddelande har skickats.</div>' : msg;

                    var i = setInterval(function () {
                        if (!note.is(':visible')) {
                            note.html(result).slideDown(1000);
                            clearInterval(i);
                        }
                    }, 40);
                }); // end loading image fadeOut
            }
        });

        return false;
    });
});

$(document).ready(function () {
    $(".trigger").click(function () {
        $(".panel").toggle("fast");
        $(this).toggleClass("active");
        return false;
    });
});
