/* Wissenschaftler */
function toggle(id,id2,name,name2){
	var divhide = document.getElementById(id)
	var changebutton = document.getElementById(id2)
	if (divhide.style.display == 'none') {
		divhide.style.display = 'block';
		document.getElementById(id2).innerHTML='<p class="togglebuttontext">'+name2+'</p>';
	} else {
		divhide.style.display = 'none';
		document.getElementById(id2).innerHTML='<p class="togglebuttontext">'+name+'</p>';
	}
	FM.toggleClass(id2, 'buttonon');
}

/* Funktion Eventkalender Anzeige */
function initAncestor() {
$('a.aktiv').parents("li").css('background-color', 'white');
$('a.aktiv').parents("li").css('border-bottom', '1px solid white');
}

/* Funktion FAQ Anzeige */
function initAccordion() {
$(".faqs .faq_questionfield").prepend('<span class="plus">+ </span>');
$(".faqs .faq_questionfield").prepend('<span class="plus" style="display:none">- </span>');
$(".faqs .faq_questionfield").click(function() {
$(this).children("span.plus").toggle();
$(this).next().toggle("fast");
return false;
}).next().hide();
}

/*Funktion Get URL Variable*/
function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

/* Funktion News Anzeige */
function initNews() {
$(".news_ip .newstitle").prepend('<span class="plus">+ </span>');
$(".news_ip .newstitle").prepend('<span class="plus" style="display:none">- </span>');
$(".news_ip .newstitle").click(function() {
$(this).children("span.plus").toggle();
$(this).next().toggle("fast");
return false;
}).next().hide();
var news = getUrlVars()["varnews"];
document.getElementById(news).click();
}

/* Funktion sortierbare Tabelle */
function initTablesort(){                 
$("tbody").find("tr:even").addClass("even");
$("tbody").find("tr:odd").addClass("odd");
$(".tablesort").tablesorter();               
} 
