function getElementsByClassName(oElm, strTagName, oClassNames){
    var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    var arrRegExpClassNames = new Array();
    if(typeof oClassNames == "object"){
        for(var i=0; i<oClassNames.length; i++){
            arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
        }
    }
    else{
        arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
    }
    var oElement;
    var bMatchesAll;
    for(var j=0; j<arrElements.length; j++){
        oElement = arrElements[j];
        bMatchesAll = true;
        for(var k=0; k<arrRegExpClassNames.length; k++){
            if(!arrRegExpClassNames[k].test(oElement.className)){
                bMatchesAll = false;
                break;
            }
        }
        if(bMatchesAll){
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}

function setShowHideFaq(DIV_ID_QUESTION, DIV_ID_ANSWER){
	var div_question;
	var div_answer;
	var div_answer_line;
	var arrElements;
	div_question = document.getElementById(DIV_ID_QUESTION);
	div_answer = document.getElementById(DIV_ID_ANSWER);
	div_answer_line = document.getElementById(DIV_ID_ANSWER + "_line");


	if (div_answer.style.display == "none") {

		arrElements = getElementsByClassName(document,"div", "FaqAnswer");
		for(var j=0; j<arrElements.length; j++) {
			oElement = arrElements[j];
			oElement.style.display = "none";
		}

		arrElements = getElementsByClassName(document,"div", "FaqAnswerLine");
		for(var j=0; j<arrElements.length; j++) {
			oElement = arrElements[j];
			oElement.style.display = "";
		}

		arrElements = getElementsByClassName(document,"a", "FaqQuestionActive");
		for(var j=0; j<arrElements.length; j++) {
			oElement = arrElements[j];
			oElement.className = "FaqQuestionPassive";
		}

		div_answer.style.display = "";
		div_question.className = "FaqQuestionActive";
		div_answer_line.style.display = "none";
	} else {
		div_answer.style.display = "none";
		div_question.className = "FaqQuestionPassive";
		div_answer_line.style.display = "";
	}
}

function changeDisplayElement(element_id, type_of_display) {
	if (document.getElementById(element_id).style.display=='none') {
		document.getElementById(element_id).style.display= type_of_display;
	} else {
		document.getElementById(element_id).style.display='none';
	}
}

function popup_window(DATEI, WINDOWNAME,WIDTH,HEIGHT) {
    scrheight = screen.availHeight
    scrwidth  = screen.availWidth;
	POSX = Math.floor((scrwidth  - WIDTH)  / 2);
	POSY = Math.floor((scrheight - HEIGHT) / 2);
    new_popup_window = window.open(DATEI, WINDOWNAME, "width=" + WIDTH +",height=" + HEIGHT + ",top=" + POSY + ",left=" + POSX + ", dependent=no, hotkeys=no, location=no, menubar=no, resizable=no, status=no, toolbar=no,scrollbars");
    new_popup_window.focus();
}

function gallery_popup(DATEI, WINDOWNAME, WIDTH, HEIGHT) {
	scrheight = screen.availHeight;
	  						scrwidth  = screen.availWidth;
	  						POSX = Math.floor((scrwidth  - WIDTH)  / 2);
	  						POSY = Math.floor((scrheight - HEIGHT) / 2);
	  						new_gallery_popup = window.open(DATEI,  WINDOWNAME, "width=" + WIDTH +",height=" + HEIGHT + ", dependent=no, hotkeys=no, location=no, menubar=no, resizable=no, status=no, toolbar=no, scrollbars=yes,top=" + POSY + ",left=" + POSX + "");
	new_gallery_popup.focus();
}