	
	function addElement3(myname,typ,id,rowid,counterid)
	{
	  NewRow = document.getElementById(rowid).lastChild.cloneNode(true);

	  document.getElementById(id).appendChild (NewRow);
		var old_count = Number(document.getElementById(counterid).value);
		
	  	var i = document.getElementById(id).childNodes.length - 1;
	  
	  	var new_count = old_count + 1;
	  	
	  	document.getElementById(counterid).value = new_count;
	   
	   	for(j=0;j<document.getElementById(id).lastChild.getElementsByTagName('input').length;j++)
  		{
		  var newname2 = myname + '_' + new_count;
		  var newname = 'value_' + new_count;
		 document.getElementById(id).lastChild.getElementsByTagName(typ)[0].setAttribute('name', newname) ;
		 document.getElementById(id).lastChild.getElementsByTagName(typ)[1].setAttribute('name', newname2) ;
	   	
	  var name = document.getElementById(id).lastChild.getElementsByTagName(typ)[j].name;

	//  document.getElementById(id).lastChild.getElementsByTagName(typ)[j].value=name;
  		}	  
	}

	

	// universal loader
	function ajax_load_get(url,uri,container,notification)
	{
		
		if(notification == undefined) var notification = false;
		
		var xhr = createXHR();
		var param = uri;
		var containerID = document.getElementById(container);
		if(xhr)
		{
			xhr.open('GET',url+param,true);
			
			xhr.onreadystatechange = function()
			{
				if(xhr.readyState == 4)
				{
					//alert('MiH2Su');
					// Reset Container ELmenent
					if(container != '')
					{
						containerID.innerHTML = '';
						containerID.innerHTML = xhr.responseText;
					}	
					if(notification != '' )
					{
					Show();
					// FadeBox f. Ausgabe 
					document.getElementById('fadeBox').innerHTML = notification;
					delay_fade();
					} 
				}
				else
				{
					//container.innerHTML = 'ReadyState ' + xhr.readyState;
				}
			};
			xhr.send(null);
		}
		else
		{
			alert('error create xhr');
		}
	}

		// universal loader POST
	function ajax_load_post(url,uri,container,notification)
	{
		
		if(notification == undefined) var notification = false;
		alert(container);
		var xhr = createXHR();
		var param = uri;
		var containerID = document.getElementById(container);
		if(xhr)
		{
			xhr.open('POST',url,true);
			xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xhr.setRequestHeader("Content-length", param.length);
			xhr.setRequestHeader("Connection", "close");
			xhr.onreadystatechange = function()
			{
				if(xhr.readyState == 4)
				{
					//alert('MiH2Su');
					// Reset Container ELmenent
					containerID.innerHTML = '';
					containerID.innerHTML = xhr.responseText;
					
					if(notification != '' )
					{
					Show();
					// FadeBox f. Ausgabe 
					document.getElementById('fadeBox').innerHTML = notification;
					delay_fade();
					} 
				}
				else
				{
					//container.innerHTML = 'ReadyState ' + xhr.readyState;
				}
				
			};
			xhr.send(param);
			
		}
		else
		{
			alert('error create xhr');
		}
	}
	// Value Getter
	
	function getValue(val)
	{
		return document.getElementById(val).value;
	}

	function loadRight(id,sid,modPfad,mod,modul,parent)
	{
		var xhr = createXHR();
		var param = sid + '&kid='+ id + '&mod=' + mod + '&modul=' + modul + '&parent=' + parent;
		var right = document.getElementById('right');
		if(xhr)
		{
			xhr.open('GET','../'+modPfad +'scripts/kat_ajax.php?'+param,true);
			xhr.setRequestHeader('Content-type','iso-8859-1');

			xhr.onreadystatechange = function()
			{
				if(xhr.readyState == 4)
				{
					right.innerHTML = '';
					right.innerHTML = xhr.responseText;
				}
				else
				{
					//right.innerHTML = 'ReadyState ' + xhr.readyState;
				}
			};
			xhr.send(null);
		}
		else
		{
			alert('error create xhr');
		}
	}
	function ask(url,msg)
	{
		if (confirm(msg) )
		{
			location.href = url;
		}
		else
		{
			return false;
		}
	}
	function checkOnEnter(e)
	{
			var keycode;
 			if(e.which)
 			{
 				/*FF*/
 				keycode = e.which;
 			}
 			else if(window.event)
 			{
 				keycode = e.keyCode;
 			} 
  
			  if(keycode == 13)
			  {
			  	sendSearch();
			  }
			  else
			  {
			  return true;
			  }
	}
	//--------------------------------------------------------------------------
	// setter
	function setter(id,val)
	{
		document.getElementById(id).value = val;
		return; 
	}
	// setPic
	function setPic(id,val)
	{
		document.getElementById(id).src = val;
		return;
	}
	
	//--------------------------------------------------------------------------
	// Notifications
	// Trigger
	function delay_fade()
	{
		window.setTimeout('Hide()',2000);
	}
	
	//Show Message
	function Show()
	{
		document.getElementById('fadeBox').style.display = 'block';		
	}
	
	// Restore StyleProperties fadeBox
	
	function Hide()
	{
		document.getElementById('fadeBox').style.display = 'none';
	}
	
	//--------------------------------------------------------------------------
	
