function ShowHide(id)
{
  var itm = null;
  if (document.getElementById) {
	itm = document.getElementById(id);
  } else if (document.all){
	itm = document.all[id];
  } else if (document.layers){
	itm = document.layers[id];
  }

  if (!itm) {
   // do nothing
  }
  else if (itm.style) {
	if (itm.style.display == "none") {
	  itm.style.display = "";
	}
	else {
	  itm.style.display = "none";
	}
  }
  else {
	itm.visibility = "show";
  }
}


/** 
 * Das ganze Gerumpel für das Ein und Ausblenden der SideBoxes.
 * @author Niklas Funke
 * @date 16.03.2007
 */
Box = {
	
	/** Statuswerte für Auf und Zu */
	s : {
		auf : 1,
		zu 	: 2,
		none : "none",
		block : "block"
	},
	
	/** 
	 * Schaltet zwischen Ein und Ausgeblendet hin und her.  
	 * @access public
	 * @param String id	ID des aus-/einzublendenden Feldes.
	 */
	swap : function (id) {
		obj = document.getElementById(id);
		obj.style.display = obj.style.display == this.s.none ? this.s.block : this.s.none;
		this._set(id, ((obj.style.display == this.s.block) ? this.s.auf : this.s.zu));
	},
	show : function (id) {
		obj = document.getElementById(id);
		obj.style.display = this.s.block;
		this._set(id, this.s.auf);
	},
	hide : function (id) {
		obj = document.getElementById(id);
		obj.style.display = this.s.none;
		this._set(id, this.s.zu);
	},
	
	/**
	 * Stellt den im Cookie gesetzten Zustand wieder her. Im Zweifelsfall 
	 * wird die Box immer angezeigt. 
	 * @access public
	 * @param String id	ID des wiederherzustellenden Feldes. 
	 */
	restore : function (id) {
		obj = document.getElementById(id);
		obj.style.display = (this._get(id) == this.s.auf) ? this.s.block : this.s.none;
	},
	
	/**
	 * Liest den Status des übergebenen Feldes aus.
	 * @access private
	 * @param String Kecksname Name des Cookies.
	 */
	_get : function (Keksname) {
		cookieWert 	= null;
		cookieArr = document.cookie.replace(/[ ]+/g, "").split(";");
		for(var i = 0; i < cookieArr.length; i++) {
			if (cookieArr[i].split("=")[0] == Keksname) {
				cookieWert = cookieArr[i].split("=");
				return cookieWert[1];
			}
		}
		
		// AKtuellen Zustand liefern wenn kein Wert im Kecks vorhanden.
		return obj.style.display == this.s.block ? this.s.auf : this.s.zu;
	},
	
	/**
	 * Setzt den übergebenen Wert unter übergebenen Namen.
	 * @access private
	 * @param String Kecksname	Name des Cookies
	 * @param String Keckswert	Zu setzender Wert.
	 */
	_set : function (Kecksname, Keckswert) { 
		document.cookie = Kecksname + "=" + Keckswert + "; expires=Sun, 01-Dec-2020 00:00:00 GMT; path=/"; 
	} 
}