///////////////////////////////////////////////////////////////////////////
// File: 	coma.js
// Author:	Frank Specht
// Date: 	2007-07-30
// Copyright (c) by Frank Specht, Oldenburg
///////////////////////////////////////////////////////////////////////////

var activePage		= "";
var menueBgOver		= "#730916";
var menueBgOut		= "#B8B6B6";
var menueTextOver	= "#ffffff";
var menueTextOut	= "#4B4D4B";

///////////////////////////////////////////////////////////////////////////
// void comaActivateMenue(char *menueID)
// Hauptmenue-Eintrag farblich ändern bei angewählter Seite
///////////////////////////////////////////////////////////////////////////
function comaActivateMenue(menueID)
{
	activePage = menueID;
	document.getElementById(menueID).style.backgroundColor = menueBgOver;
	document.getElementById("nav"+menueID+"Link").style.color = menueTextOver;
}

///////////////////////////////////////////////////////////////////////////
// void comaChangeMenue(char *menueID, bool over)
// Hauptmenue-Eintrag farblich ändern bei mouseover()
///////////////////////////////////////////////////////////////////////////
function comaChangeMenue(menueID, over)
{
	if (over)
	{	
		document.getElementById(menueID).style.backgroundColor = menueBgOver;
		document.getElementById("nav"+menueID+"Link").style.color = menueTextOver;
	}
	else
	{
		if (menueID != activePage)
		{
			document.getElementById(menueID).style.backgroundColor = menueBgOut;
			document.getElementById("nav"+menueID+"Link").style.color = menueTextOut;
		}
	}
}

///////////////////////////////////////////////////////////////////////////
// void comaOpenImage(char *image, int breite, int hoehe, char *title, char *text)
// Bild in externem Fenster öffnen
///////////////////////////////////////////////////////////////////////////
function comaOpenImage(image, breite, hoehe, title, text)
{
	var left = (screen.width - breite) / 2;
	var top	 = (screen.height - hoehe) / 2;
	
	if (text != "")
		hoehe += 100;
	
	var win;
	if (text.length > 340)
	{
		breite += 20;
		win = window.open(image,"_blank","width="+breite+",height="+hoehe+",left="+left+",top="+top+",location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=no");
	}
	else
		win = window.open(image,"_blank","width="+breite+",height="+hoehe+",left="+left+",top="+top+",location=no,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=no");

	win.document.writeln("<html><head><title>Bildergalerie</title>");
	win.document.writeln("<link rel='stylesheet' type='text/css' href='styles.css'></head>");
	win.document.writeln("<body>");
	win.document.writeln("<table border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='top' bgcolor='#96A5A8'>");
	win.document.writeln("<a href='javascript:window.close()'><img src='" + image + "' border='0'></a></td></tr>");
	win.document.writeln("<tr><td align='left' bgcolor='#96A5A8' height='18'><div style='padding-left:10px;padding-right:10px'><font class='bildtitel'>" + title + "</font></div></td></tr>");
	win.document.writeln("<tr><td align='left' valign='top'><div style='padding-top:5px;padding-left:10px;padding-right:10px'><font class='bild'>" + text + "</font></div></td></tr>");
	win.document.writeln("</table>");
	win.document.writeln("</body></html>");
}
