jQuery(document).ready(function() {
    inputField = jQuery('#katalogbestilling_postnummer');
    outputElement = jQuery('#katalogbestilling_poststed');
    inputField.keyup(function() {
        if (inputField.val().length == 4) {
            jQuery.getJSON('http://fraktguide.bring.no/fraktguide/postalCode.json?pnr='+ inputField.val() +'&callback=?',
                function(data){
                    outputElement.attr('value', data.result);
                });
        }
        else {
            outputElement.text('');
        }
    });
});

jQuery(document).ready(function() {
setExampleValueInField(".fodselsdato", "DDMMYY" )
    jQuery('.land').click(
        function() {
            if (this.value == 'Norge') {
                this.value = '';
            }
        });

    jQuery('.land').blur(
        function () {
            if (this.value == ''){
                this.value = 'Norge';
            }
        });

    if (jQuery('.land')[0].value == '')
    {
        jQuery('.land')[0].value = 'Norge';
    }
});


jQuery(document).ready(function(){
    jQuery(".info-icon").tooltip({
        track: true,
        delay: 0,
        showURL: false,
        opacity: 2,
        showBody: " - ",
        fade: 250
    })
})





