// Functionen zum Oeffnen von Hilfsfenstern
function get_x(val) {
  if(window.screenX) {
    return window.screenX+val+220;
  } else {
    return window.screenLeft+val;
  }
}
function get_y(val) {
  if(window.screenY) {
    return window.screenY+val+205;
  } else {
    return window.screenTop+val;
  }
}

function show_notes_window() {
	F1=window.open('fin_template.cgi?template=note','note','height=300,width=488,left='+get_x(150)+',top='+get_x(80)+',status=no,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=no');
	F1.focus();
}
function show_note(id,res_flg) {
	F1=window.open('fin_note.cgi?id='+id+'&res='+res_flg,'note','height=300,width=488,left='+get_x(150)+',top='+get_y(80)+',status=no,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=yes');
	F1.focus();
}
function show_help(page,weite,hoehe) {
	F1=window.open(page, 'help', "width="+weite+",height="+hoehe+",left=0,top=0, status=no,toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes");
	F1.focus();
}
function print_notes_window(id) {
	F2=window.open('fin_drucken_note.cgi?template=drucken_note&id='+id,'notes');
	F2.focus();
}
function show_selection() {
	F1=window.open('fin_template.cgi?template=saveselection','saveselection','height=300,width=488,left='+get_x(150)+',top='+get_x(80)+',status=no,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=no');
	F1.focus();
}
function show_window(site) {
	F1=window.open('/f.cgi?f='+site,'Window','height=600,width=565,left='+get_x(150)+',top='+get_x(80)+',status=no,toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=no');
	F1.focus();
}
function setinaktiv () {
	document.form2.firmenname.value='';
  document.form2.ort.value='';
}
function setaktiv () {
	document.form2.produkte.value='';
}
function set_schnellsuche () {
	document.form2.suche_firmennummer.style.backgroundColor='#EEEEEE';
	document.form2.suche_firmenname.style.backgroundColor='#EEEEEE';
  document.form2.suche_ort.style.backgroundColor='#EEEEEE';
	document.form2.suche_plz.style.backgroundColor='#EEEEEE';
	document.form2.suche_bundesland.style.backgroundColor='#EEEEEE';
	document.form2.suche_kreis.style.backgroundColor='#EEEEEE';
	document.form2.suche_branche.style.backgroundColor='#EEEEEE';
	document.form2.suche_branche08.style.backgroundColor='#EEEEEE';
	document.form2.suche_produkte.style.backgroundColor='#EEEEEE';
	document.form2.suche_umsatz.style.backgroundColor='#EEEEEE';
	document.form2.suche_beschaeftigte.style.backgroundColor='#EEEEEE';
	document.form2.suche_rechtsform.style.backgroundColor='#EEEEEE';
	document.form2.suche_beteilig.style.backgroundColor='#EEEEEE';
	document.form2.suche_niederl.style.backgroundColor='#EEEEEE';
  document.form1.suche_volltext.style.backgroundColor='';
}
function set_detailsuche () {
	document.form2.suche_firmennummer.style.backgroundColor='';
	document.form2.suche_firmenname.style.backgroundColor='';
  document.form2.suche_ort.style.backgroundColor='';
	document.form2.suche_plz.style.backgroundColor='';
	document.form2.suche_bundesland.style.backgroundColor='';
	document.form2.suche_kreis.style.backgroundColor='';
	document.form2.suche_branche.style.backgroundColor='';
	document.form2.suche_branche08.style.backgroundColor='';
	document.form2.suche_produkte.style.backgroundColor='';
	document.form2.suche_umsatz.style.backgroundColor='';
	document.form2.suche_beschaeftigte.style.backgroundColor='';
	document.form2.suche_rechtsform.style.backgroundColor='';
	document.form2.suche_beteilig.style.backgroundColor='';
	document.form2.suche_niederl.style.backgroundColor='';
	document.form1.suche_volltext.style.backgroundColor='#EEEEEE';
}
function equal_height() {
    if (document.getElementById('content').offsetHeight) {
        var block_heights = new Array(
            document.getElementById('content').offsetHeight,
            645
        );
        var win = document.body.clientHeight - document.getElementById('top').offsetHeight ;
        block_heights = block_heights.reverse(block_heights.sort(num_sort));
        var new_height = block_heights[0];
        
		if (win > new_height) { new_height = win - document.getElementById('bottom').offsetHeight;}
        new_height = new_height + 'px';
        document.getElementById('content').style.height = new_height;
        //document.getElementById('navi').style.height = new_height;//
    }
}

function num_sort(a,b) {
    return a-b;
}

function equal_height() {
    if (document.getElementById('content').offsetHeight < 678) {
    	  document.getElementById('bottom').style.marginTop = (740-document.getElementById('content').offsetHeight) + 'px';
        document.getElementById('content').style.height = 678 + 'px';
    }
}

function del(url) {
	if(confirm("Diese Selektion löschen?")) { location.href=url; }
}

function dele(url) {
	if(confirm("Diese Merkliste löschen?")) { location.href=url; }
}
