$(document).ready(function() {

    // Removes easyfish for apsis registration
    // Apsis form should have the class .newsletterContainer
    var apsisAction = $('.newsletterContainer input[name="__EasyPostBackAction"]').val();
    $('.newsletterContainer').attr("action", apsisAction);

    // Input field with the class brInputDefaultValue will show text and remove onfocus
    $('.brInputDefaultValue').each(function() {
        var default_value = this.value;
        $(this).focus(function() {
        if(this.value == default_value) {
        this.value = '';
        }
        });

        $(this).blur(function() {
            if(this.value == '') {
            this.value = default_value;
            }
        });
    });

});

// Call the function to get querystring
function getQuerystring(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.href);
    if (results == null)
        return "";
    else
        return decodeURIComponent(results[1].replace(/\+/g, " "));
}
