b=navigator.appName;
v=parseInt(navigator.appVersion);
function f(url, names){
	if ((b="Netscape"&&v=="3")||(v>="4")) document[names].src=url;
}
function __keydown() {
	k=event.keyCode;
	if(k==113) { x=document.all["TRM"]; if(x) x.focus(); }
}
pu="";
popup="";
function Popup(URL,w,h,NAME) {
	if (v>="3") {
		if (typeof NAME == 'undefined' || NAME == "") {
		  NAME="_blank";
		}
		var TEILNAME=NAME.substr(0,7);
		if (TEILNAME == "toolbar") {
		  WINDOW='toolbar=1,menubar=1,status=1,location=1,scrollbars=1,resizable=1';
		} else {
		  WINDOW='top=10,left=10,width='+w+',height='+h+',scrollbars=1,resizable=1,status=0,toolbar=0';
		}
		popup=window.open(URL,NAME,WINDOW);
		popup.focus();
		if (pu!=popup) {
			pu=popup;
		}
	} else {
		window.location.href=URL;
	}
}

function helpselect() {
	 x = document.main.searchField.selectedIndex;
	 help_docs = new Array(
		"help-full.php",
		"help-author.php",
		"help-title.php");
	 help_url = '/typo3conf/ext/metasuchexml/pi1/'+help_docs[x]+'?ref='+ document.URL;
	 Popup(help_url,600,400,'Hilfe');
}

// nachfolgend Code für Multilingual Keyboard
var last_used_searchfield = null; 
function keyboard() {
	var searchfield = "query";		//query ist der Name des Suchfeldes im iport-Formular
	if (last_used_searchfield != null) searchfield = last_used_searchfield.name;
	  	keybd = window.open("http://www.slavistik-portal.de/fileadmin/keyboard.htm?field=main."+searchfield, "Keybord", "height=300, width=500,top=0, left=300, scrollbars=auto, toolbar=no, status=no");
		//main ist der Name des iport-Suchformulares
	}
	
var keybd = false;
function keybd_close() {
	if (keybd) {
	 keybd.close();
	 keybd = null;
	}
}

function keyboard_roll(img_swap, img_name){
	img_name.src = img_swap;
}
function dbpopup(w,h,db,info) {
	x = screen.availWidth/2-w/2;
	y = screen.availHeight/2-h/2;
	var popupWindow = window.open(
		'','_blank','width='+w+',height='+h+',left='+x+',top='+y+',scrollbars=yes,resizable=yes,screenX='+x+',screenY='+y);
	var c="<html><head><title>DB "+decodeURI(db)+"</title></head><style>*,body { font-family: verdana,arial;}</style><body><h4>"+decodeURI(db)+"</h4>"+decodeURI(info)+"<p></p><a href=javascript:window.close()>Fenster schlie&szlig;en </a></body></html>\n";
	popupWindow.document.write(c);
}
function groupon2(group) {

	var checked = document.getElementById('group' + group).checked;

	for (var j=0; j<document.main.length; j++)
	{

		var e = document.main[j];
		if (e.type=="checkbox" && e.id==group) { e.checked = checked; }

	}

}
