﻿function openCloseAnswer(id, oc) {
	var a_id = id;
	var a_pm = id+"pm";
	
	var status = true;
	
	if(document.getElementById(id).style.display != 'none') {
		status = false;
	}
	
	if(oc != undefined){
		status = oc;
	}
	
	if(status) {
		document.getElementById(a_id).style.display = 'inline';
		document.getElementById(a_pm).src = "images/minus.png";

	}else {
		document.getElementById(a_id).style.display = 'none';
		document.getElementById(a_pm).src = "images/plus.png";
	}

}
function openCloseALLAnswers(count, oc) {
	for(var i = 1; i <= count; i++){
		var id = "a"+ i;
		openCloseAnswer(id, oc);
	}
	
	if(oc){
		document.getElementById("ofaq").style.textDecoration = 'none';
		document.getElementById("ofaq").style.cursor = 'default';
		document.getElementById("cfaq").style.textDecoration = 'underline';
		document.getElementById("cfaq").style.cursor = 'pointer';
	}else{
		document.getElementById("ofaq").style.textDecoration = 'underline';
		document.getElementById("ofaq").style.cursor = 'pointer';
		document.getElementById("cfaq").style.textDecoration = 'none';
		document.getElementById("cfaq").style.cursor = 'default';
	}
}


function setTarget(obj) {
	obj.target = '_blank';
}
function setSelfTarget(obj) {
	obj.target = '_self';
}

function openWindow(myURL, Myname, weite, hoehe){

  var screenw = screen.availWidth; 
  var screenh = screen.availHeight; 

  var posx = (screenw / 2) - (weite / 2); 
  var posy = (screenh / 2) - (hoehe / 2); 

   if(hoehe >= 800){
	MyWindow = window.open(myURL,Myname,"top="+posy+",left="+posx+",width="+weite+",height="+hoehe+",menubar=no,locationbar=no,statusbar=no,resizable=no,toolbar=no,dependent=yes,scrollbars=no"); 
   }else{
	MyWindow = window.open(myURL,Myname,"top="+posy+",left="+posx+",width="+weite+",height="+hoehe+",menubar=no,locationbar=no,statusbar=no,resizable=no,toolbar=no,dependent=yes,scrollbars=no"); 
   }

 	MyWindow.focus();
}
