// toggle_archive
function toggle_div ( targetId )
{
	if (document.getElementById)
	{
		target = document.getElementById( targetId );
		if (target.style.display == "none")
		{
			window.setTimeout("Effect.BlindDown('" + targetId + "', {duration:0.5})", 500);
		}
		else
		{
			window.setTimeout("Effect.BlindUp('" + targetId + "', {duration:0.5})", 500);
		}
	} // endif
} // endfunction

function toggle_submenu( targetId , headId, wrapperId, content, webcode, headline )
{
	if (document.getElementById)
	{
		target = document.getElementById( targetId );
		head = document.getElementById( headId );
		// Durchlaufe alle divs im Wrapper und setze Sie auf unsichtbar, außer target - der soll getoggled werden
		var divs = document.getElementById( wrapperId ).getElementsByTagName("div"); // alle divs im Wrapper
		for (var i = 0; i < divs.length; i++)
		{
			// Ausnahme: Klasse archive_head
			if(divs[i].className != "submenu_head" && divs[i].className != "submenu_distance")
			{
				if(divs[i].id == target.id)
				{
					if (target.style.display == "none")
					{
						target.style.display = "";
						window.setTimeout("set_content('"+targetId+"', '" + content + "', '" + webcode + "', '" + headline + "')", 500); // Gefaketen Loader abwarten
					}
					else 
					{
						target.style.display = "none";
						divs[i].innerHTML = '<img src="../grafik/design/indicator_green.gif" style="margin: 0 auto; padding-bottom: 5px;" />'; // Gefaketen Loader einbauen
					} // endif
				}
				else
				{
					divs[i].style.display = "none";
					divs[i].innerHTML = '<img src="../grafik/design/indicator_green.gif" style="margin: 0 auto; padding-bottom: 5px;" />'; // Gefaketen Loader einbauen
				}
			}
			else if(divs[i].className == "submenu_head")
			{
				if(divs[i].id == head.id)
				{
					if(head.style.backgroundPosition == "443px 0px")
					{
						divs[i].style.color = "#00a8b6";
						head.style.backgroundPosition = "443px -25px";
					}
					else
					{
						divs[i].style.color = "#9c9c9c";
						head.style.backgroundPosition = "443px 0px";
					}
				}
				else
				{
					divs[i].style.color = "#9c9c9c";
					divs[i].style.backgroundPosition = "443px 0px";
				}
			} // endif
		} // endfor
	} // endif
} // endfunction

function set_content( targetId , content, webcode, headline)
{
	if (document.getElementById)
	{
		target = document.getElementById( targetId );
		target.innerHTML = content + "<br><a href=\"?webcode=" + webcode + "\" title=\"" + headline + "\">mehr Informationen</a>";
	} // endif
} // endfunction

function slide_submenu( targetId , headId, wrapperId )
{
	if (document.getElementById)
	{
		target = document.getElementById( targetId );
		head = document.getElementById( headId );
		// Durchlaufe alle divs im Wrapper und setze Sie auf unsichtbar, außer target - der soll getoggled werden
		var divs = document.getElementById( wrapperId ).getElementsByTagName("div"); // alle divs im Wrapper
		for (var i = 0; i < divs.length; i++)
		{
			// Ausnahme: Klasse submenu_head
			if(divs[i].className != "submenu_head" && divs[i].className != "submenu_distance")
			{
				if(divs[i].id == target.id)
				{
					if (target.style.display == "none")
					{
						divs[i].style.color = "#00a8b6";
						window.setTimeout("Effect.BlindDown('" + divs[i].id + "', {duration:0.5})", 500);
						// Effect.BlindDown(divs[i].id, {duration:0.5});
					}
					else 
					{
						divs[i].style.color = "#9c9c9c";
						window.setTimeout("Effect.BlindUp('" + divs[i].id + "', {duration:0.5})", 500);
						// Effect.BlindUp(divs[i].id, {duration:0.5});
					} // endif
				}
				else
				{
					divs[i].style.color = "#9c9c9c";
					window.setTimeout("Effect.BlindUp('" + divs[i].id + "', {duration:0.5})", 500);
					// Effect.BlindUp(divs[i].id, {duration:0.5});
				} // endif
			}
			else if(divs[i].className == "submenu_head")
			{
				if(divs[i].id == head.id)
				{
					if(head.style.backgroundPosition == "443px 0px")
					{
						divs[i].style.color = "#00a8b6";
						head.style.backgroundPosition = "443px -25px";
					}
					else
					{
						divs[i].style.color = "#9c9c9c";
						head.style.backgroundPosition = "443px 0px";
					} // endif
				}
				else
				{
					divs[i].style.color = "#9c9c9c";
					divs[i].style.backgroundPosition = "443px 0px";
				}
			} // endif
		} // endfor
	} // endif
} // endfunction

function toggle_sliding( targetId )
{
	if (document.getElementById)
	{
		target = document.getElementById( targetId );
		if (target.style.display == "none")
		{
			window.setTimeout("Effect.BlindDown('" + targetId + "', {duration:0.5})", 500);
		}
		else
		{
			window.setTimeout("Effect.BlindUp('" + targetId + "', {duration:0.5})", 500);
		} // endif
	} // endif
} // endfunction