$(document).ready(function() {

    /*slukic@skybrud.dk*/

    function browserSetup() {
        /*Setup for Browser size*/
        //var BodyScrollHeight = document.body.scrollHeight;
        var BodyWindowWidth = $(window).width();
        var BodyScrollHeight = $(document).height();

        $("#mainRowMiddleLeft").height(BodyScrollHeight - 139);

        if (BodyWindowWidth < 970) {
            /* Main content is 970, so to make it stay in the middle even with a smaller
            size windown then width:970px, We'll set 15px on each side as space. That will
            also make the left side bacground visible.*/
            $("#mainRows").width(1000);
            $("#mainRowLeft").width(15);

        }
        else {
            /*If the windows size (width) is greater then 970, then we'll use the dynamic size as 
            mainRows width. The sides will be maid by taking dynaic size "(BodyWindowWidth - 970)/2*/

            $("#mainRows").width(BodyWindowWidth);
            BodyWindowWidth = BodyWindowWidth - 970;
            var mainRowLeft = BodyWindowWidth / 2;
            $("#mainRowLeft").width(mainRowLeft);

        }
    }

    /* When document is ready the browsersetup will be called and resize the mail div's */
    browserSetup();

    /*Everytime user resize the main windows, our browserStup() will be called so that website is
    always in the middle of the screen*/
    $(window).resize(function() {

        browserSetup();

    });

});



/* Newsletter validation */
function textboxValidator(obj, className) {
    obj.className = className;
    if (obj.value == obj.title) {
        obj.value = '';
        obj.onfocus = function() { };
    }
    obj.onblur = function() {
        if (((obj.value).replace(/ /g, '')) == '') {
            obj.onfocus = function() {
                obj.value = '';
                obj.className = className;
                obj.onfocus = function() { };
            };
            obj.className = className + " novalue";
            obj.value = obj.title;
        };
    };
}