$(document).ready(function() {
// AKTUELLT / KALENDER TABS
	$('#tabvanilla > ul').tabs({ fx: {opacity: 'toggle'} });
// ACCORDIONS
	$('.acc_container').hide(); //Hide/close all containers
	$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

	$('.acc_trigger').click(function(){
		if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
			$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all "active" state and slide up the immediate next container
			$(this).toggleClass('active').next().slideDown(); //Add "active" state to clicked trigger and slide down the immediate next container
		}
		return false; //Prevent the browser jump to the link anchor
	});
	


// HELPTEXTS

	$('a.helpArrow').each(function () {
        $(this).aToolTip({
            clickIt: true,
            tipContent: '<div>' + $(this).prev().html() + '</div>'
        });
    });

    $('a.helpBtn').each(function () {
	//var searchhelp = 'vore fint o få till dictionary items här!';
        $(this).aToolTip({
            clickIt: true,
            tipContent: '<div>' + $(this).prev().html() + '</div>'
        });
    });    
}); 

// MySite show hide divs
function showonlyone(thechosenone) {
    $('div[name|="myPage"]').each(function (index) {
        if ($(this).attr("id") == thechosenone) {
            $(this).show(200);
        }
        else {
            $(this).hide(200);
        }
    });
}

// TOGGLE
function toggleDiv(divId) {
    $("#" + divId).toggle();
}
///// EOF


