<!--

function aloa(){
	alert('aloa');
}

function CheckAll(){
	if(document.Expertensuche.elements.ALL){
		var c = document.Expertensuche.elements.ALL.checked;
	}
	
	for (var i=22;i<42;i++){
		var e = document.Expertensuche.elements[i];
 		if(e.name != 'ALL') 
 		  	e.checked = c;
  	}
}

function unCheckAll(){
	box = document.Expertensuche.elements.ALL;
	/*alert(box.value);*/
	var f = 0;
	for (var i=22;i<42;i++){
		if(document.Expertensuche.elements[i].checked){
			f++;
   		}
	}
	/*alert(f);*/
	if(box.checked || f == 18){
		box.checked = !box.checked;
	}
}

/****** Kontrolliert alle Checkboxen in der Ergebnisliste und steuert den SaveButton*****/
/* die Version mit Buttons */
function selectionCheckAll(id,count){
	var c = checkIfAllChecked(count,false);
	//alert("alle: " + c);
	var buttonSrc = getButtonSrc('saveButtontop');
	
	if(c && buttonSrc.indexOf('save.gif') != -1){
		changeButtons(buttonSrc,"inactivate");
	}

	if(!c && buttonSrc.indexOf('save_gray.gif') != -1){
		changeButtons(buttonSrc,"activate");
	}
	
	for (i=0;i < count;i++){
		var e = document.forms[0].elements[i];
	  	e.checked = !c;
  	}
}

/* die Version mit Checkboxen */
function selectionCheckAll2(id,count){
	var i = 1;
	var x = i + count;
	
	if(document.getElementById(id)){
		var c = document.getElementById(id).checked;		
	}
	if(id == 'bottomALL'){
		document.getElementById('topALL').checked = c;
	}
	if(id == 'topALL'){
		document.getElementById('bottomALL').checked = c;
	}
	
	for (i;i < x;i++){
		var e = document.publiste.elements[i];
 		if(e.name != 'topALL') 
 		  	e.checked = c;
  	}
}

function selectionUnCheckAll(count){
	var topAll = document.publiste.elements.topALL;
	var bottomAll = document.publiste.elements.bottomALL;

	var i = 1;
	var x = i + count;
	var f = 0;
	for (i;i<x;i++){
		if(document.publiste.elements[i].checked){
			f++;
   		}
	}
	if(topAll.checked || f == count){
		topAll.checked = !topAll.checked;
		bottomAll.checked = !bottomAll.checked;
	}
}

/***** bei jedem Klick auf eine Checkbox wird der Status des SaveButton überprüft und ggf. angepaßt.*****/
function checkSaveButton(checked,count){
	var buttonSrc = getButtonSrc('saveButtontop');
	//alert(checked);
	if(checked == true){
		if(buttonSrc.indexOf("save.gif") == -1){
			changeButtons(buttonSrc,"activate");
		}
	}else{
		//alert(checkIfAllChecked(count,true));
		if(checkIfAllChecked(count,true)== false){
			changeButtons(buttonSrc,"inactivate");	
		}
	}
}

/**** checkt, ob alle Checkboxen angehakt sind oder nicht****/
function checkIfAllChecked(count,detailed){
	//alert("count:" + count)
	counter=0;
	for (j=0;j < count;j++){
		if(document.publiste.elements[j].checked){
		counter++;
		}		
	}
	//alert(counter+ " " + count);	
	if(counter == 0 || (!detailed && counter < count)){
		return(false);
	}
	if(counter == count){
		return(true);
	}
	if(counter < count && counter != 0 && detailed){
		return("some");
	}	
}

/**** ändert die SaveButtons und aktiviert oder deaktiviert sie.****/
function changeButtons(buttonSrc,action){
	var fileNamePosition = buttonSrc.indexOf("save");
	var relativePath = buttonSrc.substring(0,fileNamePosition);
	var activeButton = "save.gif";
	var imgFileName = "";
	var disabled = "";
	if(action == "activate"){
		imgFileName = "save.gif";
		disabled = false;
	}else{
		imgFileName = "save_gray.gif";
		disabled = "disabled";	
	}
	document.getElementById('saveButtontop').src = relativePath + imgFileName;
	document.getElementById('saveButtontop').disabled = disabled;
	document.getElementById('saveButtonbottom').src = relativePath + imgFileName;
	document.getElementById('saveButtonbottom').disabled = disabled;
}


/**** gibt die Quelle eines Images oder Buttons an, dessen ID man übergibt. ****/
function getButtonSrc(id){
	var button = document.getElementById(id);
	return(button.src);
}

function Hilfe(url){
        var widt = 750;
        var wi = (screen.availWidth/2)-(widt/2);
	//var wi = (screen.availWidth)-770;
        var hi = 0;
        var heig = 550;

        if (navigator.appName == "Microsoft Internet Explorer"){
                var sFea = 'width=' + widt + ',height=' + heig + ',scrollbars,left=' + wi + ',top=' + hi + ',resizable=yes,menubar=yes,toolbar=yes,location=yes,status=yes';
                hilfe = window.open(url, 'hilfe', sFea);
		hilfe.focus();
        }
        else {
                var sFea = "width=" + widt + ",height=" + heig + ",scrollbars,screenX=" + wi + ",screenY=" + hi + ',resizable=yes,toolbar=yes,location=yes,status=yes';
                hilfe = window.open(url, 'hilfe', sFea);
		hilfe.focus();
        }
}

function disable(jahr) {
    	jv = document.Expertensuche.elements.JV;
    	jb = document.Expertensuche.elements.JB;
    	if (jahr == 0){
           jb.value = 0;
           jv.value = 0;
        } 
        else {
          if (jv.value == 0)
             jv.value = 1971;
  	  if (jb.value == 0)
  	     jb.value = jahr;
	}
}

function uncheckJO() {
	box = document.Expertensuche.elements.JO;
	if(box.checked){
		//alert("hilfe!");
		box.checked = !box.checked;
	}
}

function submitList(step, listsave) {
        document.publiste.step.value = step;
        document.publiste.listsave.value = listsave;
        document.publiste.submit();
}

function open_window_sfx (loc)
{
	var w = window.open(loc, "winsfx", "height=640,width=560,location=no,menubar=no,status,toolbar,scrollbars,resizable");
		w.focus();
}

function open_window_ezb (loc)
{
	var w = window.open(loc, "winezb", "height=640,width=800,top=50,left=50,screenY=50,screenX=50, toolbar=yes, menubar=yes, status=yes, scrollbars=yes, resizable=yes, location=yes");
		w.focus();
}

function open_window_vl (loc)
{
	var w = window.open(loc, "winvl", "height=640,width=800,top=50,left=50,screenY=50,screenX=50, toolbar=yes, menubar=yes, status=yes, scrollbars=yes, resizable=yes, location=yes");
		w.focus();
}

function bookmarksite(title, url)
{
    if (document.all)
        window.external.AddFavorite(url, title);
    else if (window.sidebar)
        window.sidebar.addPanel(title, url, "")
}