var aktiv;

function fenster(doku,laenge,hoehe){
	rechts = screen.width / 2 + 320;

	if(aktiv == 1){
		info.close();
		info = window.open(doku, "dokus", "top=250,left="+rechts+",width="+laenge+",height="+hoehe);
	}
	
	info = window.open(doku, "dokus", "top=250,left="+rechts+",width="+laenge+",height="+hoehe);
	info.focus();
	aktiv = 1;
	
	if(info.closed == true){
		aktiv = 0;
	}
}


var aktiv2;

function fenster2(doku,laenge,hoehe){
	pos = screen.width / 2 - 100;

	if(aktiv2 == 1){
		info2.close();
		info2 = window.open(doku, "info", "scrollbars=yes,top=250,left="+pos+",width="+laenge+",height="+hoehe);
	}
	
	info2 = window.open(doku, "info", "scrollbars=yes,top=250,left="+pos+",width="+laenge+",height="+hoehe);
	info2.focus();
	aktiv2 = 1;
	
	if(info2.closed == true){
		aktiv2 = 0;
	}
}


var aktiv3;

function fenster3(doku,laenge,hoehe){
	pos = screen.width / 2 - 200;

	if(aktiv3 == 1){
		info3.close();
		info3 = window.open(doku, "print", "toolbar=yes, menubar=yes, scrollbars=yes,top=10,left="+pos+",width="+laenge+",height="+hoehe);
	}
	
	info3 = window.open(doku, "print", "toolbar=yes, menubar=yes, scrollbars=yes,top=10,left="+pos+",width="+laenge+",height="+hoehe);
	info3.focus();
	aktiv3 = 1;
	
	if(info3.closed == true){
		aktiv3 = 0;
	}
}


var aktiv4;

function fenster4(doku,laenge,hoehe){
	pos = screen.width / 2 - 200;
	doku = 'http://' + window.location.hostname + doku;
	
	if(aktiv4 == 1){
		info4.close();
		info4 = window.open(doku, "print", "toolbar=yes, menubar=yes, scrollbars=yes,top=10,left="+pos+",width="+laenge+",height="+hoehe);
	}
	
	info4 = window.open(doku, "print", "toolbar=yes, menubar=yes, scrollbars=yes,top=10,left="+pos+",width="+laenge+",height="+hoehe);
	info4.focus();
	aktiv4 = 1;
	
	if(info4.closed == true){
		aktiv4 = 0;
	}
}
