try {
	req = window.XMLHttpRequest?new XMLHttpRequest(): 
	new ActiveXObject("Microsoft.XMLHTTP"); 
} catch (e) {
	
}
 

function tiho()
{	
	//Hohle Inhalt aus INPUT == U
	var url = '/add_bookmark/m.add.bookmark.php';
	var U = document.getElementById('url').value;
	var urlnew = url + "?u=" + U;
	var inhalt = '';

	req.onreadystatechange = function() {
	
		if ((req.readyState == 4) && (req.status == 200)) inhalt = req.responseText;
		
		document.getElementById("add1").innerHTML = inhalt;

	}
	req.open('get', urlnew);
	req.send(null);
}



function tag_v()
{
	//Hohle Inhalt aus INPUT == U
	var url = '/js/m.tag.suggestions.php';
	var T = document.getElementById('ts').value;
	var url = url + "?tag=" + T;
	var inhalt = '';


	req.onreadystatechange = function() {

		if ((req.readyState == 4) && (req.status == 200)) inhalt = req.responseText;

		document.getElementById("add2").innerHTML = inhalt;
		//document.getElementById("add2").firstChild.nodeValue = inhalt;

	}
	req.open('get', url);
	req.send(null);
}



function taei(Tag)
{
    document.linkadd.tags.value += " "+Tag;
    document.linkadd.tags.focus();
}

function tain(Tag)
{
    document.search_form.ts.value += ' '+Tag;
    document.search_form.ts.focus();
}


function versteckt(status, funktionsname) 
{ 
    document.getElementById(funktionsname).style.display = status;
} 




function pw_check(kennwort) {

	var sicherheit = 0;  		
						
	if (kennwort.length >= 5)
	{	
	
		if (kennwort.length >= 7) sicherheit += 1;	
	
		if (kennwort.length >= 12) sicherheit += 1;
		
		if (kennwort.search(/[0-9]/) != -1)
		{	
			sicherheit += 1;
		} 						
																						
		if (kennwort.search(/[A-Z]/) != -1)
		{
			sicherheit += 1;				
		}
		
		if ((kennwort.search(/\W/) != -1) || (kennwort.search(/_/) != -1))
		{	
			sicherheit += 1;
		}
	}
	
	if (sicherheit > 3) sicherheit = 3;
	
	switch (sicherheit)
	{	
		case 1:
			document.getElementById("sicherheit").firstChild.nodeValue = "schwach";	
		//	document.getElementById("sicherheit").color = "#FFFFFF";		
		break;					
		
		case 2:				
			document.getElementById("sicherheit").firstChild.nodeValue = "mittel";	
		//	document.getElementById("sicherheit").color = "#FFFF00";	
		break;				
		
		case 3:		
			document.getElementById("sicherheit").firstChild.nodeValue = "sicher";		
		//	document.getElementById("sicherheit").color = "#00FF00";			
		break;					
		
		default:				
			document.getElementById("sicherheit").firstChild.nodeValue = "unsicher";	
		//	document.getElementById("sicherheit").color = "#FF0000";			
		break;			
	}	
	
}

function check_username(username)
{
  	var meldung = '';
	
	if (username.length < 4)
	{
		meldung = '<img src="/layout/img/no.png" width="13" height="13" border="0"><font style="color: red;"> min. 4 Zeichen</font>';
	}
  	
	if (username.length > 10)
	{
		meldung = '<img src="/layout/img/no.png" width="13" height="13" border="0"><font style="color: red;"> max. 10 Zeichen';
	}	
	
  	if ((username.search(/\W/) != -1) || (username.search(/_/) != -1))
	{
		meldung = '<img src="/layout/img/no.png" width="13" height="13" border="0"><font style="color: red;"> Ungültige Zeichen';	
  	}	
	
	if (meldung == '')
	{
		meldung = '<img src="/layout/img/yes.png" width="13" height="13" border="0">';	
	}
	
	
	//document.getElementById("uc_ergebnis").firstChild.nodeValue = meldung;
	document.getElementById("uc_ergebnis").innerHTML = meldung;
  
}


//PASSWÖRTER GLEICH???
function same_pw()
{
	
	var pw1 = document.getElementById('npw1').value;
	var pw2 = document.getElementById('npw2').value;
	
	if (pw1 != pw2)
	{
		document.getElementById("same_pw_out").innerHTML = "Passwörter stimmen nicht überein.";
	}
}
