var merk = true;
var merkTimer = null;

function getValueByName(name)
{
	var obj = document.getElementsByName(name);
	var re = ""
	
	for(var loop = 0;loop < obj.length;loop++)
	{
		if(obj[loop].checked)
		{
			re = obj[loop].value;
		}
	}
	
	return re;
}
function unSelect(obj_name)
{
	var obj_array = document.getElementsByName(obj_name);
	
	for(var loop = 0;loop < obj_array.length;loop++)
	{		
		obj_array[loop].checked = false;
	}
}
function browserCheck()
{
	var obj = document.getElementById("browser");
	var check = true;
	
	if(objUA.appName == "Internet Explorer" && objUA.appVersion >= 8.0)
	{
		check = false;
	}
	if(objUA.appName == "Firefox" && objUA.appVersion >= 3.0)
	{
		check = false;
	}
	if(objUA.appName == "Opera" && objUA.appVersion > 9.5)
	{
		check = false;
	}
	if(objUA.appName == "Safari" && objUA.appVersion >= 4.0)
	{
		check = false;
	}
	if(objUA.appName == "Chrome" && objUA.appVersion >= 4.0)
	{
		check = false;
	}
	
	if(check)
	{
		obj.innerHTML = "<div onclick='javascript:lboxOn(\"Um diese Online Applikation fehlerfrei nutzen zu kÃ¶nnen benÃ¶tigen Sie min. Firefox 3.0, Internet Explorer 8.0,<br/> Opera 10.0, Safari 4.0 oder Chrome 4.0. Zur Zeit lÃ¤uft bei Ihnen ein "+objUA.appName+" Version "+objUA.appVersion+".\");' style='height: 38px; width: 38px; cursor: pointer;'></div>";
		
		obj.style.display = "block";	
	}
}
function eingabe_out(obj,old)
{
	if(obj.value == "")
	{
		obj.value = old;
	}
}
function hidden(obj_id)
{
	document.getElementById(obj_id).style.visibility = 'hidden';
}
function visible(obj_id)
{
	document.getElementById(obj_id).style.visibility = 'visible';
}
function weiter()
{
	location.href='index.php';
}
function lboxOn(inhalt,typ,abfrage)
{
	var cont = document.getElementById("lbox_cont");
	var lbox = document.getElementById("lbox");
	
	if(typ == "info")
	{
		inhalt = "<div class='meldung_info' style='max-width: 300px'>"+inhalt+"</div>";
	}
	else if(typ == "fehler")
	{
		inhalt = "<div class='meldung_fehler' style='max-width: 300px'>"+inhalt+"</div>";
	}
	else if(typ == "bild")
	{
		inhalt = "<img src='"+inhalt+"' id='lbox_pic' style='border: solid 1px #CCCCCC; padding: 5px;'/>";
	}
	else if(typ == "abfrage")
	{
		inhalt = inhalt + "<div class='c'><input type='button' id='button_ja' onclick='hol(\""+abfrage+"\");lboxOff();' value=''><input type='button' id='button_nein' onclick='lboxOff()' value=''></div>";
	}
	else if(typ == "aufruf")
	{
		inhalt = inhalt + "<div class='c'><input type='button' id='button_ja' onclick='"+abfrage+"javascript:lboxOff();' value=''><input type='button' id='button_nein' onclick='lboxOff()' value=''></div>";
	}
	else if(typ == "flash")
	{
		/*inhalt = "<div style='height: 600px; width: 800px; background: url(image/video_loader/video_loader_200x100.png) center no-repeat;'><object data='"+inhalt+"' type='application/x-shockwave-flash' width='800' height='600' id='video'><param name='wmode' value='transparent' /> <param name='movie' value='"+inhalt+"' /> <param name='allowFullScreen' value='true' /></object></div>";		*/
		
		inhalt = "<div style='height: 450px; width: 800px; background: url(image/video_loader/video_loader_200x100.png) center no-repeat;'><object style='height: 600px; width: 800px'><param name='movie' value='http://www.youtube.com/v/WnxE9T3gBeY?rel=0&hd=1'><param name='allowFullScreen' value='true'><param name='allowScriptAccess' value='always'><embed src='http://www.youtube.com/v/WnxE9T3gBeY?rel=0&hd=1' type='application/x-shockwave-flash' allowfullscreen='true' allowScriptAccess='always' width='800' height='450'></object></div>";
	}
	
	if(abfrage == "no")
	{
		cont.style.paddingRight = "5px";
		cont.innerHTML = inhalt;
	}
	else
	{
		cont.style.paddingRight = "27px";
		cont.innerHTML = inhalt+"<input id='lbox_x' type='button' class='min_button cancel_button' onclick='lboxOff()' style='position: absolute; right:0px; top:0px;'>";	
	}
	
	var pic = document.getElementById("lbox_pic");
	
	if(pic != null)
	{
		visible("loader");
		
		pic.onload = function()
		{
			lboxCenter();
			
			visible("lbox");
			hidden("loader");
		}	
	}
	else
	{
		lboxCenter();
		visible("lbox");
	}	
}
function lboxOff()
{
	document.getElementById("lbox_cont").innerHTML = "";

	hidden("lbox");
}
function displayChange(obj_id)
{
	if(document.getElementById(obj_id).style.display == 'none')
	{
		displayOn(obj_id)
	}
	else
	{
		displayOff(obj_id)
	}
}
function displayOn(obj_id)
{
	document.getElementById(obj_id).style.display = 'block';
}
function displayOff(obj_id)
{
	document.getElementById(obj_id).style.display = 'none';
}
function lboxCenter()
{
	var cont = document.getElementById("lbox_cont");
	var lbox = document.getElementById("lbox");
	
	if(((lbox.offsetWidth/2)-(cont.offsetWidth/2)) > 0)
	{
		cont.style.left = ((lbox.offsetWidth/2)-(cont.offsetWidth/2)) + "px";
	}
	else
	{
		cont.style.left = "0px";
	}
 
 	if(((lbox.offsetHeight/2)-(cont.offsetHeight/2)) > 0)
 	{
 		cont.style.top = ((lbox.offsetHeight/2)-(cont.offsetHeight/2)) + "px";	
 	}
	else
	{
		cont.style.top = "0px";
	}
}
function check_reg()
{
	var anr = document.getElementsByName("anrede");
	var anrede = "";
	var vname = document.getElementById("vname");
	var nname = document.getElementById("nname");
	var pw = document.getElementById("pw");
	var pww = document.getElementById("pww");
	
	for(var loop = 0;loop < anr.length;loop++)
	{
		if(anr[loop].checked) anrede = anr[loop].value;		
	}	
	
	if(anrede == "")
	{
		lboxOn("Es wurde noch keine Anrede ausgewÃ¤hlt.");
	}
	else if(vname.value == "")
	{
		lboxOn("Es wurde noch keine Vorname eingetragen.");
	}
	else if(nname.value == "")
	{
		lboxOn("Es wurde noch kein Nachname eingetragen.");
	}
	else if(pw.value == "")
	{
		lboxOn("Es wurde noch keine Passwort eingetragen.");
	}
	else if(pww.value == "")
	{
		lboxOn("Die Eingabe des Passworts wurde noch nicht wiederholt.");
	}
	else if(pw.value != pww.value)
	{
		pw.value = "";
		pww.value = "";
		lboxOn("Die Wiederholung des Passworts stimmt nicht mit dem eigentlichen Passwort Ã¼berein.");
	}
	else 
	{
		document.act_reg.submit();	
	}
}
function removeChar(obj,typ)
{
	if(typ=="mail")
	{
		obj.value = obj.value.replace(/[^a-zA-Z0-9\-\_\.\Ã¼\Ã¶\Ã¤\Ã„\Ãœ\Ã–\@]*$/,"");	
	}
	else if(typ=="web")
	{
		obj.value = obj.value.replace(/[^a-zA-Z0-9\-\_\.\Ã¼\Ã¶\Ã¤\Ã„\Ãœ\Ã–]*$/,"");
	}
	
}var receiveReq = null;

if (window.XMLHttpRequest)
{
	receiveReq = new window.XMLHttpRequest(); //Not IE
	//receiveReq.overrideMimeType('text/xml; charset=ISO-8859-1');
}
else if(window.ActiveXObject)
{
	receiveReq = new window.ActiveXObject("Microsoft.XMLHTTP"); //IE
}
else
{
	alert("kein ajax!");
}

var ajax = 
{
	init: function(res,blend)
	{
		this.receiveReq = null;
		this.resultObj = null;
		this.blendObj = null;
		this.time = 0;
		this.ready = true;
		
		if (window.XMLHttpRequest)
		{
			this.receiveReq = new window.XMLHttpRequest(); //Not IE
		}
		else if(window.ActiveXObject)
		{
			this.receiveReq = new window.ActiveXObject("Microsoft.XMLHTTP"); //IE
		}
		else
		{
			alert("kein ajax!");
		}
		
		this.resultObj = document.getElementById(res);
		this.blendObj = document.getElementById(blend);
		
		this.setOpacity(this.resultObj,0);
		this.setOpacity(this.blendObj,100);
		
		this.resultObj.style.display = "none";
		this.blendObj.style.display = "block";
		
		this.time = 40;
	},
	
  	encodeUTF8: function (data)
	{
		var d = data.split("?");
		
		if(d[1] != null)
		{
			var help = null;
			var v = d[1].split("&");
			data = d[0]+"?";
		
			for(var loop = 0;loop < v.length;loop++)
			{
				if(loop != 0) data += "&";
				
				help = v[loop].split("=");
				
	 			data += help[0]+"="+encodeURIComponent(help[1]);
			}
			
			data += "&fuie="+Math.random();
		}
		else
		{
			data += "?fuie="+Math.random();
		}
		
		return data;
	},
	
  	get: function (datei)
	{
        if(this.receiveReq)
		{
			if((this.receiveReq.readyState == 4 || this.receiveReq.readyState == 0) && this.ready)
    		{
    		  	/*if(datei == "chat.php")
    			{
    				this.resultObj.style.overflow = "hidden";
					this.blendObj.style.overflow = "hidden";
    			}
    			else
    			{
    				this.resultObj.style.overflow = "auto";
					this.blendObj.style.overflow = "auto";
    			}*/
                
                this.resultObj.style.overflow = "visible";
				this.blendObj.style.overflow = "visible";
			     
                if(check_login)resetAllVar();
                datei = this.encodeUTF8(datei);
                          
    			this.ready = false;
    			this.receiveReq.open("GET", "/script/php/"+datei);
   	 			this.receiveReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=utf-8");
   				this.receiveReq.onreadystatechange = this.set;
     			this.receiveReq.send(null);  
 			}
 		}
	},
	
  	change: function ()
	{		
		if(this.resultObj.style.display == "none")
		{
			window.setTimeout("ajax.blendObj.innerHTML='';'none';ajax.resultObj.style.display='block';ajax.blendObj.style.display='none';ajax.ready=true;",(this.time*11));
		}
		else
		{
			window.setTimeout("ajax.resultObj.innerHTML='';ajax.resultObj.style.display='none';ajax.blendObj.style.display='block';ajax.ready=true;",(this.time*11));
		}
	},
	
	setOpacity: function (obj,opacity) 
	{	
  		obj.style.KHTMLOpacity = opacity/100;
  		obj.style.MozOpacity = opacity/100;
  		obj.style.opacity = opacity/100;
	},
	
	set: function ()
	{	       
		if(ajax.receiveReq.readyState == 4)
	    {
	    	var loop = 0;
	    	
	    	ajax.change();
	    	
			ajax.resultObj.style.display = "block";
			ajax.blendObj.style.display = "block";
	    	
			if(ajax.resultObj.style.opacity < ajax.blendObj.style.opacity)
	    	{
	    		for(;loop <= 10;loop++)
	    		{
	    			window.setTimeout("ajax.setOpacity(ajax.resultObj,"+(loop*10)+");ajax.setOpacity(ajax.blendObj,"+(100-(loop*10))+");",(ajax.time*loop));
	    		}
	    		ajax.resultObj.innerHTML = ajax.receiveReq.responseText;
	    	}
	    	else
	    	{
	    		for(;loop <= 10;loop++) 
	    		{
	    			window.setTimeout("ajax.setOpacity(ajax.blendObj,"+(loop*10)+");ajax.setOpacity(ajax.resultObj,"+(100-(loop*10))+");",(ajax.time*loop));	
	    		}
	    		ajax.blendObj.innerHTML = ajax.receiveReq.responseText;
	    	}
	    	
	    	hidden("loader");
		}
		else
		{
			visible("loader");
		}
	}	
}; var button = 
{
	init: function(typ)
	{
        if(typ == "ssl")
        {
            this.target = "https://ssl.expert-button.de/"; 
        }
        else if(typ == "beta")
        {
            this.target = "http://beta.expert-button.de/";    
        }
        else
        {
            this.target = "http://www.expert-button.de/";
        }

        this.code_1 = "<div style=\"[code1]\" id=\"expertbuttonbg\"><a target=\"_blank\" title=\"\" style=\"display: block;text-align: center; background-color: transparent;\" id=\"expertbuttonlink\" href=\"http://www.\"><img src=\"http://www.expert-button.de/eb.png\" alt=\"\"/></a></div>";
        this.code_2 = "<script type='text/javascript' id='JeX2' src='"+ this.target +"js_2.js'></script>";
	},
	
	showPos: function(pos1,pos2,wert1,wert2)
	{
		this.obj = document.createElement("div");
		document.body.appendChild(this.obj);
		
		if(pos1 == "left")
		{
			this.obj.style.left = wert1+"px";	
		}
		if(pos1 == "right")
		{
			this.obj.style.right = wert1+"px";	
		}
		if(pos2 == "bottom")
		{
			this.obj.style.bottom = wert2+"px";	
		}
		if(pos2 == "top")
		{
			this.obj.style.top = wert2+"px";	
		}
		
		this.obj.style.position = "fixed";
		this.obj.style.height = "118px";
		this.obj.style.width = "150px";
		
		this.obj.style.backgroundImage = "url(/image/button_hintergrund/button_x_001.png)";
		this.obj.style.backgroundColor = "transparent";
		this.obj.style.border = "1px solid #CCCCCC";
	},
	
  	hiddePos: function ()
	{
		document.body.removeChild(this.obj);
	},
    
   	createCode: function(obj_id1,obj_id2,code1,code2)
	{
	    var re = new Array();
        
        var help = "";
        
        if(code1.length != undefined)
        {
            code1 = code1.split(",");
            
            if(code1[0] != undefined)
            {
                help += "position:"+code1[0]+";";
            }
            if(code1[1] != undefined)
            {
                help += "top:"+code1[1]+"px;";
            }
            if(code1[2] != undefined)
            {
                help += "right:"+code1[2]+"px;";
            }
            if(code1[3] != undefined)
            {
                help += "bottom:"+code1[3]+"px;";
            }
            if(code1[4] != undefined)
            {
                help += "left:"+code1[4]+"px;";
            }
            if(code1[5] != undefined)
            {
                help += "z-index:"+code1[5]+";";
            }
        }
        
        code1 = help+'overflow:hidden;font-size:9px;height:auto;width:auto;text-align:center;margin:auto;';
        
		code1 == undefined ? this.str_code1 = "" : this.str_code1 = code1;  
        code2 == undefined ? this.str_code2 = "" : this.str_code2 = code2;
               
    	if(obj_id1 == "" && obj_id2 == "")
		{
			re[0] = this.code_1.replace("[code1]",this.str_code1);
            re[1] = this.code_2.replace("[code2]",this.str_code2);
		}
		else
		{
            if(obj_id1 == obj_id2)
            {
                document.getElementById(obj_id1).value = this.code_1.replace("[code1]",this.str_code1)+"\n"+this.code_2.replace("[code2]",this.str_code2);
            }
            else
            {
                document.getElementById(obj_id1).value = this.code_1.replace("[code1]",this.str_code1);
                document.getElementById(obj_id2).value = this.code_2.replace("[code2]",this.str_code2);
            }		
		}  
           
        return re;
        
	},
    
	replaceCode: function(obj_old_id,obj_new_id,code1,code2)
	{		
		if(document.getElementById(obj_old_id).value != "")
		{
            tmp = this.createCode("","",code1,"");
			document.getElementById(obj_new_id).value = document.getElementById(obj_old_id).value.replace("</body>",tmp[0]+"\n"+tmp[1]+"\n</body>"); 
			 	
		}
	},                   
    
    eXalert:function()
    {
        try
        {
            var wi = window.open('/script/php/4flash/alert.php','alert','width=870,height=150,left=100,top=200');
            wi.focus();    
        }
        catch(e){}
    }
};

function oneLine(obj_id)
{
    var obj = document.getElementById(obj_id);
    
    obj.value = obj.value.replace(/\n|\t|[ ]{2}/gi,"");
}

/*
requestURL = new URLRequest("javascript:var exbutton = 
{    
    check:function(obj_h,obj_w)
    {
        this.obj = document.getElementById('expertbutton');
        this.bg = document.getElementById('expertbuttonbg');
        this.l = document.getElementById('expertbuttonlink');
        
        if(!this.l && (this.bg.innerHTML.search('<a href=') == -1))
        {
            this.bg.innerHTML = this.bg.innerHTML + '<a href=\"http://www.expert-button.de\" id=\"expertbuttonlink\" style=\"display: none; color: #969696; font-weight:normal; text-decoration:none;font-size:9px;text-align:center;font-family:Arial,Calibri,sans-serif;font-weight:normal;background-color:transparent;\" title=\"online chat software\">expert-button.de</a>';
            this.l = document.getElementById('expertbuttonlink');
        }
        
        try
        {
            this.bg.style.display = 'block';
            if(this.l != null) this.bg.style.width = obj_w+'px';
            this.bg.style.height = 'auto';    
            
            this.obj.height = obj_h;
            this.obj.width = obj_w;
            
            if(obj_h > 1 && obj_w > 1)
            {
                if(this.l != null)this.l.style.display = 'block';
            }
            else
            {
                if(this.l != null)this.l.style.display = 'none';
            }
        }
        catch(err){alert(err);}
        
    },
    
    get:function(url)
    {
        try
        {
            this.win = window.open('"+_externURL+"Xbutton.php?web='+url, 'expertbutton', 'resizable=no,location=no,width=400,height=600,left=10000,top=0,menubar=no,status=no');
            this.win.focus();
        }
        catch(err)
        {
            alert('Um den Beratungsraum nutzen zu können, beachten Sie bitte die Hinweiszeile oben. -> Das Popup wurde blockiert. Bestätigen Sie \"Popup von dieser Seite immer zulassen.\" und klicken Sie anschließend erneut auf den Button.');            
        }     
    }
};
");

var _requestURL:URLRequest=new URLRequest("javascript:
var exbuttonHin = 
{        
    init: function(content)
   	{
        if(content != 0)
        {        
			this.div = document.createElement('div');
			this.main = document.createElement('div');
            this.close = document.createElement('div');
		
            this.div.setAttribute('style','background-color: white;height: auto; width: 220px; border: solid 1px; overflow: hidden;padding: 12px; margin: 0px auto;font-family: Arial;font-weight:bold;line-height: 23px;-moz-box-shadow:0px 2px 12px #888888;-moz-border-radius: 0px 0px 10px 10px; color: black;text-align:center; cursor: pointer;');
            this.div.setAttribute('onclick','try{this.win = window.open(\""+_externURL+"Xbutton.php?web=\"+window.location.hostname.replace(\"www.\",\"\"), \"expertbutton\", \"resizable=no,location=no,width=400,height=600,left=10000,top=0,menubar=no,status=no\");this.win.focus();}catch(err){};');
            this.div.setAttribute('title','zum Live-Chat');
            
			this.main.setAttribute('id','ebHinweis');
			this.main.setAttribute('style','width: 100%;position: fixed; top: -1px;');
  			this.main.setAttribute('onclick','exbuttonHin.kill();');
            this.main.setAttribute('onmouseover','exbuttonHin.stop();');
  			
            this.close.setAttribute('style','background-color: transparent;height: auto; width: 220px; border: none; overflow: hidden;padding: 0px; margin: 0px auto;font-family: Arial;line-height: 15px;color: gray; text-align:center; cursor: pointer; font-size: 10px;');
            this.close.setAttribute('onclick','exbuttonHin.kill();');
            this.close.setAttribute('title','schlie&szlig;en');
            this.close.innerHTML = 'schlie&szlig;en';
            
  			this.div.innerHTML = content;
  		
  			this.main.appendChild(this.div);
  			this.main.appendChild(this.close);
  			document.body.appendChild(this.main);
			  
			this.s = 0;
        }
	}
};
");

var _requestURL:URLRequest=new URLRequest("javascript:
exbuttonHin.setOpacity = function (opacity) 
	{	
		this.main.style.KHTMLOpacity = opacity/10;
		this.main.style.MozOpacity = opacity/10;
		this.main.style.opacity = opacity/10;
    };
	
exbuttonHin.kill = function ()
    {
        try
        {
            document.body.removeChild(this.main);
        }
        catch(err){}
    };
	
exbuttonHin.stop = function () 
	{	
		this.s = 1;	
	};
	
exbuttonHin.blink = function(akt,ziel)
	{
		ziel += akt;
		this.setOpacity(ziel);
		
		if((ziel == 0 || ziel == 10) && !this.s)
		{
			if(ziel==10){
				window.setTimeout('exbuttonHin.blink(-1,10);',1000);
				
			}
            else
            {
				window.setTimeout('exbuttonHin.blink(1,0);',1000);
			}
		}
		else
		{
			if(this.s)
			{
			    if(ziel<10)
				window.setTimeout('exbuttonHin.blink(1,'+ziel+');',100);	
			}
            else
            {
                window.setTimeout('exbuttonHin.blink('+akt+','+ziel+');',100);
            }
        }
    };
exbuttonHin.ka = function(){};
exbuttonHin.ka();
    
");

var _requestURL:URLRequest=new URLRequest("javascript:exbuttonHin.blink(-1,10);");
*/function mach()
{	
	var obj_main = document.getElementById('result');
	
	if ((receiveReq.readyState == 4))
    {	
		obj_main.innerHTML = receiveReq.responseText;
	
		hidden('loader');                 
	}
 	else
  	{
 		visible('loader');
   	}
}
function mach_innerHTML()
{	
	var obj_main = document.getElementById(single_id);
	
	if ((receiveReq.readyState == 4))
    {	
		obj_main.innerHTML = receiveReq.responseText;
			
		hidden('loader');
		single_id = "";	     
	}
 	else
  	{
 		visible('loader');
   	}
}
function mach_save()
{	
	if ((receiveReq.readyState == 4))
    {		
		hidden('loader');                 
	}
 	else
  	{
 		visible('loader');
   	}
}

var single_id = "";

function mach_single()
{
	var obj_main = document.getElementById(single_id);
	
	if ((receiveReq.readyState == 4))
    {	
		lboxOn(receiveReq.responseText);
		
		hidden('loader');
		
		single_id = "";		                
	}
	 else
  	{
 		visible('loader');
   	}
}

function mach_value()
{
	var obj_main = document.getElementById(single_id);
	
	if ((receiveReq.readyState == 4))
    {	
		obj_main.value = receiveReq.responseText;
		
		hidden('loader');                 
	}
	 else
  	{
 		visible('loader');
   	}
}


function mach_comp()
{	
	if ((receiveReq.readyState == 4))
    {	
		var erg = receiveReq.responseText;
		
		arr = erg.split("||");
		
		hidden('loader');    
	}
 	else
  	{
 		visible('loader');
   	}
}var check_datei = "";

function hol(datei)
{	
	ajax.get(datei);
}
function hol_innerHTML(datei,obj_id)
{   
	single_id = obj_id;
	if(check_login)resetAllVar();
	
 	if (receiveReq.readyState == 4 || receiveReq.readyState == 0)
    {
  		receiveReq.open("POST", "/script/php/"+datei);
  		receiveReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=utf-8");
 		receiveReq.onreadystatechange = mach_innerHTML;
  		receiveReq.send(null);
  	}
}

function hol_single(datei,obj_id)
{
	if(check_login)resetAllVar();
    single_id = obj_id;
    
    edit_ziel = "";
    
    if (receiveReq.readyState == 4 || receiveReq.readyState == 0)
    {
  	 	if(datei.indexOf("?") != -1)
    	{
			datei += "&fuie="+Math.random();
    	}
    	else
    	{
    		datei += "?fuie="+Math.random();
    	}
    	
    	receiveReq.open("GET", "/script/php/"+datei);
   	 	receiveReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=utf-8");
   		receiveReq.onreadystatechange = mach_single;
     	receiveReq.send(null);
 	}
}

function hol_value(datei,obj_id)
{
   single_id = obj_id;
    
    edit_ziel = "";
    
    if (receiveReq.readyState == 4 || receiveReq.readyState == 0)
    {
		if(datei.indexOf("?") != -1)
    	{
			datei += "&fuie="+Math.random();
    	}
    	else
    	{
    		datei += "?fuie="+Math.random();
    	}
    	
    	receiveReq.open("GET", "/script/php/"+datei);
   	 	receiveReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=utf-8");
   		receiveReq.onreadystatechange = mach_value;
     	receiveReq.send(null);
 	}
}

function hol_save(datei)
{   
	receiveReq.abort();
	
 	if (receiveReq.readyState == 4 || receiveReq.readyState == 0)
    {
   		if(datei.indexOf("?") != -1)
    	{
			datei += "&fuie="+Math.random();
    	}
    	else
    	{
    		datei += "?fuie="+Math.random();
    	}
    	
  		receiveReq.open("GET", "/script/php/"+datei);
  		receiveReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=utf-8");
		receiveReq.onreadystatechange = mach_save;
  		receiveReq.send(null);
  	}
}

function hol_comp(datei)
{   
	
 	if (receiveReq.readyState == 4 || receiveReq.readyState == 0)
    {
       	if(datei.indexOf("?") != -1)
    	{
			datei += "&fuie="+Math.random();
    	}
    	else
    	{
    		datei += "?fuie="+Math.random();
    	}
    	
  		receiveReq.open("GET", "/script/php/"+datei);
  		receiveReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=utf-8");
		receiveReq.onreadystatechange = mach_comp;
  		receiveReq.send(null);
  	}
}function checkFirmID(ziele,welt)
{
	var ziele_arr = ziele.split("||");
	
	if(document.getElementById(welt).value == "e")
	{
		displayOn(ziele_arr[0]);
		displayOn(ziele_arr[1]);
	}
	else
	{
		displayOff(ziele_arr[0]);
		displayOff(ziele_arr[1]);
	}
}
function checkReg(obj_id)
{
	var check = false;
	var help = "";
	
	var anrede_v = getValueByName("anrede"); 
	
	if(anrede_v == "")
	{
		lboxOn("Sie haben Ihre Anrede noch nicht gewÃ¤hlt.","fehler");
		
		slide.down('reg1');slide.up('reg2');slide.up('reg3');	
	}
	else
	{
		var typ_v = getValueByName("typ"); 
	
		if(typ_v == "")
		{
			lboxOn("Bitte wÃ¤hlen Sie den Typ zu dem Sie gehÃ¶ren.","fehler");
			
			slide.down('reg1');slide.up('reg2');slide.up('reg3');	
		}
		else
		{
			
			var firma_obj = document.getElementById("firma");
						
			if((firma_obj.value.length < 1) && (typ_v == "firm"))
			{
				lboxOn("Bitte geben Sie den Namen Ihrer Firma ein.","fehler");
				
				slide.down('reg1');slide.up('reg2');slide.up('reg3');
			}
			else
			{			
				var vname_obj = document.getElementById("vname");
						
				if(vname_obj.value.length < 3)
				{
					lboxOn("Bitte geben Sie einen Vornamen mit min. 3 Zeichen ein.","fehler");
					
					slide.down('reg1');slide.up('reg2');slide.up('reg3');
				}
				else
				{
					var nname_obj = document.getElementById("nname");
					
					if(nname_obj.value.length < 3)
					{
						lboxOn("Bitte geben Sie einen Nachnamen mit min. 3 Zeichen ein.","fehler");
						
						slide.down('reg1');slide.up('reg2');slide.up('reg3');
					}
					else
					{
						var tel_obj = document.getElementById("tel");
						
						if(tel_obj.value.length < 1)
						{
							lboxOn("Bitte geben Sie Ihre Telefonnummer an.","fehler");
							
							slide.down('reg1');slide.up('reg2');slide.up('reg3');
						}
						else
						{		
							var www_obj = document.getElementById("www");
							var www_w_obj = document.getElementById("www_w");
										
							help = www_obj.value;
									 
							help = help.replace("http://www.", "");
							help = help.replace(/www./i, "");
							help = help.replace("http", "");
							help = help.replace(":", "");
							help = help.replace("//", "");
															
							www_obj.value = help.split("/")[0].toLowerCase();
										
							help = www_w_obj.value;
										 
							help = help.replace("http://www.", "");
							help = help.replace(/www./i, "");
							help = help.replace("http", "");
							help = help.replace(":", "");
							help = help.replace("//", "");
										
							www_w_obj.value = help.split("/")[0].toLowerCase();
									
							if((www_obj.value != www_w_obj.value) || (www_obj.value == "") || (www_w_obj.value == "") || (www_obj.value.search(/^[a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+\.[a-zA-Z]{2,}$/) == -1))
							{
								lboxOn("Bitte geben Sie Ihre Internetseite ein und wiederholen Sie die Eingabe direkt darunter.","fehler");	
								slide.up('reg1');slide.down('reg2');slide.up('reg3');
							}
							else
							{
								var email_obj = document.getElementById("email");
								
								if(email_obj.value == "" || (email_obj.value.search(/[a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+([-+.][a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+)*@[a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+([-.][a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+)*\.[a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+([-.][a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+)*([,;]\s*[a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+([-+.][a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+)*@[a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+([-.][a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+)*\.[a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+([-.][a-zA-Z0-9\-\.\Ã¤\Ã¼\Ã¶\ÃŸ]+)*)*/) == -1))
								{
									lboxOn("Bitte geben Sie Ihre E-Mail-Adresse an.","fehler");
										
									slide.up('reg1');slide.up('reg2');slide.down('reg3');
								}	
								else
								{
									var pw_obj = document.getElementById("pw");
									var pw_w_obj = document.getElementById("pw_w");
																	
									if(pw_obj.value != pw_w_obj.value || pw_obj.value.length < 6)
									{
										lboxOn("Bitte geben Sie Ihr Passwort an. Wiederholen Sie die Eingabe direkt darunter.Achten Sie darauf, dass Ihr Passwort eine MindestlÃ¤nge von 6 Zeichen hat.","fehler");
										pw_obj.value = "";
										pw_w_obj.value = "";
										
										slide.up('reg1');slide.up('reg2');slide.down('reg3');
									}
									else
									{
										check = true;
									}
								}	
							}
						}
					}
				}
			}	
		}
	}

	
	if(check)
	{
		lboxOn("Hiermit bestÃ¤tigen Sie, dass Sie die <a href='/script/php/download.php?ziel=nutzungsbedingungen' target='_blank'>Nutzungsbedingungen</a> <br />gelesen und verstanden haben und diesen zustimmen.","aufruf","document.getElementById(\""+obj_id+"\").submit();");
	}
}
function checkPW()
{
	var pw = document.getElementById("passwort");
	var pww = document.getElementById("passwortw");
	
	if(pw.value.length >= 6)
	{
		if(pw.value == pww.value)
		{
			hol_save("prof.php?ziel=passwort&neu="+pw.value);
			
			pw.disabled = true;
			pww.disabled = true;
			
			lboxOn("Ihr Passwort wurde geÃ¤ndert. Sie werden in 5 Sekunden ausgeloggt und kÃ¶nnen sich danach neu anmelden.","info");
			
			window.setTimeout("location.href='index.php?go=3';", 10000);
		}
		else
		{
			pw.value = "";
			pww.value = "";
			
			lboxOn("Ihr Passwort stimmt nicht mit der Wiederholung Ã¼berein!","fehler");
		}
	}
	else
	{
		lboxOn("Ihr Passwort muss eine min. eine LÃ¤nge von 6 Zeichen besitzen.","fehler");
	}	
}
function checkEmail()
{
	var email = document.getElementById("email");
	var emailw = document.getElementById("emailw");
	
	if(email.value == emailw.value)
	{
		hol_single("prof.php?ziel=email&neu="+email.value);
		
		email.value = "";
		emailw.value = "";		
	}
	else
	{
		email.value = "";
		emailw.value = "";
		
		lboxOn("Die E-Mail-Adresse stimmt nicht mit der Wiederholung Ã¼berein. Bitte wiederholen Sie Ihre Eingabe.","fehler");
	}
}
function checkKontodaten(datei,wahl)
{
	
	if(wahl == "einzug")
	{
		var blz = document.getElementById("blz");
		var bank = document.getElementById("bank");
		var inhaber = document.getElementById("inhaber");
		var nummer = document.getElementById("nummer");	
	 
		if(blz.value != "" && bank.value != "" && inhaber.value != "" && nummer.value != "")
		{			
			blz.value = blz.value.replace(/ /gi,"");
			nummer.value = nummer.value.replace(/ /gi,"");
		
			if(!IsNumeric(blz.value))
			{
				lboxOn("Bitte korregieren Sie die BLZ.","fehler");
			}
			else if(!IsNumeric(nummer.value))
			{
				lboxOn("Bitte korregieren Sie Ihre Kontonummer.","fehler");
			}
			else
			{
				hol(datei+"&wahl="+wahl+"&blz="+blz.value+"&bank="+bank.value+"&inhaber="+inhaber.value+"&nummer="+nummer.value);
			}
			
		}
		else
		{
			lboxOn("Bitte fÃ¼llen alle Felder mit Ihren Daten aus.","fehler");
		}	
	}
	else if((wahl == "vorab")||(wahl == "paypal"))
	{
		hol(datei+"&wahl="+wahl+"&welt="+welt);
	}
}

function checkRechnungAdresse(datei,welt)
{
	var name = document.getElementById("name");
	var firma = document.getElementById("firma");
	var idnr = document.getElementById("idnr");
	var abteilung = document.getElementById("abteilung");
	var ort = document.getElementById("ort");	
	var strasse = document.getElementById("strasse");
	var plz = document.getElementById("plz");
	var status = "";
	var status_obj = document.getElementsByName("nutzer_status");
	
	for(var loop = 0;loop < status_obj.length;loop++)
	{
		if(status_obj[loop].checked)
		{
			status = status_obj[loop].value;
		}
	}
	
	if(name.value != "" && ort.value != "" && strasse.value != "" && plz.value != "" && status != "" && ((idnr.value == "" && status == "priv" && welt == "e") || (idnr.value != "" && status == "firm" && welt == "e") ||  (welt != "e"))&&((firma.value != "" && status == "firm")||status == "priv"))
	{
		hol(datei+"&name="+name.value+"&ort="+ort.value+"&strasse="+strasse.value+"&plz="+plz.value+"&abteilung="+abteilung.value+"&nutzer_status="+status+"&idnr="+idnr.value+"&firma="+firma.value);
	}
	else
	{
		lboxOn("Bitte fÃ¼llen Sie alle Felder mit Ihren Daten aus.","fehler");
	}	
}

function checkVertrag(ziel)
{
	if(ziel)
	{
		lboxOn("Hiermit bestÃ¤tigen Sie, dass Sie die <a href='script/php/sys/widerrufsbelehrung.pdf' target='_blank'>Widerrufsbelehrung</a> <br />gelesen und verstanden haben und dieser zustimmen.","aufruf","ajax.get(\""+ziel+"\");");
	}
}

function BrowserDetection()
{
	this.appName = "unbekannt";
	this.appVersion = "unbekannt";
	this.isIE = this.isFF = this.isOpera = this.isSafari = this.isChrome = false;
	this.UA = navigator.userAgent.toLowerCase();
    
	if(this.UA.search(/msie/) != -1)
	{
		this.appName = "Internet Explorer";
    	this.isIE = true;
    	this.appVersion = parseFloat(/(msie[^;]*)/.exec(this.UA)[0].split(" ")[1]);
    	
 	}else if(this.UA.search(/opera/) != -1)
 	{
    	this.appName = "Opera";
    	this.isOpera = true;
    	this.appVersion = parseFloat(/(opera[^\s]*)/.exec(this.UA)[0].split("/")[1]);
    	
  	}else if(this.UA.search(/firefox/) != -1)
  	{
    	this.appName = "Firefox";
    	this.isFF = true;
    	this.appVersion = parseFloat(/(firefox[^\s]*)/.exec(this.UA)[0].split("/")[1]);
    	
  	}else if(this.UA.search(/minefield/) != -1)
  	{
    	this.appName = "Firefox";
    	this.isFF = true;
    	this.appVersion = parseFloat(/(minefield[^\s]*)/.exec(this.UA)[0].split("/")[1]);
    	
  	}else if(this.UA.search(/khtml/) != -1)	
  	{
        if(this.UA.search(/chrome/) != -1)	
        {
            this.appName = "Chrome";
	        this.isChrome = true;
    	    this.appVersion = parseFloat(/(chrome[^\s]*)/.exec(this.UA)[0].split("/")[1]);
        }
        else
        {
    	   this.appName = "Safari";
    	   this.isSafari = true;
    	   this.appVersion = parseFloat(/(version[^\s]*)/.exec(this.UA)[0].split("/")[1]);
        }
  	}
}

var objUA = new BrowserDetection();  	

function flash_detection(required, max)
{
	var required_version = required;
	var max_version = max;
	var available_version = 0;

	if(typeof(navigator.plugins["Shockwave Flash"]) == "object")
	{
		var description = navigator.plugins["Shockwave Flash"].description;
		available_version = description.substr(16, (description.indexOf(".", 16) - 16));
	}
	else if(typeof(ActiveXObject) == "function")
	{
		for(var i = 2; i < (max_version + 1); i ++)
		{
			try
			{
				if(typeof(new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i)) == "object")
				{
					available_version = i;
				}
			}
			catch(error)
			{
				
			}
		}
	}
	return new Array(available_version, required_version);
}var slide = 
{
	init: function()
	{
		this.slideInUse = new Array();
		this.ready = true;
		this.helpObj = document.createElement('div');
		this.helpObj.setAttribute('style','height:auto; overflow:hidden; position: absolute; top:0px; visibility: hidden;');
		document.body.appendChild(this.helpObj);
		this.fps = 40;
	},
	
	up: function(obj_id,time)
	{
        if(time != null)
        {
            window.setTimeout("slide.up('"+obj_id+"');",time);
        }
        else
        {
    		if(this.ready != true)this.init();
    		
    		this.slideObj = document.getElementById(obj_id);
    		
            if(this.slideObj != null)
            {        
        		if((this.slideInUse[obj_id] != true) && (this.slideObj.style.height != "0px"))
        		{  	
        			this.slideInUse[obj_id] = true;
        		
        			this.slideObj.style.overflow='hidden';
        
        			var loop = 0;
        			var h = this.slideObj.offsetHeight;
        			var minPX = Math.round(h/13);
        			
            		for(;loop<=13;loop++)
            		{
            			if(minPX > h)
                		{
                			minPX=h;
                		}
                		h = h - minPX;
                		window.setTimeout("document.getElementById('"+obj_id+"').style.height='"+h+"px';",(this.fps*loop));
                		
        			}
        			window.setTimeout("slide.unUse('"+obj_id+"')",(this.fps*loop));
        		}
            }
        }
	},
	
	down: function(obj_id,time)
	{
        if(time != null)
        {
            window.setTimeout("slide.down('"+obj_id+"');",time);
        }
        else
        {
    		if(this.ready != true)this.init();
    		
    		var slideObj = document.getElementById(obj_id);
    		
            if(slideObj != null)
            {   
        		if((this.slideInUse[obj_id] != true) && (slideObj.offsetHeight == 0))
        		{
    		   	 
        			this.slideInUse[obj_id] = true;
        		
        			var loop = 0;
        			var maxH = this.get_h(slideObj);
        			var h = 0;
        			var minPX = Math.round(maxH/13);
        			
            		for(;loop<=13;loop++)
            		{
            			if(minPX > (maxH-h))
                		{
                			minPX = (maxH-h);
                			
                			window.setTimeout("document.getElementById('"+obj_id+"').style.height='auto';",(this.fps*(loop+1)));
                		}
                		
                		h = h + minPX;
                		window.setTimeout("document.getElementById('"+obj_id+"').style.height='"+h+"px';",(this.fps*loop));
                		
        			}
        			window.setTimeout("slide.unUse('"+obj_id+"')",(this.fps*loop));
        		}
            }
        }
	},
	
	get_h: function(obj)
	{
		this.helpObj.style.width = obj.offsetWidth+"px";
		this.helpObj.innerHTML = obj.innerHTML;
		
		return this.helpObj.offsetHeight;
	},
	
	unUse: function(obj_id)
	{
		slide.slideInUse[obj_id] = false;
	}
	,
	
	change: function(obj_id)
	{
		var obj = document.getElementById(obj_id);
	
        try
    	{
            if(obj.offsetHeight == 0)
            {
                this.down(obj_id);	
            }
            else
            { 
                this.up(obj_id);
            }   
    	}
        catch(e){}
	}
};function agb_out()
{

    document.getElementById('agb_div').style.visibility = 'hidden';   
    //document.Formular.submit_nldaten.value='Abmelden' 
    
}

function agb_in()
{

    document.getElementById('agb_div').style.visibility = 'visible';    
    //document.Formular.submit_nldaten.value='Abonnieren' 
    
}


function all_out()
{
    document.getElementById('all').style.display = 'none';
    
}



function submit_newsletter()
{
    document.Formular.submit();
}


var check_login = 0;
