/*
	requires SYSTEMLANGUAGE.JS
	requires generaltranslations.js
*/

function initToolsTips() {
	$("img[title]").tooltip({offset: [15, 0], effect: 'slide'}).dynamic({ bottom: { direction: 'down', bounce: true } });
}

function generateWWWLinks() {
	var htmlCode = "<script>\n$(function() {\n$( \"#accordionwww\" ).accordion({\nautoHeight: false,navigation: false,collapsible: true\n});\n});\n</script>\n";
	htmlCode = htmlCode +"<div class=\"wwwlinks\">\n<div id=\"accordionwww\">\n<h3><a href=\"#\">" + getTranslation("web.ffinthewww") + "</a></h3>\n";
	htmlCode = htmlCode + "<div>\n";
	htmlCode = htmlCode + "<img src=\"images/icon_fb.gif\" class=\"photos\" title=\"Friendship Force Norderstedt in Facebook\" border=\"0\">&nbsp;<a href=\"http://www.facebook.com/pages/Friendship-Force-Norderstedt/103641869736264\" class=\"miniboxes\" target=\"_blank\">" + getTranslation("menu.ffn") +"</a><br><hr>\n";
	htmlCode = htmlCode + "<a href=\"https://www.facebook.com/friendshipforce\" target=\"_blank\"><img src=\"images/icon_fb.gif\" class=\"photos\" title=\"Friendship Force International in Facebook\" border=\"0\"></a>&nbsp;&nbsp;";
	htmlCode = htmlCode + "<a href=\"http://www.youtube.com/user/ffitoday\" target=\"_blank\"><img src=\"images/icon_yt.gif\" class=\"photos\" title=\"Friendship Force International in YouTube\" border=\"0\"></a>&nbsp;&nbsp;";
	htmlCode = htmlCode + "<a href=\"http://www.flickr.com/photos/friendshipforceinternational\" target=\"_blank\"><img src=\"images/icon_fl.gif\" class=\"photos\" title=\"Friendship Force International in Flickr\" border=\"0\"></a><br><hr>";
	htmlCode = htmlCode + "<img src=\"flags/ff.gif\" title=\"" + getTranslation("contact.www.world") + "\" class=\"photos\">&nbsp;<a href=\"http://www.thefriendshipforce.org/\" class=\"miniboxes\" target=\"_blank\">" + getCountryName("ff") + "</a><br>\n";
	htmlCode = htmlCode + "<img src=\"flags/eu.gif\" title=\"" + getTranslation("contact.www.europe") + "\" class=\"photos\">&nbsp;<a href=\"http://www.friendshipforce.eu\" class=\"miniboxes\" target=\"_blank\">" + getCountryName("eu") + "</a><br>\n";
	htmlCode = htmlCode + "<img src=\"flags/de.gif\" title=\"" + getTranslation("contact.www.germany") + "\" class=\"photos\">&nbsp;<a href=\"http://www.friendshipforce.eu/de/home/\" class=\"miniboxes\" target=\"_blank\">" + getCountryName("de") + "</a>\n";
	htmlCode = htmlCode + "</div>\n</div>\n</div>";
	return (htmlCode);
}

function generateToolbar () {
	var htmlCode = "<td class=\"toolbar\" colspan=\"3\">\n";
	htmlCode = htmlCode + "<a class=\"toolbarlink\" href=\"index.html\">" + getTranslation("toolbar.home") + "</a>&nbsp;\n";
	htmlCode = htmlCode + "<a class=\"toolbarlink\" href=\"kontakt.html\">" + getTranslation("toolbar.contact") + "</a>&nbsp;\n";
	htmlCode = htmlCode + "<a class=\"toolbarlink\" href=\"impressum.html\">" + getTranslation("toolbar.imprint") + "</a>&nbsp;&nbsp;\n";
	htmlCode = htmlCode + "<a href=\"javascript:storeLanguage('en')\" ><img src=\"flags/uk.gif\" title=\"" + getTranslation("toolbar.english") + "\" border=\"0\"></a>&nbsp;\n";
	htmlCode = htmlCode + "<a href=\"javascript:storeLanguage('de')\" ><img src=\"flags/de.gif\" title=\"" + getTranslation("toolbar.german") + "\" border=\"0\"></a>&nbsp;\n";
	htmlCode = htmlCode + "</td>\n";
	return htmlCode;
}

function generateFooter () {
	var htmlCode = "<td class=\"toolbar\" colspan=\"3\">\n";
	htmlCode = htmlCode + "<center>&copy; Copyright 2011 by The Friendship Force of Norderstedt e.V., Germany</center>";
	htmlCode = htmlCode + "</td>\n";
	return htmlCode;
}

function generateHeader () {
	var htmlCode = "<td colspan=\"3\">\n";
	htmlCode = htmlCode + "<table width=\"100%\">\n<tr>\n<td>\n";
	htmlCode = htmlCode + "<img src=\"images/logo_ffn.jpg\" border=\"0\">&nbsp;&nbsp;&nbsp;\n";
	if (getCurrentLanguage() == "de") {
		htmlCode = htmlCode + "<a href=\"http://www.thefriendshipforce.org\" target=\"_blank\"><img src=\"images/ChangingTheWay_GER.gif\" border=\"0\"></a>&nbsp;&nbsp;\n";
	} else {
		htmlCode = htmlCode + "<a href=\"http://www.thefriendshipforce.org\" target=\"_blank\"><img src=\"images/ChangingTheWay_ENG.gif\" border=\"0\"></a>&nbsp;&nbsp;\n";
	}
	htmlCode = htmlCode + "<img src=\"images/explor_anim.gif\" border=\"0\">\n";
	htmlCode = htmlCode + "</td><td align=\"right\">" + generateWelcomeGreeting(3);
	htmlCode = htmlCode + "</td>\n</tr>\n</table>\n</td>\n";
	return htmlCode;
}

function generateClubAddress () {
	var htmlCode = "<p>The Friendship Force of Norderstedt e.V.<br>";
	htmlCode = htmlCode + "c/o Heike Schulze-Gudladt<br>";
	htmlCode = htmlCode + "Rudolf-Kinau-Stra&szlig;e 4<br>";
	htmlCode = htmlCode + "24558 Henstedt-Ulzburg<br>";
	htmlCode = htmlCode + getCountryName("de") + "</p>";
	htmlCode = htmlCode + getTranslation("contact.phone") + " : +49 - (0)4193 - 77173<br><br>";
	return htmlCode;
}

function generateMoreLink ( page ) {
	var htmlCode ="<a href=\"" + page + ".html\" class=\"miniboxes\" >" + getTranslation("home.more") + "</a>";
	return htmlCode;
}

function generateBackLink () {
	var htmlCode ="<br><a href=\"javascript:history.back();\" class=\"miniboxes\" >" + getTranslation("home.back") + "</a>";
	return htmlCode;
}

function generateGotoTopLink () {
	var htmlCode ="<a class=\"miniboxes\" onclick=\"jQuery('html, body').animate( { scrollTop: 0 }, 5000 );\" href=\"javascript:void(0);\">" + getTranslation("home.gototop") + "</a>";
	return htmlCode;
}

function generateWelcomeGreeting ( num ) {
	var internationalWelcome = new Array (
							<!-- Albanian -->
							"Albanisch##Albanian##&#109;&#105;&#114;&#235;&#32;&#115;&#101;&#32;&#118;&#105;&#110;&#105;",
							<!-- Arabic -->
							"Arabisch##Arabic##&#1571;&#1607;&#1604;&#1575;&#1611;&#32;&#1608;&#32;&#1587;&#1607;&#1604;&#1575;&#1611;",
							<!-- Basque -->
							"Baskisch##Basque##&#x006F;&#x006E;&#x0067;&#x0069;&#x0020;&#x0065;&#x0074;&#x006F;&#x0072;&#x0072;&#x0069;",
							<!-- Bengali -->
							"Bengalisch##Bengali##&#x09B8;&#x09CD;&#x09AC;&#x09BE;&#x0997;&#x09A4;&#x09AE;",
							<!-- Bulgarian -->
							"Bulgarisch##Bulgarian##&#x0434;&#x043E;&#x0431;&#x0440;&#x0435;&#x0020;&#x0434;&#x043E;&#x0448;&#x043B;&#x0438;",
							<!-- Chinese (simpl.) -->
							"Chinesisch (simpl.)##Chinese (simpl.)##&#x6B22;&#x8FCE;",
							<!-- Chinese (trad.) -->
							"Chinesisch (trad.)##Chinese (trad.)##&#x6B61;&#x8FCE;",
							<!-- Croatian / Slovenian -->
							"Kroatisch &amp; Slowenisch##Croatian &amp; Slovenian##&#x0064;&#x006F;&#x0062;&#x0072;&#x006F;&#x0064;&#x006F;&#x0161;&#x006C;&#x0069;",
							<!-- Czech -->
							"Tschechisch##Czech##&#x0076;&#x00ED;&#x0074;&#x0065;&#x006A;&#x0074;&#x0065;",
							<!-- Danish / Norwegian -->
							"D&auml;nisch &amp; Norwegisch##Danish &amp; Norwegian##&#x0076;&#x0065;&#x006C;&#x006B;&#x006F;&#x006D;&#x006D;&#x0065;&#x006E;",
							<!-- Dutch -->
							"Niederl&auml;ndisch &amp; Afrikaans##Dutch &amp; Afrikaans##&#119;&#101;&#108;&#107;&#111;&#109;",
							<!-- English -->
							"Englisch##English##&#x0077;&#x0065;&#x006C;&#x0063;&#x006F;&#x006D;&#x0065;",
							<!-- Estonian -->
							"Estnisch##Estonian##&#x0074;&#x0065;&#x0072;&#x0065;&#x0020;&#x0074;&#x0075;&#x006C;&#x0065;&#x006D;&#x0061;&#x0073;&#x0074;",
							<!-- Faroese -->
							"F&auml;r&ouml;isch##Faroese##&#118;&#230;&#108;&#107;&#111;&#109;&#105;&#110;",
							<!-- Finnish -->
							"Finnisch##Finnish##&#x0074;&#x0065;&#x0072;&#x0076;&#x0065;&#x0074;&#x0075;&#x006C;&#x006F;&#x0061;",
							<!-- French -->
							"Franz&ouml;sisch##French##&#x0062;&#x0069;&#x0065;&#x006E;&#x0076;&#x0065;&#x006E;&#x0075;&#x0065;",
							<!-- Frisian -->
							"Friesisch##Frisian##&#119;&#111;&#108;&#107;&#111;&#109;",
							<!-- Gaelic -->
							"G&auml;lisch##Gaelic##&#x0066;&#x00E1;&#x0069;&#x006C;&#x0074;&#x0065;",
							<!-- Georgian -->
							"Georgisch##Georgian##&#x10D2;&#x10D0;&#x10DB;&#x10D0;&#x10E0;&#x10EF;&#x10DD;&#x10D1;&#x10D0;&#x10D7;",
							<!-- German -->
							"Deutsch##German##&#x0077;&#x0069;&#x006C;&#x006C;&#x006B;&#x006F;&#x006D;&#x006D;&#x0065;&#x006E;",
							<!-- Greek -->
							"Griechisch##Greek##&#922;&#945;&#955;&#972;&#962;&#32;&#942;&#955;&#952;&#945;&#964;&#949;",
							<!-- Hawaiian -->
							"Hawaiianisch##Hawaiian##&#101;&#32;&#107;&#111;&#109;&#111;&#32;&#109;&#97;&#105;",
							<!-- Hebrew -->
							"Hebr&auml;isch##Hebrew##&#x05D1;&#x05E8;&#x05D5;&#x05DB;&#x05D9;&#x05DD;&#x0020;&#x05D4;&#x05D1;&#x05D0;&#x05D9;&#x05DD;",
							<!-- Hindi -->
							"Hindi##Hindi##&#x0938;&#x094D;&#x0935;&#x093E;&#x0917;&#x0924;",
							<!-- Hungarian -->
							"Ungarisch##Hungarian##&#x00FC;&#x0064;&#x0076;&#x00F6;&#x007A;&#x00F6;&#x006C;&#x006A;&#x00FC;&#x006B;",
							<!-- Icelandic -->
							"Isl&auml;ndisch##Icelandic##&#x0076;&#x0065;&#x006C;&#x006B;&#x006F;&#x006D;&#x0069;&#x006E;&#x006E;",
							<!-- Indonesian -->
							"Indonesisch##Indonesian##&#x0073;&#x0065;&#x006C;&#x0061;&#x006D;&#x0061;&#x0074;&#x0020;&#x0064;&#x0061;&#x0074;&#x0061;&#x006E;&#x0067;",
							<!-- Italian -->
							"Italienisch##Italian##&#x0062;&#x0065;&#x006E;&#x0076;&#x0065;&#x006E;&#x0075;&#x0074;&#x0069;",
							<!-- Japanese -->
							"Japanisch##Japanese##&#x3088;&#x3046;&#x3053;&#x305D;",
							<!-- Kazakh -->
							"Kasachisch##Kazakh##&#x062D;&#x0648;&#x0634;&#x0020;&#x0643;&#x0647;&#x200C;&#x0644;&#x062F;&#x06CC;&#x06AD;&#x06CC;&#x0632;&#x062F;&#x0647;&#x200C;&#x0631;",
							<!-- Korean -->
							"Koreanisch##Korean##&#xD658;&#xC601;&#xD568;&#xB2C8;&#xB2E4;",
							<!-- Latvian -->
							"Lettisch##Latvian##&#x006C;&#x0061;&#x0069;&#x0070;&#x006E;&#x0069;&#x0020;&#x006C;&#x016B;&#x0064;&#x007A;&#x0061;&#x006D;",
							<!-- Lithuanian -->
							"Litauisch##Lithuanian##&#x0073;&#x0076;&#x0065;&#x0069;&#x006B;&#x0069;&#x0020;&#x0061;&#x0074;&#x0076;&#x0079;&#x006B;&#x0119;",
							<!-- Malay -->
							"Malaiisch##Malay##&#x0633;&#x0644;&#x0627;&#x0645;&#x062A;&#x0020;&#x062F;&#x0627;&#x062A;&#x06A0;",
							<!-- Persian / Urdu -->
							"Persisch &amp; Urdu##Persian &amp; Urdu##&#x062E;&#x0648;&#x0634;&#x0020;&#x0622;&#x0645;&#x062F;&#x06CC;&#x062F;",
							<!-- Polish -->
							"Polnisch##Polish##&#119;&#105;&#116;&#97;&#106;&#99;&#105;&#101;",
							<!-- Portuguese -->
							"Portugiesisch##Portuguese##&#x0062;&#x0065;&#x006D;&#x002D;&#x0076;&#x0069;&#x006E;&#x0064;&#x006F;",
							<!-- Romanian -->
							"Rum&auml;nisch##Romanian##&#x0062;&#x0075;&#x006E;&#x0020;&#x0076;&#x0065;&#x006E;&#x0069;&#x0074;",
							<!-- Russian -->
							"Russisch##Russian##&#x0434;&#x043E;&#x0431;&#x0440;&#x043E;&#x0020;&#x043F;&#x043E;&#x0436;&#x0430;&#x043B;&#x043E;&#x0432;&#x0430;&#x0442;&#x044C;",
							<!-- Serbian -->
							"Serbisch##Serbian##&#x0434;&#x043E;&#x0431;&#x0440;&#x043E;&#x0434;&#x043E;&#x0448;&#x043B;&#x0438;",
							<!-- Slovak -->
							"Slowakisch##Slovak##&#x0076;&#x0069;&#x0074;&#x0061;&#x006A;&#x0074;&#x0065;",
							<!-- Spanish -->
							"Spanisch##Spanish##&#x0062;&#x0069;&#x0065;&#x006E;&#x0076;&#x0065;&#x006E;&#x0069;&#x0064;&#x006F;",
							<!-- Swaheli -->
							"Suaheli##Swaheli##&#x006B;&#x0061;&#x0072;&#x0069;&#x0062;&#x0075;",
							<!-- Swedish -->
							"Schwedisch##Swedish##&#x0076;&#x00E4;&#x006C;&#x006B;&#x006F;&#x006D;&#x006D;&#x0065;&#x006E;",
							<!-- Tamil -->
							"Tamil##Tamil##&#x0BB5;&#x0BA3;&#x0B95;&#x0BCD;&#x0B95;&#x0BAE;&#x0BCD;",
							<!-- Thai -->
							"Thai##Thai##&#x0E22;&#x0E34;&#x0E19;&#x0E14;&#x0E35;&#x0E15;&#x0E49;&#x0E2D;&#x0E19;&#x0E23;&#x0E31;&#x0E1A;",
							<!-- Turkish -->
							"T&uuml;rkisch##Turkish##&#x0068;&#x006F;&#x015F;&#x0067;&#x0065;&#x006C;&#x0064;&#x0069;&#x006E;&#x0069;&#x007A;",
							<!-- Ukrainian -->
							"Ukrainisch##Ukrainian##&#x043B;&#x0430;&#x0441;&#x043A;&#x0430;&#x0432;&#x043E;&#x0020;&#x043F;&#x0440;&#x043E;&#x0441;&#x0438;&#x043C;&#x043E;",
							<!-- Vietnamese -->
							"Vietnamesisch##Vietnamese##&#x0063;&#x0068;&#x00E0;&#x006F;&#x0020;&#x006D;&#x1EEB;&#x006E;&#x0067;",
							<!-- Belarusian -->
							"Wei&szlig;russisch##Belarusian##&#1064;&#1095;&#1099;&#1088;&#1072;&#32;&#1079;&#1072;&#1087;&#1088;&#1072;&#1096;&#1072;&#1077;&#1084;",
							<!-- Yiddish -->
							"Jiddisch##Yiddish##&#x05D6;&#x05F2;&#x05B7;&#x05D8;&#x0020;&#x05F0;&#x05D9;&#x05DC;&#x05E7;&#x05D5;&#x05DD;",
							<!-- Zulu -->
							"Zulu##Zulu##&#x0073;&#x0061;&#x0077;&#x0075;&#x0062;&#x006F;&#x006E;&#x0061;"
							);
							
	var colors  = new Array(5);
	colors[0] = "#a1218d"; // magenta
	colors[1] = "#0056a5"; // blau
	colors[2] = "#66b74d"; // gruen
	colors[3] = "#00718e"; // tuerkis
	colors[4] = "#f39528"; // orange
	colors[5] = "#ea2d23"; // rot

	var languageIndex = (getCurrentLanguage() == "de") ? 0 : 1;
	var htmlCode = "";
	var colorMerker = ""
	var textMerker =  "";
	var entry = "";
	for (var i=0; i < num; i++) {
		var colorIdx = Math.floor (Math.random() * colors.length);
		while (colorMerker.indexOf(colors[colorIdx]) != -1) {
			colorIdx = Math.floor (Math.random() * colors.length);
		}
		colorMerker = colorMerker + colors[colorIdx] + "###";
		var textIdx = Math.floor (Math.random() * internationalWelcome.length);
		while (textMerker.indexOf(internationalWelcome[textIdx]) != -1) {
			textIdx = Math.floor (Math.random() * internationalWelcome.length);
		}
		entry = internationalWelcome[textIdx].split("##");
		textMerker = textMerker + internationalWelcome[textIdx] + "###";
		htmlCode = htmlCode + "<span title=\"" + entry[languageIndex] + "\" style=\"color:" + colors[colorIdx] + ";font-weight:bold;font-size:14px;\">" + entry[2] + "</span><br>";
	}
	return htmlCode;
}
