// JavaScript Document

/**************************************************************************************************************/
	// ersetzt getElementById
	function get( ID ) {
		return document.getElementById( ID );	
	}
	/**************************************************************************************************************/
	
	/**************************************************************************************************************/
	
	function makeError( Objekt ) {
		if( Obj = get( Objekt ) ) {																					// Get = getElementById => sieht funkction get() weiter oben
			Obj.style.backgroundColor	=	"#FBB";
			Obj.style.color				=	"red";			
			if( ObjError = get( Objekt + "Error" ) ) {																					// Get = getElementById => sieht funkction get() weiter oben			
				ObjError.style.display	=	"block";			
				ObjError.style.color	=	"red";							
			}
		}
	}
/**************************************************************************************************************/
	
	function makeError2( Objekt ) {
		if( Obj = get( Objekt ) ) {																					// Get = getElementById => sieht funkction get() weiter oben
			Obj.style.backgroundColor	=	"#FBB";
			if( ObjError = get( Objekt + "Errorn" ) ) {																					// Get = getElementById => sieht funkction get() weiter oben			
				ObjError.style.display	=	"block";			
				ObjError.style.color	=	"red";							
			}
		}
	}
/**************************************************************************************************************/	

	function reloadPage( clink )
	{
		window.location.href= clink;
	}
/**************************************************************************************************************/	

	function reloadPageAnhang( clink, anhang )
	{
		location.href	=	clink + anhang;
	}
/**************************************************************************************************************/


	function reloadPageAdmin()
	{
		Link	=	location.href;
		Link2	=	Link.split( "&" );
		Link	=	Link2[ 0 ];
		location.href	=	Link;
	}
/**************************************************************************************************************/
function hidevorstand( Name, AktuelleID ){
	Counter2 = 1;
	while( Div = get( Name + Counter2 ) ) {
		if( Counter2 != AktuelleID ){
			if( Div.style.display == 'block' || Div.style.display == '' ){
				$( '#' + Name + Counter2 ).slideToggle();
			}
		}
		Counter2++;		
	}
}
/**************************************************************************************************************/
function DisplayTag( Name, TagId )
{	
	if( Obj = get( Name + TagId ) )                                                                                    // Get = getElementById => sieht funkction get() weiter oben
	{
	
		if( Obj.style.display == 'none' ) 
		{
			Obj.style.display = '';
		}
		else{
			Obj.style.display = 'none';
		}
	}
}
/**************************************************************************************************************/
function changeAktiv (navp, id, befehl){
	Link	=	location.href;
	Link2	=	Link.split( "?" );
	Link	=	Link2[ 0 ];
	location.href	=	Link + '?do=' + navp + "&id=" + id + '&aktion=' + befehl;
}
/**************************************************************************************************************/
function changeLoeschen (navp, id, befehl){
	var check = confirm("Wollen Sie diese News wirklich löschen?");
	if(check == true){	
		Link	=	location.href;
		Link2	=	Link.split( "?" );
		Link	=	Link2[ 0 ];
		location.href	=	Link + '?do=' + navp + "&id=" + id + '&aktion=' + befehl;
	}
}
/**************************************************************************************************************/

function tooltip(modus, DivID, breite){
  var tooltip = get( DivID );
  if(modus == 'out')
    tooltip.style.display = 'none';
  else{
    tooltip.style.width = breite+'px';
    tooltip.style.display = 'block';
  }
}
/**************************************************************************************************************/

