var CatON		= "#ffb400";
var CatOFF		= "#cdcdcd";
var SubCatON	= "#ffffff";
var SubCatOFF	= "#e6e6e6";
var PageNavSection ="";
var PageNavSectionLink="";
var PageNavSubsection="";
var PageNavSubsectionLink="";
//detect browserm type and load system variables----------------------------

//default window name if ticker is closed
if (window.length==0) window.name = "main";
//==========================================================================

xbDetectBrowser();
function fillPageNavVariables(pageSection,pageSubsection)
{
	for (i = 1; i < MainTopMenu[0].length; i++)
	{ 
		if (pageSection ==MainTopMenu[0][i]) 
		{
			PageNavSection = MainTopMenu[0][i];
			PageNavSectionLink = MainTopMenu[1][i]  
		}
	}
	if (pageSubsection!=-1)
	{
		submenu = eval(lang + pageSection);
		//colors for cells onmouse over
		PageNavSubsection=submenu[0][pageSubsection];
		PageNavSubsectionLink=submenu[1][pageSubsection]
	}
}
function TDbg( Cell, CellColor)
{
if (browserType() != 'NS') 
	{
		CellRef = eval(Cell + ".style");
	//	alert(Cell + ".style");
		Color = eval(CellColor);
		CellRef.background = Color;
	}
}
//============================================================================================================
// function ShowTopMenu ======================================================================================
//============================================================================================================
function ShowTopMenu(lang,section,subsection,linksPrefix)
{
//alert(browserType());
var path = "../";
var mainTarget = "";
if  (section == "premium_fonds") mainTarget = " target='_top' ";
if (linksPrefix == null) path = "../"; else path = linksPrefix;
if (browserType() == 'NS' || browserType() == 'NS6' )
{  
	searchWidth="5"
}
else
{
	searchWidth="10"
}
var img_topmenu_go_1;
var img_topmenu_go_2;
if (lang == "g_")
	{
	img_topmenu_go_1 = "Suche Quotes";
	img_topmenu_go_2 = "Suche News";
	text_search = "suche"
	}
else
	{
	img_topmenu_go_1 = "Search Quotes";
	img_topmenu_go_2 = "Search News";
	text_search = "search"
	}
// Dictionaries for main top menu:
MainTopMenu = new Array(2);
for (i = 0; i < 2; i++)
	{
		MainTopMenu[i] = new Array(7);
	}
MainTopMenu[0][0] = "home"; MainTopMenu[1][0] = path + "default.asp";
MainTopMenu[0][1] = "news"; MainTopMenu[1][1] = path + "_news/news.asp";
MainTopMenu[0][2] = "markte"; MainTopMenu[1][2] = path + "_markets/index_center.asp";
MainTopMenu[0][3] = "fonds"; MainTopMenu[1][3] = path + "_fonds/fonds_default.asp";
MainTopMenu[0][4] = "tools"; MainTopMenu[1][4] = path + "_tools/tools.asp";
MainTopMenu[0][5] = "produkte"; MainTopMenu[1][5] = path + "_teletrader/productsf.asp";
MainTopMenu[0][6] = "teletrader"; MainTopMenu[1][6] =path + "_teletrader/teletrader.asp";

g_MainTopMenu_titles = new Array(7);
g_MainTopMenu_titles[0] = "home"; 
g_MainTopMenu_titles[1] = "news"; 
g_MainTopMenu_titles[2] = "m&auml;rkte";
g_MainTopMenu_titles[3] = "fonds"; 
g_MainTopMenu_titles[4] = "trader tools"; 
g_MainTopMenu_titles[5] = "produkte"; 
g_MainTopMenu_titles[6] = "teletrader";

e_MainTopMenu_titles = new Array(7);
e_MainTopMenu_titles[0] = "home"; 
e_MainTopMenu_titles[1] = "news"; 
e_MainTopMenu_titles[2] = "markets";
e_MainTopMenu_titles[3] = "funds"; 
e_MainTopMenu_titles[4] = "trader tools"; 
e_MainTopMenu_titles[5] = "products"; 
e_MainTopMenu_titles[6] = "teletrader";

// is there submenu layers or not:
MainTopMenu_SubExists = new Array(2);
for (i = 0; i < 2; i++)
	{
	MainTopMenu_SubExists[i] = new Array(7);
	}
MainTopMenu_SubExists[0][0] = "home"; MainTopMenu_SubExists[1][0] = 0;
MainTopMenu_SubExists[0][1] = "news"; MainTopMenu_SubExists[1][1] = 1;
MainTopMenu_SubExists[0][2] = "markte"; MainTopMenu_SubExists[1][2] = 1;
MainTopMenu_SubExists[0][3] = "fonds"; MainTopMenu_SubExists[1][3] = 1;
MainTopMenu_SubExists[0][4] = "tools"; MainTopMenu_SubExists[1][4] = 1;
MainTopMenu_SubExists[0][5] = "produkte"; MainTopMenu_SubExists[1][5] = 0;
MainTopMenu_SubExists[0][6] = "teletrader"; MainTopMenu_SubExists[1][6] = 0;


// keep buttonsizes for layer position:
xpositions = new Array(2);
for (i = 0; i < 2; i++)
	{
	xpositions[i] = new Array(7);
	}
xpositions[0][0] = "home"; xpositions[1][0] = 0;
xpositions[0][1] = "news"; xpositions[1][1] = 0;
xpositions[0][2] = "markte"; xpositions[1][2] = 0;
xpositions[0][3] = "fonds"; xpositions[1][3] = 100;
xpositions[0][4] = "tools"; xpositions[1][4] = 0;
xpositions[0][5] = "produkte"; xpositions[1][5] = 0;
xpositions[0][6] = "teletrader"; xpositions[1][6] = 0;

widthHeight = new Array(2);
for (i = 0; i < 2; i++)
	{
	widthHeight[i] = new Array(7);
	}
widthHeight[0][0] = "home"; 		widthHeight[1][0] = " width='50' ";
widthHeight[0][1] = "news"; 		widthHeight[1][1] = " width='49' ";
widthHeight[0][2] = "markte"; 		widthHeight[1][2] = " width='67' ";
widthHeight[0][3] = "fonds"; 		widthHeight[1][3] = " width='54' ";
widthHeight[0][4] = "tools"; 		widthHeight[1][4] = " width='84' ";
widthHeight[0][5] = "produkte"; 	widthHeight[1][5] = " width='76' ";
widthHeight[0][6] = "teletrader"; 	widthHeight[1][6] = " width='86' ";
// Submenus:
g_news = new Array(2);
for (i = 0; i < 2; i++)
	{
	g_news[i] = new Array(8);
	}
g_news[0][0] = "news overview"; 	g_news[1][0] = path + "_news/news.asp";
g_news[0][1] = "marktberichte"; 	g_news[1][1] = path + "_news/news_kategorien.asp?ID=5&Name=Marktberichte&subm=1";
g_news[0][2] = "unternehmen"; 		g_news[1][2] = path + "_news/news_kategorien.asp?ID=3&Name=Unternehmen&subm=1";
g_news[0][3] = "aktien research"; 	g_news[1][3] = path + "_news/news_kategorien.asp?ID=17&Name=Research&subm=1";
g_news[0][4] = "alle kategorien"; 	g_news[1][4] = path + "_news/news_kategorienOV.asp?subm=1";
g_news[0][5] = "sektoren"; 			g_news[1][5] = path + "_news/news_sektorenOV.asp?subm=2";
g_news[0][6] = "regionen"; 			g_news[1][6] = path + "_news/news_regionenOV.asp";
g_news[0][7] = "archive"; 			g_news[1][7] = path + "_news/news_arhiva.asp";

e_news = new Array(2);
for (i = 0; i < 2; i++)
	{
	e_news[i] = new Array(8);
	}
e_news[0][0] = "news overview"; 	e_news[1][0] = path + "_news/news.asp";
e_news[0][1] = "market reports"; 	e_news[1][1] = path + "_news/news_kategorien.asp?ID=5&Name=Market+Reports&subm=1";
e_news[0][2] = "company news"; 		e_news[1][2] = path + "_news/news_kategorien.asp?ID=3&Name=Company+News&subm=1";
e_news[0][3] = "stock research"; 	e_news[1][3] = path + "_news/news_kategorien.asp?ID=17&Name=Research&subm=1";
e_news[0][4] = "all categories"; 	e_news[1][4] = path + "_news/news_kategorienOV.asp?subm=1";
e_news[0][5] = "sectors"; 			e_news[1][5] = path + "_news/news_sektorenOV.asp?subm=2";
e_news[0][6] = "regions"; 			e_news[1][6] = path + "_news/news_regionenOV.asp";
e_news[0][7] = "archives"; 			e_news[1][7] = path + "_news/news_arhiva.asp";

g_markte = new Array(2);
for (i = 0; i < 2; i++)
	{
	g_markte[i] = new Array(8);
	}
// g_markte[0][] = "g_top_submenu_markte_overvi.gif"; // g_markte[1][] = "javascript: void(null);";
g_markte[0][0] = "index-center"; 			g_markte[1][0] = path + "_markets/index_center.asp";
g_markte[0][1] = "b&ouml;rsen"; 			g_markte[1][1] = path + "_markets/exchanges.asp";
// g_markte[0][] = lang + "top_submenu_research.gif"; // g_markte[1][] = "javascript: void(null);";
g_markte[0][2] = "w&auml;hrungen"; 			g_markte[1][2] = path + "_markets/wahrungen.asp";
g_markte[0][3] = "zinsen"; 					g_markte[1][3] = path + "_markets/interest_rates.asp";
g_markte[0][4] = "ipo countdown"; 			g_markte[1][4] = path + "_markets/ipo_countdown.asp";
g_markte[0][5] = "unternehmen"; 			g_markte[1][5] = path + "_markets/profileselect.asp";
g_markte[0][6] = "unternehmenskalender"; 	g_markte[1][6] = path + "_markets/company_calendar.asp";
g_markte[0][7] = "b&ouml;rsenlexikon"; 		g_markte[1][7] = path + "_markets/exchanges_lexicon.asp";


e_markte = new Array(2);
for (i = 0; i < 2; i++)
	{
	e_markte[i] = new Array(7);
	}
// e_markte[0][] = "g_top_submenu_markte_overvi.gif"; // e_markte[1][] = "javascript: void(null);";
e_markte[0][0] = "index center"; 		e_markte[1][0] = path + "_markets/index_center.asp";
e_markte[0][1] = "exchanges"; 			e_markte[1][1] = path + "_markets/exchanges.asp";
// e_markte[0][] = lang + "top_submenu_research.gif"; // e_markte[1][] = "javascript: void(null);";
e_markte[0][2] = "currencies"; 			e_markte[1][2] = path + "_markets/wahrungen.asp";
e_markte[0][3] = "interest rates"; 		e_markte[1][3] = path + "_markets/interest_rates.asp";
e_markte[0][4] = "ipo countdown"; 		e_markte[1][4] = path + "_markets/ipo_countdown.asp";
e_markte[0][5] = "companies"; 			e_markte[1][5] = path + "_markets/profileselect.asp";
e_markte[0][6] = "company calendar"; 	e_markte[1][6] = path + "_markets/company_calendar.asp";


g_produkte = new Array(2);
for (i = 0; i < 2; i++)
	{
	g_produkte[i] = new Array(4);
	}

g_produkte[0][0] = "products"; g_produkte[1][0] = "javascript:void(null)";
g_produkte[0][1] = "products"; g_produkte[1][1] ="javascript:void(null)";
g_produkte[0][2] = "products"; g_produkte[1][2] = "javascript:void(null)";
g_produkte[0][3] = "products"; g_produkte[1][3] = "javascript:void(null)";

e_produkte = new Array(2);
for (i = 0; i < 2; i++)
	{
	e_produkte[i] = new Array(4);
	}

e_produkte[0][0] = "products"; 	e_produkte[1][0] = "javascript:void(null)";
e_produkte[0][1] = "products"; 	e_produkte[1][1] = "javascript:void(null)";
e_produkte[0][2] = "products";	e_produkte[1][2] = "javascript:void(null)";
e_produkte[0][3] = "products";	e_produkte[1][3] = "javascript:void(null)";

	
g_fonds = new Array(2);
for (i = 0; i < 2; i++)
	{
	g_fonds[i] = new Array(5);
	}
g_fonds[0][0] = "fonds &uuml;berblick"; 	g_fonds[1][0] = path + "_fonds/fonds_default.asp";
g_fonds[0][1] = "KAG's"; 					g_fonds[1][1] = path + "_fonds/fonds_kags.asp";
g_fonds[0][2] = "suche"; 					g_fonds[1][2] = path + "_fonds/fonds_search.asp";
g_fonds[0][3] = "sparplanrechner"; 			g_fonds[1][3] = path + "_fonds/fonds_calc.asp";
g_fonds[0][4] = "fondslexikon"; 			g_fonds[1][4] = path + "_fonds/fonds_lexicon.asp";

e_fonds = new Array(2);
for (i = 0; i < 2; i++)
	{
	e_fonds[i] = new Array(4);
	}
e_fonds[0][0] = "funds overview"; e_fonds[1][0] = path + "_fonds/fonds_default.asp";
e_fonds[0][1] = "fund companies"; e_fonds[1][1] = path + "_fonds/fonds_kags.asp";
e_fonds[0][2] = "search"; e_fonds[1][2] = path + "_fonds/fonds_search.asp";
e_fonds[0][3] = "saving plan calculator"; e_fonds[1][3] = path + "_fonds/fonds_calc.asp";
g_tools = new Array(2);
for (i = 0; i < 2; i++)
	{
	g_tools[i] = new Array(4);
	}
g_tools[0][0] = "&nbsp;tools overview"; g_tools[1][0] = path + "_tools/tools.asp";	
g_tools[0][1] = "&nbsp;jTraderMap"; 	g_tools[1][1] = "'.' onclick='jTraderMap();return false;'";
g_tools[0][2] = "&nbsp;jTrader"; 		g_tools[1][2] = "'.' onclick='jTrader(\"TTAG\");return false;'";
//g_tools[0][3] = "&nbsp;jTraderSuite"; 	g_tools[1][3] = "'.' onclick='jTraderSuite();return false;'";
g_tools[0][3] = "command_center"; 		g_tools[1][3] = "'.' onclick='PowerCommandCenter();return false;'";
//g_tools[0][5] = "warrant_analyzer"; 	g_tools[1][5] = "warrantsDefault.asp";


e_tools = new Array(2);
for (i = 0; i < 2; i++)
	{
	e_tools[i] = new Array(4);
	}
e_tools[0][0] = "&nbsp;tools overview"; 	e_tools[1][0] = path + "_tools/tools.asp";	
e_tools[0][1] = "&nbsp;jTraderMap"; 		e_tools[1][1] = "'.' onclick='jTraderMap();return false;'";
e_tools[0][2] = "&nbsp;jTrader"; 			e_tools[1][2] = "'.' onclick='jTrader();return false;'";
//e_tools[0][3] = "&nbsp;jTraderSuite"; 		e_tools[1][3] = "'.' onclick='jTraderSuite();return false;'";
e_tools[0][3] = "command_center"; 			e_tools[1][3] = "'.' onclick='PowerCommandCenter();return false;'";
//e_tools[0][5] = "warrant_analyzer"; 		e_tools[1][5] = "warrantsDefault.asp";


e_teletrader = new Array(2);
for (i = 0; i < 2; i++)
	{
	e_teletrader[i] = new Array(3);
	}
e_teletrader[0][0] = "&nbsp;investors area"; e_teletrader[1][0] = "g_investors_area.asp";
e_teletrader[0][1] = "&nbsp;company overview"; e_teletrader[1][1] = "g_teletrader.asp?segment=company_overview";
e_teletrader[0][2] = "&nbsp;company history"; e_teletrader[1][2] = "g_teletrader.asp?segment=company_history";

g_teletrader = new Array(2);
for (i = 0; i < 2; i++)
	{
	g_teletrader[i] = new Array(3);
	}
g_teletrader[0][0] = "&nbsp;investors area"; g_teletrader[1][0] = "g_investors_area.asp";
g_teletrader[0][1] = "&nbsp;company overview"; g_teletrader[1][1] = "g_teletrader.asp?segment=company_overview";
g_teletrader[0][2] = "&nbsp;company history"; g_teletrader[1][2] = "g_teletrader.asp?segment=company_history";
// ==================================== the end of the 'dictionary'. =================================

var TDnumTOP;
TDNumTOP = 1;
TDname = "tdbTOP";

var mainbannerlink,smallbannerLink;
var aktuelni_skript;
aktuelni_skript = document.URL;
ireturn = generate_topmenu (lang,section,subsection,470,path);
if (ireturn != -1) submenuToShow = show_submenu (lang,section,subsection,ireturn,762,27,path); else submenuToShow = "&nbsp;";
document.write(
"<TABLE border='0' cellspacing='0' cellpadding='0' width='764'>"+
	"<TR>"+
		"<TD width='1' class='BackColorDarkDarkGrey'><IMG src='"+ path + "img/empty.gif' width='1' height='17' border='0' alt=''></td>"+
		"<TD class='BackColorDarkDarkGrey' nowrap WIDTH='763'>" + submenuToShow +"</TD>"+
	"</TR>"+
"</TABLE>");

document.write(	
"<TABLE border='0' cellspacing='0' cellpadding='0' width='764'>"+ 	
	"<TR>"+
		"<TD class='BackColorDarkBlue' width=1><IMG src='"+ path + "img/empty.gif' width='1' height='3' border='0' alt=''></TD>" +
		"<TD class='BackColorDarkBlue' width='762'><IMG src='"+ path + "img/empty.gif' width='762' height='1' border='0' alt=''></TD>"+
		"<TD class='BackColorDarkBlue' width='1'><IMG src='"+ path + "img/empty.gif' width='1' height='3' border='0' alt=''></TD>"+
	"</TR>" +
"</TABLE>" +	
"<TABLE border='0' cellspacing='0' cellpadding='0' width='764'>" +
	"<TR><TD class='TopMenuHeader' width='1'><IMG src='"+ path + "img/empty.gif' width='1' height='27' border='0' alt=''></TD>"+
		"<TD class='TopMenuHeader' nowrap WIDTH='442' valign='middle'>" +
			generateTopmenuNormalLinks(path,mainTarget) +
		"</TD>" +
		"<TD class='TopMenuHeader' valign='middle' width='320' nowrap align='right'>");
//search form
document.write(			
			"<TABLE border='0' cellspacing='0' cellpadding='0' width=280><form action='"+ path + "_markets/search_quotes.asp' name='quicksearchQuotes' onSubmit='return check_quotes(\"" + lang + "\");' "+mainTarget+"><tr><TD class='TopMenuHeader' valign='middle' nowrap><div>"+text_search+":</div></TD>"+
			"<TD class='TopMenuHeader' nowrap valign='middle'>" +
				"<input type='text' name='quickinput' size='"+ searchWidth +"' maxlength='50' value='Quotes' onClick='document.quicksearchQuotes.quickinput.value=\"\";document.quicksearchNews.quickinput.value=\"News\"' >" +
			"</TD>" +
			"<TD class='TopMenuHeader' nowrap valign='middle' width='40'><input type='image' src='"+ path + "img/topmenu1/g_topmenu_go.gif' width='26' height='17' hspace='1' vspace='1' border='0'>" +
			"</TD></form>" +
			"<form action='"+ path + "_news/search_news.asp' name='quicksearchNews' onSubmit='return check_news(\"" + lang + "\");' "+mainTarget+"><TD class='TopMenuHeader' nowrap valign='middle'>" +
			"<input type='text' name='quickinput' size='"+ searchWidth +"' maxlength='50' value='News' onClick='document.quicksearchNews.quickinput.value=\"\";document.quicksearchQuotes.quickinput.value=\"Quotes\";' ></TD>" +
			"<TD class='TopMenuHeader' nowrap valign='middle' width='40'><input type='image' src='"+ path + "img/topmenu1/g_topmenu_go.gif' width='26' height='17' hspace='1' vspace='1' border='0'></TD></tr></form></table>");
document.write(
		"</td>" +
		"<TD class='TopMenuHeader' width='1'><IMG src='"+ path + "img/empty.gif' width='1' height='27' border='0' alt=''></TD>"+
	"</TR>"	+
"</TABLE>" +
"<TABLE border='0' cellspacing='0' cellpadding='0' width='764'>"+
	"<TR><TD class='BackColorDarkBlue' width=1><IMG src='"+ path + "img/empty.gif' width='1' height='3' border='0' alt=''></TD><TD class='BackColorDarkBlue' width='762'><IMG src='"+ path + "img/empty.gif' width='762' height='1' border='0' alt=''></TD><TD class='BackColorDarkBlue' width='1'><IMG src='"+ path + "img/empty.gif' width='1' height='3' border='0' alt=''></TD></TR>"+
	"<TR><TD class='BackColorYellow' width=1><IMG src='"+ path + "img/empty.gif' width='1' height='3' border='0' alt=''></TD><TD class='BackColorYellow' width='762'><IMG src='"+ path + "img/empty.gif' width='762' height='1' border='0' alt=''></TD><TD class='BackColorYellow' width='1'><IMG src='"+ path + "img/empty.gif' width='1' height='3' border='0' alt=''></TD></TR>"+
"</TABLE>"
);
}
//=========================================================================
// function generate_topmenu ==============================================
//=========================================================================
function generate_topmenu (lang,section,subsection,width,path) // ,name
{
x = new Array();
y = new Array();
x_ex = new Array();
y_ex = new Array();
var stringOut = "";
for (j = 0; j < 8; j++)
	{
	x[j] = MainTopMenu[0][j];
	y[j] = MainTopMenu[1][j];
	}
for (j = 0; j < 8; j++)
	{
	x_ex[j] = MainTopMenu_SubExists[0][j];
	y_ex[j] = MainTopMenu_SubExists[1][j];
	}
	titles = eval(lang + "MainTopMenu_titles")
	backColorActive = "#9A9A9A"
	backColorInactive = "#C8C8C8" 
	
	
	//new version (images are replaced with tables/text)
	 stringOut = "<table border='0' cellspacing='0' cellpadding='0' align='right' height='17' width='" + width +"'><tr><td width='1' ><IMG src='"+ path + "img/empty.gif' width='1' height='17' border='0' alt=''></td><td " + widthHeight[1][0] + " align='center'><a href='" +MainTopMenu[1][0]+"' class='MainTopMenu' target='_top'><div class='MainTopMenu'>" + titles[0] + "</div></a></td>"

var menuname="Main";
ireturn=-1;
for (i = 1; i < MainTopMenu[0].length; i++)
	{
			var mainTarget = "";
			if  (section == "premium_fonds") mainTarget = " target='_top' ";
			
			// activate button for that section
			if (section == x[i]) 
			{	
				activate = "up"; 
				if (y_ex[i] == 1) ireturn = i; else ireturn = -1;
			}
			else
			{ 
				activate = "down";
			}	
			if (y_ex[i] == 1) subsectionLink = (y[i].indexOf("?")==-1 ? "?subs=0" :"&subs=0" );
			else subsectionLink = "";
			
			if (activate == "up") 
			{
				stringOut +=  "<td valign='middle' align='center' bgcolor='" + backColorActive + "' id='"+menuname+i+"' " + widthHeight[1][i] + "><a href='" + y[i] + subsectionLink + "' " + mainTarget +"><div class='MainTopMenuActivated'>" + titles[i] + "</div></a></td>";
			PageNavSection =  titles[i];
			PageNavSectionLink =  y[i] + subsectionLink;
			}
			else 
			{
				stringOut +=  "<td valign='middle' align='center' bgcolor='" + backColorInactive + "' id='"+menuname+i+"' onMouseOver='changeCellColor(\"" + menuname+i + "\",\"" + backColorActive + "\");' onMouseOut='changeCellColor(\"" + menuname+i + "\",\"" + backColorInactive + "\");' " + widthHeight[1][i] + "><a href='" +  y[i] + subsectionLink +  "' class='MainTopMenu'  " + mainTarget +">" + titles[i] + "</a></td>";
			}
			if (i != MainTopMenu[0].length-1)
			{
				stringOut +=  "<td><img src='"+ path + "img/topmenu1/g_topmenu_spacer_light.gif' alt='' width='1' height='17' border='0'></td>";
			}
					
	}
	stringOut +=  "</tr></table>";	

stringOut = "<TABLE border='0' cellspacing='0' cellpadding='0' width='764'>" +
"<TR>" +
	"<TD nowrap rowspan='2'><a href='"+ path + "default.asp'><img src='"+ path + "img/topmenu1/logo.gif' alt='' width='147' height='31' border='0'></a><img src='"+ path + "img/topmenu/white.gif' width='147' height='37' alt='' border='0'></TD>" +
	"<TD nowrap>" +  
		"<IMG src='"+ path + "img/empty.gif' width='470' height='20' border='0' alt=''>" +
	"</TD>" +
"</TR>" +
"<TR>" +
	"<TD nowrap width='440'>" +  
		stringOut + 
	"</TD>" +
"</TR>" +

"</TABLE>";
	
document.write (stringOut); 
return ireturn;
}
function changeCellColor(Cell, CellColor) {
		if (navigator.appName != 'Netscape') {
			CellRef = eval(Cell + ".style")
			CellRef.background = CellColor
		}
	}
//===========================================================================
// function show submenu ====================================================
//===========================================================================
function show_submenu (lang,name,subsection,ireturn,width,height,path)
{

var submenu;
var submenu_string = '';

	if ( xpositions[1][ireturn]!=0) endSpacer = "<td><img src='"+ path + "img/empty.gif' alt='' width='" + xpositions[1][ireturn] + "' height='1' border='0'></td>"; else endSpacer = "";
	
submenu_string += "<table border='0' cellspacing='0' cellpadding='0' align='right' height='17'><tr><td width='1' ><IMG src='"+ path + "img/empty.gif' width='5' height='17' border='0' alt=''></td>"
			submenu = eval(lang + name);
			x = new Array();
			y = new Array();
			for (j = 0; j < 8; j++)
				{ 
				x[j] = submenu[0][j];
				y[j] = submenu[1][j];
				}
			//colors for cells onmouse over
			backColorActive = "#001B7A"
			backColorInactive = "#9A9A9A" 	
			for (i = 0; i < submenu[0].length; i++)
				{
					TDNumTOP += 1;
				
					cellName = name + i
					//add  subsection index to link
					if (y[i].indexOf("?")!= -1 ) sublink = y[i] + "&subs=" + i; else sublink = y[i] + "?subs=" + i;
					//activate cell if subsection is opened 	
					if (i == subsection) 
					{
						submenu_string +=  "<td valign='middle' bgcolor='" + backColorActive + "' id='"+cellName+"'><a href='" + sublink + "'><div class='TopSubmenu'>&nbsp;&nbsp;&nbsp;" + x[i] + "&nbsp;&nbsp;&nbsp;</div></a></td>";
						PageNavSubsection=x[i];
						PageNavSubsectionLink=sublink;
					}
					else 
					{
						submenu_string +=  "<td valign='middle' bgcolor='" + backColorInactive + "' id='"+cellName+"' onMouseOver='changeCellColor(\"" + cellName + "\",\"" + backColorActive + "\");' onMouseOut='changeCellColor(\"" + cellName + "\",\"" + backColorInactive + "\");'><a href='" + sublink + "'><div class='TopSubmenu'>&nbsp;&nbsp;&nbsp;" + x[i] + "&nbsp;&nbsp;&nbsp;</div></a></td>";
					}
					if (i != submenu[0].length-1)
						{
						submenu_string +=  "<td><img src='"+ path + "img/topmenu1/g_topmenu_spacer.gif' alt='' width='1' height='17' border='0'></td>";
						}
				}
			submenu_string += endSpacer + "</tr></table>";	
			
		
		
if (submenu_string != '')	return submenu_string; else return "&nbsp;"	
}
// ===================***********************=================================**************************
//check topmenu forms


function check_quotes(lang)
{
	
	var alert_3_letters;
	var alert_1_letter;
	var alert_prohibited;
	
	formToCheck = document.quicksearchQuotes.quickinput
	strToCheck = formToCheck.value;
	
	if (lang == "g_")
		{
			alert_prohibited = "Der Gebrauch von den +,%,?,*,[,] Buchstaben in der Suchzeichenkette wird verboten!";
			alert_3_letters = "Sie müssen für die Suche mindestens 3 Zeichen eingeben!";
			alert_1_letter = "Sie müssen für die Suche mindestens 1 Zeichen eingeben!";
		}
	else
		{
			alert_prohibited = "The use of the +,%,?,*,[,] characters in the search string is prohibited!";
			alert_3_letters = "You must enter at least 3 character for the search!";
			alert_1_letter = "You must input at least 1 character for the search!";
		}
	if (strToCheck.search(/(^ +)|(\?)|(\%)|(\*)|(\[)|(\])/gi,"") >0)
	{
			alert(alert_prohibited);
			document.quicksearchQuotes.quickinput.focus();
			return false;
	}	
	if(isInt(strToCheck) == true)
		{	
		if (strToCheck.length < 3 ||strToCheck == "")
			{
				alert(alert_3_letters);
				formToCheck.focus();
				return false;
			}
		else
			{
				//strToCheck = strToCheck.replace(/\&/gi,"%26")
				return true;
			}
		}
	else
		{
		
		if (strToCheck == "")
			{
				alert(alert_1_letter);
				formToCheck.focus();
				return false
			}
		else
			{
				//strToCheck = strToCheck.replace(/\&/gi,"%26")
				return true;
			}
		}
}

//=========================================================================================================
function check_news(lang)
{
var alert_3_letters;
var alert_1_letter;
formToCheck = document.quicksearchNews
if (lang == "g_")
	{
		alert_3_letters = "Sie müssen für die Suche mindestens 3 Zeichen eingeben!";
		alert_1_letter = "Sie müssen für die Suche mindestens 1 Zeichen eingeben!";
	}
else
	{
		alert_3_letters = "You must enter at least 3 character for the search!";
		alert_1_letter = "You must input at least 1 character for the search!";
	}
if (formToCheck.quickinput.value.length < 3 || formToCheck.quickinput.value == "")
	{
		alert(alert_3_letters);
		return false;
	}
}
//============================================================================================================
// a few more functions ======================================================================================
//============================================================================================================

function isInt(numstr)
{
	var isValid = true;
	if (numstr+"" == "undefined" || numstr+"" == "null" || numstr+"" == "")	
		return false;
	numstr += "";	
	for (i = 0; i < numstr.length; i++)
		{
    		if (!((numstr.charAt(i) >= "0") && (numstr.charAt(i) <= "9")))
			{
       			isValid = false;
       			break;
			}
      	}
   	return isValid;
}
//=========================================================================================================

var NA = null;  // Not Available value

function UserInfo()  // new UserInfo() instantiates a UserInfo object
  {
  this.appCodeName = NA;     // set all these to NA (Not Available)
  this.appName = NA;         // so that the client browser will not
  this.appVersion = NA;      // display an error message (or crash!)
  this.platform = NA;        // if it doesn't support them
  this.cookiesEnabled = NA;
  this.javaEnabled = NA;
  this.taintEnabled = NA;
  this.numFrames = NA;
  this.numHistoryURLs = NA;
  this.availHeight = NA;
  this.availWidth = NA;
  this.height = NA;
  this.width = NA;
  this.colorDepth = NA;
  this.referrer  = NA;
  this.year = NA;
  this.month = NA;
  this.date = NA;
  this.time = NA;
  this.timezoneOffset  = NA;
  this.jsVersion = NA;

  /* Navigator object properties ************************************/

  if (top.navigator.appCodeName != null)  // get browser code name
    this.appCodeName = navigator.appCodeName;

  if (top.navigator.appName != null)  // get browser app name
    {
    if (navigator.userAgent.indexOf("Opera") != -1)
      this.appName = "Opera";
    else
      this.appName = navigator.appName;
    }

  if (top.navigator.appVersion != null)  // get browser version number
    {
    this.appVersion = navigator.appVersion;
    var index = this.appVersion.indexOf(" ");
    this.appVersion = this.appVersion.substring(0,index);
    if (this.appName.indexOf("Internet") != -1) // fix for IE 5.0 appVersion bug
      {                                         // (returns 4.0 version number)
      if (top.navigator.userAgent.indexOf("5.0") != -1)
        this.appVersion = "5.0";
      }
    }

  if (top.navigator.platform != null)  // get browser platform
    {
    this.platform = navigator.platform;
    }
  else  // get platform for browsers that don't support navigator.platform
    {
    var startindex = navigator.appVersion.indexOf("(") + 1;
    var endindex = navigator.appVersion.indexOf(";");
    this.platform = navigator.appVersion.substring(startindex,endindex);
    }

  if (top.navigator.javaEnabled() != null)  // get browser platform
    this.javaEnabled = navigator.javaEnabled();

  if (top.navigator.taintEnabled() != null)  // get browser platform
      this.taintEnabled = navigator.taintEnabled();

  /* Window object properties ***************************************/

  if (top.length != null)  // num frames in user's page
    this.numFrames = top.length;

  if (top.history.length != null)  // num URLS in history
    this.numHistoryURLs = top.window.history.length

  /* Screen object properties ***************************************/

  if (top.screen != null)  // get various screen properties
    {
    this.availHeight = screen.availHeight;  // avail height (px) of user's screen
    this.availWidth = screen.availWidth;  // avail width of user's screen
    this.colorDepth = screen.colorDepth;  // color bit depth of browser
    this.height = screen.height;  // total height of user's screen
    this.width = screen.width;  // total width of user's screen
    }

  /* Document object properties *************************************/

  // this.referrer is URL of HTML doc from which this page was accessed
  if (top.document.referrer != null)
    this.referrer = document.referrer;

  if (document.cookie != null)
    {
    document.cookie = "name=value";  // cookies enabled?
    if (document.cookie == "")
      this.cookiesEnabled = false;
    else
      this.cookiesEnabled = true;
    }

  /* Date object properties *****************************************/

  var today = new Date();  // get user's current date/time settings
  this.year = today.getYear();
  if (this.year < 1900)
  this.year += 1900;  // we want a four-digit year
  this.month = today.getMonth();
  this.date = today.getDate();
  this.time = today.getHours() + ":" +
              today.getMinutes() + ":" +
              today.getSeconds();
  if (today.getTimezoneOffset() != null)  // get user's num mins GMT timezone offset
    this.timezoneOffset = today.getTimezoneOffset();
  }


//==========================================================================================================
// Formatiranje quota za ispis u tabelama (Markteubersicht, na primer)======================================
//==========================================================================================================

//	field:		value from quote server
//	intRatio:	number used for field normalization
//	num_dec:	number of decimals
function FormatQuote(field, intRatio, num_dec)
// ========== NESTO OVDE NE VALJA, KAD JE FORMATIRANJE NA ODR. BROJ DECIMALA U PITANJU! ===========
{
if (field == "") 			{FQ = "NA";}
else {if (field == null) 	{FQ = "NA";}
else {if (field == "NA") 	{FQ = "NA";} //if (isNaN(field)) NE MOZE, jer isNaN ne prepoznaje broj koji se nalazi u stringu (i time predstavlja validno prenesenu kvotu)
else
	{field = field.replace(/\./gi,"");
	field = field.replace(/\,/gi,".");
	FQ_number = (parseFloat(field)) * (intRatio);	// (parseFloat ne moze ako nisu uradjena 2 prethodna replace-a, jer tada seche na '.' kao da je dec. zarez !!!)...
	a = new String (FQ_number);						// ...a onda, vrachanje (dole):
	FQ_string = a.toString();
	FQ_string = FQ_string.replace(/\./gi,",");							// (ZAREZ UMESTO TACHKE, KAO DECIMALNI ZAREZ)
	string_length = FQ_string.length;
	position_of_coma = FQ_string.indexOf(",");
	FQ = FQ_string;

	if (num_dec == 2)													// (ODGOVARAJUCHI BROJ NULA NA KRAJU:)
		{if (position_of_coma < 0)									{FQ = FQ + ",00";}
		else 	{if (position_of_coma == (string_length-2))			{FQ = FQ + "0";}
		}		}
	else // if (num_dec == 4)
		{if (position_of_coma < 0)									{FQ = FQ + ",0000";}
		else	{if (position_of_coma == (string_length-2))			{FQ = FQ + "000";}
		else	{if (position_of_coma == (string_length-3))			{FQ = FQ + "00";}
		else	{if (position_of_coma == (string_length-4))			{FQ = FQ + "0";}
		}		}}}
//	if (position_of_coma < 0)											// (ODGOVARAJUCHI BROJ NULA NA KRAJU:)
//		{FQ = FQ + ",";
//		for (k=0; k<num_dec; k++)
//			{FQ = FQ + "0";}
//		}
//	for (i=2; i<(num_dec+1); i++)							// i:		2			3			4			5
//		{if (position_of_coma == (string_length-i))			// m,:		2.			3.			4.			5.
//			{for (j=i; j<(num_dec+1); j++)					// od do:	2-5(0000)	3-5(000)	4-5(00)		5-5(0)
//				{FQ = FQ + "0";}
//		}	}							// !!! NECHE, PA NECHE !!!

	ArrayBeforeAndAfterComa = FQ.split(",");							// (TACHKA KAO DELIMITER ZA HILJADE:)
	FQ_integer_part = ArrayBeforeAndAfterComa[0];
	integer_part_length = FQ_integer_part.length;
	if (integer_part_length > 3)
		{if (((integer_part_length-1) % 3) == 0  && FQ_integer_part.slice(0,1) == "-") // ako ima 3, 6, 9... cifara u integer delu, i '-' ispred
			{FQ = FQ_integer_part + "," + ArrayBeforeAndAfterComa[1];}
		else
			{FQ = FQ_integer_part.slice(0,(integer_part_length-4+1)) + "." + FQ_integer_part.slice((integer_part_length-3),(integer_part_length-1+1)) + "," + ArrayBeforeAndAfterComa[1];}}
	else
		{if (FQ.slice(0,1) == ",")				{FQ = "0" + FQ;}		// (DA ZADRZI VODECHU NULU ISPRED DEC. ZAREZA:)
		else	{if (FQ.slice(0,2) == "-,")		{ArrayDashAndAfterComa = FQ.split(",");
												FQ = ArrayDashAndAfterComa[0] + "0," + ArrayDashAndAfterComa[1];}
		}		}
	ArrayBeforeAndAfterComa = FQ.split(",");							// (NE VISHE OD 4 DECIMALE:)
	FQ_decimal_part = ArrayBeforeAndAfterComa[1];
	decimal_part_length = FQ_decimal_part.length;
	if (decimal_part_length > 4) 				{FQ = ArrayBeforeAndAfterComa[0] + "," + FQ_decimal_part.slice(0,4);}
	}}}
return FQ;
}
function browserType()
{
	var btype="MSIE";
	switch(navigator.family)
	{
	case 'opera':
		btype="Opera";
		break;
	case 'gecko':
	  	if (navigator.org == 'netscape') btype="NS6";
		if (navigator.org == 'mozilla') btype="Mozilla";
	    // Netscape 6.x and higher
	  	break;
	 case 'ie4':
	 	//redundacncy left in case of need for more precise detection
		  //if (navigator.version >= 6) btype="MSIE";
		  //else if (navigator.version >= 5.5) btype="MSIE";
		  //else if (navigator.version >= 5) btype="MSIE";
		  //else btype="MSIE";
		  btype="MSIE";
		  break;
	case 'nn4':
	  	btype="NS";
		break;
	}
	return btype;
}

function fixLength(textToBeFixed,newLength)
{
	if (textToBeFixed.length > newLength)
		newText = textToBeFixed.substr(0,newLength-3) + '...'
	else
		newText = textToBeFixed;
	return newText;	
}
//detect browser
/*
ua.js 2001-12-05

Contributor(s): Bob Clary, Netscape Communications, Copyright 2001

Netscape grants you a royalty free license to use or modify this
software provided that this copyright notice appears on all copies.
This software is provided "AS IS," without a warranty of any kind.
*/

function xbDetectBrowser()
{
  var oldOnError = window.onerror;
  var element = null;

  window.onerror = null;
  
  // work around bug in xpcdom Mozilla 0.9.1
  window.saveNavigator = window.navigator;

  navigator.OS    = '';
  navigator.version  = parseFloat(navigator.appVersion);
  navigator.org    = '';
  navigator.family  = '';

  var platform;
  if (typeof(window.navigator.platform) != 'undefined')
  {
    platform = window.navigator.platform.toLowerCase();
    if (platform.indexOf('win') != -1)
      navigator.OS = 'win';
    else if (platform.indexOf('mac') != -1)
      navigator.OS = 'mac';
    else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1)
      navigator.OS = 'nix';
  }

  var i = 0;
  var ua = window.navigator.userAgent.toLowerCase();
  
  if (ua.indexOf('opera') != -1)
  {
    i = ua.indexOf('opera');
    navigator.family  = 'opera';
    navigator.org    = 'opera';
    navigator.version  = parseFloat('0' + ua.substr(i+6), 10);
  }
  else if ((i = ua.indexOf('msie')) != -1)
  {
    navigator.org    = 'microsoft';
    navigator.version  = parseFloat('0' + ua.substr(i+5), 10);
    
    if (navigator.version < 4)
      navigator.family = 'ie3';
    else
      navigator.family = 'ie4'
  }
  else if (ua.indexOf('gecko') != -1)
  {
    navigator.family = 'gecko';
    var rvStart = navigator.userAgent.indexOf('rv:') + 3;
    var rvEnd = navigator.userAgent.indexOf(')', rvStart);
    var rv = navigator.userAgent.substring(rvStart, rvEnd);
    var decIndex = rv.indexOf('.');
    if (decIndex != -1)
    {
      rv = rv.replace(/\./g, '')
      rv = rv.substring(0, decIndex-1) + '.' + rv.substr(decIndex)
    }
    navigator.version = parseFloat(rv);

    if (ua.indexOf('netscape') != -1)
      navigator.org = 'netscape';
    else if (ua.indexOf('compuserve') != -1)
      navigator.org = 'compuserve';
    else
      navigator.org = 'mozilla';
  }
  else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1))
  {
    var is_major = parseFloat(navigator.appVersion);
    
    if (is_major < 4)
      navigator.version = is_major;
    else
    {
      i = ua.lastIndexOf('/')
      navigator.version = parseFloat('0' + ua.substr(i+1), 10);
    }
    navigator.org = 'netscape';
    navigator.family = 'nn' + parseInt(navigator.appVersion);
  }
  else if ((i = ua.indexOf('aol')) != -1 )
  {
    // aol
    navigator.family  = 'aol';
    navigator.org    = 'aol';
    navigator.version  = parseFloat('0' + ua.substr(i+4), 10);
  }
  else if ((i = ua.indexOf('hotjava')) != -1 )
  {
    // hotjava
    navigator.family  = 'hotjava';
    navigator.org    = 'sun';
    navigator.version  = parseFloat(navigator.appVersion);
  }
  window.onerror = oldOnError;
}
function generateTopmenuUserLinks(userStatus,path,mainTarget)
{
stringOut = "<table border='0' cellspacing='0' cellpadding='0'>" +
			
					"<tr><td rowspan='4' align='center'><img src='"+ path + "img/empty.gif' alt='' width='5' height='21' border='0'></td><td rowspan='4' align='center' valign='center'><img src='"+ path + "_user/img/empty.gif' alt='' width='1' height='2' border='0'><br><img src='"+ path + "_user/img/user_"+userStatus+".gif' alt='' width='21' height='21' border='0'></td><td><a href='"+ path + "_user/login.asp'><div class='TopSubmenu'><IMG src='"+ path + "img/empty.gif' width='5' height='2' border='0' alt=''><IMG src='"+ path + "img/empty.gif' width='3' height='2' border='0' alt=''>members only</div></a></td></tr>" +

					"<tr><td><IMG src='"+ path + "img/empty.gif' width='5' height='1' border='0' alt=''></td></tr>" +
			
					"<tr><td><div><a href='"+ path + "_factsheet/factsheet.asp' "+mainTarget+"><span class='TopSubmenu'><IMG src='"+ path + "img/empty.gif' width='5' height='2' border='0' alt=''><IMG src='"+ path + "img/empty.gif' width='3' height='2' border='0' alt=''>my teletrader</span></a><a href='"+ path + "_portfolio/depot.asp' "+mainTarget+"><span class='TopSubmenu'><IMG src='"+ path + "img/empty.gif' width='5' height='2' border='0' alt=''><IMG src='"+ path + "img/empty.gif' width='3' height='2' border='0' alt=''>my portfolio</span></a></div></td></tr>" +

					"<tr><td><IMG src='"+ path + "img/empty.gif' width='5' height='1' border='0' alt=''></td></tr>"+
				
				"</table>"
	return stringOut;
}
function generateTopmenuNormalLinks(path,mainTarget)
{
	stringOut = "<a href='"+ path + "_user/login.asp'><div class='TopSubmenu'><IMG src='"+ path + "img/empty.gif' width='5' height='2' border='0' alt=''><img src='"+ path + "img/topmenu1/arrow_yellow.gif' alt='' width='5' height='7' border='0'><IMG src='"+ path + "img/empty.gif' width='3' height='2' border='0' alt=''>members only</div></a>" +
				"<div><IMG src='"+ path + "img/empty.gif' width='5' height='1' border='0' alt=''></div>" +
				"<div><a href='"+ path + "_factsheet/factsheet.asp' "+mainTarget+"><span class='TopSubmenu'><IMG src='"+ path + "img/empty.gif' width='5' height='2' border='0' alt=''><img src='"+ path + "img/topmenu1/arrow_yellow.gif' alt='' width='5' height='7' border='0'><IMG src='"+ path + "img/empty.gif' width='3' height='2' border='0' alt=''>my teletrader</span></a>" +
					"<a href='"+ path + "_portfolio/depot.asp' "+mainTarget+"><span class='TopSubmenu'><IMG src='"+ path + "img/empty.gif' width='5' height='2' border='0' alt=''><img src='"+ path + "img/topmenu1/arrow_yellow.gif' alt='' width='5' height='7' border='0'><IMG src='"+ path + "img/empty.gif' width='3' height='2' border='0' alt=''>my portfolio</span></a></div>" +
				"<div><IMG src='"+ path + "img/empty.gif' width='5' height='1' border='0' alt=''></div>"
	return stringOut;
}			
function sendResponse()
{
	document.location = "mailto:ttwebmaster@teletrader.com";
}			