var toggle=1;
var buttons = new Array();
//wmtt = null;
//document.onmousemove = updateWMTT;

function CheckLen(Target)
{
	var maxlength = "500";  //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.getElementById('Anzahl').innerHTML=CharsLeft;
}


function toggleButton(){
	if(toggle==0){
		document.getElementById('fotobearbeitung').value="öffnen";
		toggle=1;
				
	}else{
		document.getElementById('fotobearbeitung').value="schliessen"
		toggle=0;
	}

}


function buttonsLaden(){

	//buttons[0] = "document.getElementById('fotobearbeitung').src='includes/images/button_oeffnen.jpg';"
	//buttons[1] = "document.getElementById('fotobearbeitung').src='includes/images/button_schliessen.jpg';"

	buttons[0] = new Image();
	buttons[0].src = 'includes/images/button_oeffnen.jpg';
	buttons[1] = new Image();
	buttons[1].src = 'includes/images/button_schliessen.jpg';

}

/*
function updateWMTT(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	if (wmtt != null) {
		wmtt.style.left = (x + 20) + "px";
		wmtt.style.top 	= (y + 20) + "px";
	}
}
*/
function showWMTT(id, desc) {
	wmtt = document.getElementById(id);
	wmtt.innerHTML=desc;
	wmtt.style.display = "block";
}


function hideWMTT(id) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "none";
}

function suchen (suchwort,L){
StrLen=suchwort.length;
	if(StrLen>1){
		document.tx_indexedsearch.action="index.php?id=36&L="+L;
		document.tx_indexedsearch.submit();	
	}
}


function WindowPopUp(url, breite, hoehe, language) {
	var schliessen='';
	if(1==language){
		schliessen="close window";
	}else{
		schliessen="Fenster schlie&szlig;en";
	}
	
	var button = '<input class=\"button\" type=\"submit\" value=\"'+schliessen+'\" onclick=\"javascript:window.close();\">';
    x = (screen.availWidth/2)-(breite/2);
    y = (screen.availHeight/2)-(hoehe/2);
		PopUpWindow = window.open('','','width='+breite+',height='+hoehe+',left='+x+',top='+y+',screenX='+x+',screenY='+y,'resizable=no');
		var grafik = '<img src=\"'+url+'\" border=\"0\">';
		var html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">';
			html+= '<html><head>';
			html+= '<link href=\"fileadmin/templates/css/popup_style.css\" rel=\"stylesheet\" type=\"text/css\" />';
			html+= '<title>Topcom</title></head><body>';
			html+= '<table align=\"center\">';
			html+= '<tr><td>' + grafik + '</td></tr>';
			html+= '<tr><td align=\"center\" class=\"grau\">' + button + '</td></tr>';
			html+= '</table>';
			html+= '</body></html>';
		PopUpWindow.document.write(html);
      	PopUpWindow.document.close();
		PopUpWindow.focus();
		
   }

