var initNameNewsLetterBoxWideLowFormat = "";
var initEmailNewsLetterBoxWideLowFormat = "";

if (lcidNewsletterWide == 1030) {
    initNameNewsLetterBoxWideLowFormat = "Skriv dit navn";
    initEmailNewsLetterBoxWideLowFormat = "Skriv din e-mail";
}
if (lcidNewsletterWide == 1031) {
    initNameNewsLetterBoxWideLowFormat = "Name";
    initEmailNewsLetterBoxWideLowFormat = "E-Mail-Adresse";
}
if (lcidNewsletterWide == 1033) {
    initNameNewsLetterBoxWideLowFormat = "Your name";
    initEmailNewsLetterBoxWideLowFormat = "Your email";
}
if (lcidNewsletterWide == 1039) {
    initNameNewsLetterBoxWideLowFormat = "Nafn";
    initEmailNewsLetterBoxWideLowFormat = "Netfang";
}
if (lcidNewsletterWide == 1044) {
    initNameNewsLetterBoxWideLowFormat = "Skriv dit navn";
    initEmailNewsLetterBoxWideLowFormat = "Skriv din e-mail";
}
if (lcidNewsletterWide == 1053) {
    initNameNewsLetterBoxWideLowFormat = "Skriv ditt namn";
    initEmailNewsLetterBoxWideLowFormat = "Skriv din e-mail";
}

$(document).ready(function() {
    $(".NewsLetterBoxWideLowFormat #email").val(initEmailNewsLetterBoxWideLowFormat);
    $(".NewsLetterBoxWideLowFormat #name").val(initNameNewsLetterBoxWideLowFormat);

    $(".NewsLetterBoxWideLowFormat #email").focus(function() {
        $(".NewsLetterBoxWideLowFormat #email").css("font-weight", "normal").css("color", "black");
        if (this.value == initEmailNewsLetterBoxWideLowFormat)
            this.value = "";
    });

    $(".NewsLetterBoxWideLowFormat #email").blur(function() {
        if (this.value == "")
            this.value = initEmailNewsLetterBoxWideLowFormat;
    });

    $(".NewsLetterBoxWideLowFormat #name").focus(function() {
        $(".NewsLetterBoxWideLowFormat #name").css("font-weight", "normal").css("color", "black");
        if (this.value == initNameNewsLetterBoxWideLowFormat)
            this.value = "";
    });

    $(".NewsLetterBoxWideLowFormat #name").blur(function() {
        if (this.value == "")
            this.value = initNameNewsLetterBoxWideLowFormat;
    });
});

function validateNewsletterWideForm() {
    var valid = true;

    var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
    if (!emailPattern.test($(".NewsLetterBoxWideLowFormat #email").val())) {
        $(".NewsLetterBoxWideLowFormat #email").css("font-weight", "bold").css("color", "red");
        valid = false;
    }

    if ($(".NewsLetterBoxWideLowFormat #name").val() == "" || $(".NewsLetterBoxWideLowFormat #name").val() == initNameNewsLetterBoxWideLowFormat) {
        $(".NewsLetterBoxWideLowFormat #name").css("font-weight", "bold").css("color", "red");
        valid = false;
    }

    return valid;
}