$(document).ready(function() {
    // PNG fix
    $(document).pngFix();

    // Roll over image
    PEPS.rollover.init();

    // Form submit
    $("#Contact").AjaxForm({
        Action: "MailForm",
        Title: "Contact EAC",
        //To: "rik@nedfinity.com",
        To: "info@eacompetition.nl",
        From: "website@eacompetition.nl",
        Message: "Bedankt voor uw intresse. Indien gewenst nemen wij zo spoedig mogelijk contact met u op.",
        FalseFromHEX: "#ee0000",
        FalseToHEX: "#fce4c1",
        TrueHEX: "#cccccc"
    });

    $("#Inschrijven").AjaxForm({
        Action: "MailForm",
        Title: "Inschrijving EAC",
        //To: "rik@nedfinity.com",
        To: "info@eacompetition.nl",
        From: "website@eacompetition.nl",
        Message: "Bedankt voor uw aanmelding. U ontvangt de komende maand meer informatie over de EAC",
        FalseFromHEX: "#ee0000",
        FalseToHEX: "#fce4c1",
        TrueHEX: "#cccccc"
    });

    // Suckerfish
    $(".menu").Suckerfish();

    // Banner innerfade
    $('ul#banner').innerfade({
        speed: 1000,
        timeout: 5000,
        type: 'sequence',
        containerheight: '261px'
    });

    //newsletter
    //$(".newsletterinput").each(function() {

    var Parent = $(this);

    $(this).find(".emailinput").each(function() {
        $(this).click(function() {
            $(this).val("");
        });
        $(this).keyup(function() {
            var Value = $(this).val();
            var Regex = new RegExp(/\w+@[a-zA-Z0-9_]+?\.[a-zA-Z]/);
            if (Regex.exec(Value) != null) {
                $(Parent).find("a.emaillink").attr({
                    href: "/NewsLetter.aspx?email=" + Value + "&keepThis=true&TB_iframe=true&height=250&width=500"
                });
            }
        });
        //});


    });


});


