
function reveal() {
  var reveals = document.querySelectorAll(".reveal");

  for (var i = 0; i < reveals.length; i++) {
    var windowHeight = window.innerHeight;
    var elementTop = reveals[i].getBoundingClientRect().top;
    var elementVisible = 25;

    if (elementTop < windowHeight - elementVisible) {
      reveals[i].classList.add("active");
    } else {
      reveals[i].classList.remove("active");
    }
  }
}

window.addEventListener("scroll", reveal);

//reveal end



function now2() {
	var ddl = document.getElementById('q602_select').value = '257';
    ddl
};

function now() {
	var ddl = document.getElementById('q603_select').value = '1115';
    ddl
};

function birthyear_text_replace() {
	document.getElementById('q604_select').options[0].innerHTML = "&#xf1fd; Dit fødselsår";
}





function BirthdayTextFieldsMover1(qId, item) {
if ((qId == '7643' || qId == '7644') && !(item.selectionStart == 0 && item.selectionEnd == 2) && item.value.length == 2) {
var nextQId = parseInt(qId, 10) + 1;
var nextItem = $('input[name=q' + nextQId + ']');
if (nextItem.length > 0) {
nextItem.focus().select();
}
}
}


function CollectDateFromPartsTextFields1(dateQId, dayQId, monthQId, yearQId) {
var bQ = GetQuestion(dateQId);
if (bQ != null 
&& $('input[name=q' + dateQId + ']').length > 0) {
var dateStr = $('input[name = q' + yearQId + ']').val();
var month = $('input[name = q' + monthQId + ']').val();
var day = $('input[name = q' + dayQId + ']').val();
if (month.length == 1)
month = '0' + month;
if (day.length == 1)
day = '0' + day;
dateStr += '-' + month + '-' + day;
$('input[name=q' + dateQId + ']').val(dateStr);
}
}