$(document).ready(function(){
	
	// empty on focus and blur function for the search field
	/*$('.input_txt').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;
			}
		});
	});*/
	
	// hover effect for the frontpage entry links
	$(".front_entry").hover(
      function () {
        $(this).find(".front_entry_arrow").addClass('front_entry_hover');
      }, 
      function () {
        $(this).find(".front_entry_arrow").removeClass('front_entry_hover');
      }
    );
	
	// replace id in links to show event details from the frontpage
	$('.frontpage .calendar_items > .calendar_item > a').each(
	  function() {
	    this.href = this.href.replace(/Default.aspx\?id=[0-9]*/gi, 'Default.aspx?ID=36809').replace('Calendar','Calender').replace('Calendar','Calender');
	  }
	);

    // open/close function for the Google Translate overlay
	$("#translate-close,#translate-link a").click(function (e) {
	    $(".translate-box").slideToggle("fast", function () {
	        $(".translate-box").toggleClass("translate-active");
	    });
	});

});

// inserts Google Translate element
function googleTranslateElementInit() {
    new google.translate.TranslateElement({
        pageLanguage: 'da'
    }, 'google_translate_element');
}
