﻿$(document).ready(function() {
    // Resize images
    //$(".Picture").ImageResizer(0, false);

    // Change the link of the zoombutton
    $(".gallery").find("img").click(function() {
        $(".options").find(".imageZoom").attr("href", $(this).attr("src"));
    })

    //suckerfish
    $(".navigation").Suckerfish();

    //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=300&width=200"
                    });
                }
            });
        });
    });

    //search
    //$(".SearchButton").click(function() {
    //    $("#InitText").hide();
    //});
});


