		
function newwindow(filename){
	var fenster;
	if ((fenster == null)||(fenster.closed)) 
	{ 
 	fenster = window.open(filename, "AGB", "width=680,height=450,resizable=yes,status=yes,scrollbars=yes,toolbar=yes,location=yes,directories=no,menubar=yes");
 	 	fenster.opener = top;
    	fenster.focus();
	}else{
	fenster.focus(); 
	}
}	

		
wmtt = null;

document.onmousemove = updateWMTT;

function updateWMTT(e) {
	x = (document.all) ? window.event.x : e.pageX;
	y = (document.all) ? window.event.y : e.pageY;
	if (wmtt != null) {
		wmtt.style.left = 465; //verändert die Position des Bildes links - rechts
		wmtt.style.top 	= (document.body.scrollTop + 260); //verändert die Position des Bildes hoch / runter 
	}
}
function showWMTT(id) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "block"
}

function hideWMTT() {
	wmtt.style.display = "none";
}

function CheckLen(Target)
{
var maxlength = "249";  //die maximale Zeichenlänge

StrLen=Target.value.length;

if (StrLen==1&&Target.value.substring(0,1)==" ")
{
Target.value=""; 
StrLen=0;
}
if (StrLen>maxlength )
{
Target.value=Target.value.substring(0,maxlength);
CharsLeft=0;
}else
{
CharsLeft=maxlength-StrLen;
}
document.zaehlformular.Anzahl.value=CharsLeft;
}
			  
$(document).ready(function() {
   	$("#meinfrank_toggle").click(function () {
	      $("#meinfrank").slideToggle("medium");
	});
	$("#toggleGroup").click(function (event) {
	      $(".navi3").slideToggle("medium");
	      event.preventDefault();
	});  	
	$("#toggleDivLink").click(function (event) {
	      $("#toggleDiv").slideToggle("medium");
	      event.preventDefault();
	}); 
	$("#suchfeld").one("focus", function(){
		if($("#suchfeld").val() == "Suchen") {
			$("#suchfeld").attr('value','');
		}
		$("#suche_button").removeAttr("disabled");
	});
	$("#suche_button").click(function(event){
		if($("#suchfeld").val().length<4) {
			jAlert("Sie m&uuml;ssen mindestens 4 Zeichen eingeben um die Suche durchf&uuml;hren zu k&ouml;nnen.","Hinweis");
			event.preventDefault(); 
		}
	});
 });

 
 function PrintContent(id, name)
    {
        var DocumentContainer = document.getElementById(id);
        var WindowObject = window.open('', name, 
                              "width=740,height=325,top=200,left=250,toolbars=no,scrollbars=yes,status=no,resizable=no");
        WindowObject.document.writeln(DocumentContainer.innerHTML);
        WindowObject.document.close();
        WindowObject.focus();
        WindowObject.print();
        WindowObject.close();
    }
 
 function PrintBankeinzug() {
 	PrintContent('print_content', 'Bankeinzug');
 }
