//menu functions and methods (only integrated, not implementated by myself)
var DOM = (document.getElementById) ? true : false;
var IE = (document.all) ? true : false;

function kz_on()
{ item_on('kz')};

function uz_on()
{ item_on('uz')};

function turk_on()
{ item_on('turk')};

function tg_on()
{ item_on('tg')};

function kg_on()
{ item_on('kg')};

function kz_off()
{ item_off('kz')};

function uz_off()
{ item_off('uz')};

function kg_off()
{ item_off('kg')};

function turk_off()
{ item_off('turk')};

function tg_off()
{ item_off('tg')};

function item_on (boxid) {
	if (IE) 
		document.all[boxid].style.background="#000066"; 
	if (IE) 
		document.all[boxid+"l"].style.color="#FFFFFF"; 
	if (DOM) 
		document.getElementById(boxid).style.background="#000066"; 
	if (DOM) 
		document.getElementById(boxid+"l").style.color="#FFFFFF"; 
	if (boxid=="kz")
		MM_swapImage('Image1','',mapKz,1);
	if (boxid=="turk")
		MM_swapImage('Image1','',mapTurkm,1);
	if (boxid=="kg")
		MM_swapImage('Image1','',mapKg,1);
	if (boxid=="uz")
		MM_swapImage('Image1','',mapUz,1);
	if (boxid=="tg")
		MM_swapImage('Image1','',mapTdjk,1);
}


function item_off (boxid) {
	if (IE) 
		document.all[boxid].style.background="#FFFFFF"; 
	if (IE) 
		document.all[boxid+"l"].style.color="#000066"; 
	if (DOM) 
		document.getElementById(boxid).style.background="#FFFFFF";
	if (DOM) 
		document.getElementById(boxid+"l").style.color="#000066"; 
	
	MM_swapImgRestore();
}

function MM_preloadImages () {
  	var d = document; 
	if(d.images) { 
		if(!d.MM_p) 
			d.MM_p = new Array();
    	var i;
		var j = d.MM_p.length;
		var a = MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
    		if (a[i].indexOf("#")!=0) { 
				d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
			}
	}
}

function MM_swapImgRestore () {
  	var i;
	var x;
	var a = document.MM_sr; 
	
	for(i = 0; a&&i<a.length&&(x=a[i])&&x.oSrc; i++) 
		x.src = x.oSrc;
}

function MM_findObj (n, d) {
  	var p;
  	var i;
  	var x;  
  
  	if(!d) 
  		d = document; 
 	
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
    	d = parent.frames[n.substring(p+1)].document; 
		n = n.substring(0,p);
	}
  	
	if(!(x=d[n])&&d.all) x=d.all[n]; 
		for (i = 0;!x&&i<d.forms.length;i++) 
			x = d.forms[i][n];
  
  	for(i = 0;!x&&d.layers&&i<d.layers.length;i++) 
		x = MM_findObj(n,d.layers[i].document);
  
  	if(!x && d.getElementById) 
		x = d.getElementById(n); 
		
	return x;
}

function MM_swapImage () {
  var i;
  var j=0;
  var x;
  var a=MM_swapImage.arguments; 
  
  document.MM_sr = new Array; 
  
  for(i = 0;i<(a.length-2);i+=3)
   	if ((x=MM_findObj(a[i]))!=null) { 
		document.MM_sr[j++]=x; 
		if(!x.oSrc) 
			x.oSrc=x.src; 
		x.src=a[i+2];
	}
}

//The following line is critical for menu operation, and MUST APPEAR ONLY ONCE. If you have more than one menu_array.js 
//file rem out this line in subsequent files
menunum=0;
menus=new Array();
_d=document;

function addmenu() {
	menunum++;
	menus[menunum]=menu;
}

function dumpmenus() { 
	mt="<script language=javascript>";
	for(a=1;a<menus.length;a++) { 
		mt+=" menu"+a+"=menus["+a+"];"
	}
	mt+="<\/script>";
	_d.write(mt)
}

/*
	language == 1 --> english
	language == 2 --> german
	language == 3 --> russian
	
	indexTrue == 1 --> index - site (english, german or russian)
	indexTrue == 2 --> not an index site
*/

var menuHelper 	= "";
var indexTrue 	= indexTrue;
var arrow 		= "Images/Style/arrow.gif";

if (indexTrue != 1) 
	menuHelper 	= "../";

if (language == 1) {
	
	var news 					= "News";
	var newsLink 				= "News/news.htm";

	var events 					= "Events";
	var eventsFirst 			= "Kazakhstan";
	var eventsFirstLink 		= "Events/events_kz.htm";
	var eventsSecond 			= "Kyrgyzstan";
	var eventsSecondLink 		= "Events/events_kg.htm";
	var eventsThird 			= "Uzbekistan";
	var eventsThirdLink 		= "Events/events_uz.htm";
	var eventsFourth 			= "Tajikistan";
	var eventsFourthLink 		= "Events/events_tj.htm";

	var country 				= "Country Activities"
	var countryFirst 			= "Kazakhstan";
	var countryFirstLink 		= "Country/kz.htm";
	var countrySecond 			= "Kyrgyzstan";
	var countrySecondLink 		= "Country/kg.htm";
	var countryThird 			= "Uzbekistan";
	var countryThirdLink 		= "Country/uz.htm";
	var countryFourth 			= "Tajikistan";
	var countryFourthLink 		= "Country/tj.htm";
	var countryFifth 			= "Turkmenistan";
	var countryFifthLink 		= "Country/tk.htm";
	
	var themes			= "Themes";
	var themesFirst 			= "Establishment of a New Political Culture";
	var themesFirstLink 		= "Themes/pluralism_democracy.htm";
	var themesSecond 			= "Economy and Fight Against Poverty";
	var themesSecondLink 		= "Themes/economy.htm";
	var themesThird 			= "Regional Cooperation and Security";
	var themesThirdLink 		= "Themes/security.htm";
	
	
	var publications		= "Publications";
	var publicationsFirst 		= "2010";
	var publicationsFirstLink 	= "Publications/p2010.htm";
	var publicationsSecond 		= "2009";
	var publicationsSecondLink 	= "Publications/p2009.htm";
	var publicationsThird 		= "2008";
	var publicationsThirdLink 	= "Publications/p2008.htm";
	var publicationsFourth 		= "2007";
	var publicationsFourthLink 	= "Publications/p2007.htm";
	var publicationsFifth 		= "2006";
	var publicationsFifthLink 	= "Publications/p2006.htm";
	<!--	var publicationsFifthLink 	= "Publications/p2005.htm"; -->
<!--	var publicationsFifth 		= "2005"; -->
<!--	var publicationsFifthLink 	= "Publications/p2005.htm"; -->

	var links 				= "Links";
	var linksFirst 				= "Establishment of a New Political Culture";
	var linksFirstLink 			= "Links/pluralism_democracy.htm";
	var linksSecond 			= "Economy and Fight Against Poverty";
	var linksSecondLink	 		= "Links/economy.htm";
	var linksThird 				= "Regional Cooperation";
	var linksThirdLink 			= "Links/security.htm";

	
	var about 				= "About FES";
	var aboutFirst 				= "History";
	var aboutFirstLink 			= "Fes/history.htm";
	var aboutSecond 			= "Jobs";
	var aboutSecondLink 			= "Fes/jobs.htm";
	var aboutThird 				= "FES Worldwide";
	var aboutThirdLink 			= "Fes/worldwide.htm";
	var aboutFourth 			= "Contact Us";
	var aboutFourthLink 			= "Fes/contact.htm";
	
	var team 				= "Our Team";
	var teamLink 				= "Team/team.htm";
}

if (language == 2) {

	var news 			= "Aktuelles";
	var newsLink 			= "News/newsger.htm";

	var events 			= "Veranstaltungen";
	var eventsFirst 			= "Kasachstan";
	var eventsFirstLink 		= "Events/events_kz_ger.htm";
	var eventsSecond 			= "Kirgistan";
	var eventsSecondLink 		= "Events/events_kg_ger.htm";
	var eventsThird 			= "Usbekistan";
	var eventsThirdLink 		= "Events/events_uz_ger.htm";
	var eventsFourth 			= "Tadschikistan";
	var eventsFourthLink 		= "Events/events_tj_ger.htm";

	var country 			= "L&auml;nder"
	var countryFirst 			= "Kasachstan";
	var countryFirstLink 		= "Country/kzger.htm";
	var countrySecond 			= "Kirgistan";
	var countrySecondLink 		= "Country/kgger.htm";
	var countryThird 			= "Usbekistan";
	var countryThirdLink 		= "Country/uzger.htm";
	var countryFourth 			= "Tadschikistan";
	var countryFourthLink 		= "Country/tjger.htm";
	var countryFifth 			= "Turkmenistan";
	var countryFifthLink 		= "Country/tkger.htm";
	
	var themes 			= "Themen";
	var themesFirst 		= "Aufbau einer neuen politischen Kultur";
	var themesFirstLink 		= "Themes/pluralism_democracyger.htm";
	var themesSecond 		= "Wirtschaft und Armuts-bek&auml;mpfung";
	var themesSecondLink 		= "Themes/economyger.htm";
	var themesThird 		= "Regionale Zusammenarbeit";
	var themesThirdLink 		= "Themes/securityger.htm";

	
	var publications 		= "Publikationen";
	var publicationsFirst 		= "2010";
	var publicationsFirstLink 	= "Publications/p2010ger.htm";
	var publicationsSecond 		= "2009";
	var publicationsSecondLink 	= "Publications/p2009ger.htm";
	var publicationsThird 		= "2008";
	var publicationsThirdLink 	= "Publications/p2008ger.htm";
	var publicationsFourth 		= "2007";
	var publicationsFourthLink 	= "Publications/p2007ger.htm";
	var publicationsFifth 		= "2006";
	var publicationsFifthLink 	= "Publications/p2006ger.htm";
<!--	var publicationsFifth 		= "2005"; -->
<!--	var publicationsFifthLink 	= "Publications/p2005ger.htm"; -->

	var links 			= "Links";
	var linksFirst 			= "Aufbau einer neuen politischen Kultur";
	var linksFirstLink 		= "Links/pluralism_democracyger.htm";
	var linksSecond 		= "Wirtschaft und Armuts-bek&auml;mpfung";
	var linksSecondLink		= "Links/economyger.htm";
	var linksThird 			= "Regionale Zusammenarbeit";
	var linksThirdLink 		= "Links/securityger.htm";

	
	var about 			= "&Uuml;ber FES";
	var aboutFirst 			= "Geschichte";
	var aboutFirstLink 		= "Fes/historyger.htm";
	var aboutSecond 		= "Jobs";
	var aboutSecondLink 		= "Fes/jobsger.htm";
	var aboutThird 			= "FES Weltweit";
	var aboutThirdLink 		= "Fes/worldwideger.htm";
	var aboutFourth 		= "Kontakt";
	var aboutFourthLink 		= "FES/contactger.htm";
	
	var team 			= "Unser Team";
	var teamLink 			= "Team/teamger.htm";
}
if (language == 3) {

	var news 			= "Новости";
	var newsLink 			= "News/newsrus.htm";

	var events 			= "Мероприятия";
	var eventsFirst 		= "Казахстан";
	var eventsFirstLink 		= "Events/events_kz_rus.htm";
	var eventsSecond 		= "Кыргызстан";
	var eventsSecondLink		= "Events/events_kg_rus.htm";
	var eventsThird 		= "Узбекистан";
	var eventsThirdLink 		= "Events/events_uz_rus.htm";
	var eventsFourth 		= "Таджикистан";
	var eventsFourthLink		= "Events/events_tj_rus.htm";

	
	var country 			= "Активность стран"
	var countryFirst 		= "Казахстан";
	var countryFirstLink		= "Country/kzrus.htm";
	var countrySecond 		= "Кыргызстан";
	var countrySecondLink		= "Country/kgrus.htm";
	var countryThird 		= "Узбекистан";
	var countryThirdLink		= "Country/uzrus.htm";
	var countryFourth 		= "Таджикистан";
	var countryFourthLink 		= "Country/tjrus.htm";
	var countryFifth 		= "Туркменистан";
	var countryFifthLink 		= "Country/tkrus.htm";
	
	var themes 			= "Акценты";
	var themesFirst 		= "Плюрализм и демократия";
	var themesFirstLink 		= "Themes/pluralism_democracyrus.htm";
	var themesSecond 		= "Экономика";
	var themesSecondLink 		= "Themes/economyrus.htm";
	var themesThird 		= "Региональная кооперация";
	var themesThirdLink 		= "Themes/securityrus.htm";
	
	var publications 		= "Публикации";
	var publicationsFirst 		= "2010";
	var publicationsFirstLink 	= "Publications/p2010rus.htm";
	var publicationsSecond 		= "2009";
	var publicationsSecondLink 	= "Publications/p2009rus.htm";
	var publicationsThird 		= "2008";
	var publicationsThirdLink 	= "Publications/p2008rus.htm";
	var publicationsFourth 		= "2007";
	var publicationsFourthLink 	= "Publications/p2007rus.htm";
	var publicationsFifth 		= "2006";
	var publicationsFifthLink 	= "Publications/p2006rus.htm";
<!--	var publicationsFifth 		= "2005";  -->
<!--	var publicationsFifthLink 	= "Publications/p2005rus.htm";  -->

	var links 				= "Ссылки";
	var linksFirst 				= "Плюрализм и демократия";
	var linksFirstLink 			= "Links/pluralism_democracyrus.htm";
	var linksSecond 			= "Экономика";
	var linksSecondLink 			= "Links/economyrus.htm";
	var linksThird 				= "Региональная кооперация";
	var linksThirdLink 			= "Links/securityrus.htm";
		
	var about 				= "О FES";
	var aboutFirst 				= "История";
	var aboutFirstLink 			= "Fes/historyrus.htm";
	var aboutSecond 			= "Поиск работы";
	var aboutSecondLink 			= "Fes/jobsrus.htm";
	var aboutThird 				= "FES всемирно";
	var aboutThirdLink 			= "Fes/worldwiderus.htm";
	var aboutFourth 			= "Контакты";
	var aboutFourthLink 			= "Fes/contactrus.htm";
	
	var team 					= "Наш коллектив";
	var teamLink 				= "Team/teamrus.htm";
}

// Special effect string for IE5.5 or above please visit http://www.milonic.co.uk/menu/filters_sample.php for more filters
if(navigator.appVersion.indexOf("MSIE 6.0")>0)
	effect = " "
//	effect = "Fade(duration=0.2);Alpha(style=0,opacity=88);Shadow(color='#ffffff', Direction=135, Strength=5)"
else
	effect = " "
//	effect = "Shadow(color='#ffffff', Direction=135, Strength=5)" // Stop IE5.5 bug when using more than one filter

timegap=0			// The time delay for menus to remain visible
followspeed=3		// Follow Scrolling speed
followrate=20		// Follow Scrolling Rate
suboffset_top=10;	// Sub menu offset Top position 
suboffset_left=10;	// Sub menu offset Left position

style1=[			// style1 is an array of properties. You can have as many property arrays as you need. This means that menus can have their own style.
"#000066",			// Mouse Off Font Color
"#7a8dd6",			// Mouse Off Background Color
"#FFFFFF",			// Mouse On Font Color
"#000066",			// Mouse On Background Color
"#7a8dd6",			// Menu Border Color 
12,					// Font Size in pixels
"normal",			// Font Style (italic or normal)
"bold",				// Font Weight (bold or normal)
"Arial",			// Font Name
4,				// Menu Item Padding
menuHelper +arrow,	// Sub Menu Image (Leave this blank if not needed)
"",  				// 3D Border & Separator bar
"",     			// 3D High Color
"",      			// 3D Low Color
"#FFFFFF",			// Current Page Item Font Color (leave this blank to disable)
"#000066",			// Current Page Item Background Color (leave this blank to disable)
,					// Top Bar image (Leave this blank to disable)
"#ffffff",			// Menu Header Font Color (Leave blank if headers are not needed)
"#000066",			// Menu Header Background Color (Leave blank if headers are not needed)
"",  				// Menu Item Separator Color
]

addmenu(menu=[		// This is the array that contains your menu properties and details
"mainmenu",			// Menu Name - This is needed in order for the menu to be called
110,				// Menu Top - The Top position of the menu in pixels
15,					// Menu Left - The Left position of the menu in pixels
130,				// Menu Width - Menus width in pixels
,					// Menu Border Width 
,					// Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
style1,				// Properties Array - this is set higher up, as above
1,					// Always Visible - allows the menu item to be visible at all time (1=on/0=off)
"left",				// Alignment - sets the menu elements text alignment, values valid here are: left, right or center
effect,				// Filter - Text variable for setting transitional effects on menu activation - see above for more info
1,					// Follow Scrolling - Tells the menu item to follow the user down the screen (visible at all times) (1=on/0=off)
0, 					// Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style (1=on/0=off)
,					// Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page (1=on/0=off)
,					// Position of TOP sub image left:center:right
,					// Set the Overall Width of Horizontal Menu to 100% and height to the specified amount (Leave blank to disable)
,					// Right To Left - Used in Hebrew for example. (1=on/0=off)
,					// Open the Menus OnClick - leave blank for OnMouseover (1=on/0=off)
,					// ID of the div you want to hide on MouseOver (useful for hiding form elements)
,					// Background image for menu when BGColor set to transparent.
,					// Scrollable Menu
,					// Reserved for future use
					// "Description Text", "URL", "Alternate URL", "Status", "Separator Bar"
, news, menuHelper +newsLink,,"",1
, events,"show-menu=events",,"",1
, country,"show-menu=country",,"",1
, themes,"show-menu=themes",,"",1
, publications,"show-menu=publications",,"",1
, links,"show-menu=links",,"",1
, about,"show-menu=fes",,"",1
, team, menuHelper +teamLink,,"",1
])

addmenu(menu=["events",
,,120,1,"",style1,,"left",effect,,,,,,,,,,,,
, eventsFirst, menuHelper +eventsFirstLink,,,1
, eventsSecond, menuHelper +eventsSecondLink,,,1
, eventsThird, menuHelper +eventsThirdLink,,,1
, eventsFourth, menuHelper +eventsFourthLink,,,1
])

if (indexTrue != 1) {
	addmenu(menu=["country",
	,,120,1,"",style1,,"left",effect,,,,,,,,,,,,
	, countryFirst, menuHelper +countryFirstLink,,,1
	, countrySecond, menuHelper +countrySecondLink,,,1
	, countryThird, menuHelper +countryThirdLink,,,1
	, countryFourth, menuHelper +countryFourthLink,,,1
	, countryFifth, menuHelper +countryFifthLink,,,1
])
}

//show the active country map
if (indexTrue == 1) {
	addmenu(menu=["country",
	,,120,1,"",style1,,"left",effect,,,,,,,,,,,,
	, countryFirst, menuHelper +countryFirstLink +" onfunction=kz_on(); offfunction=kz_off();",,,1
	, countrySecond, menuHelper +countrySecondLink +" onfunction=kg_on(); offfunction=kg_off();",,,1
	, countryThird, menuHelper +countryThirdLink +" onfunction=uz_on(); offfunction=uz_off();",,,1
	, countryFourth, menuHelper +countryFourthLink +" onfunction=tg_on(); offfunction=tg_off();",,,1
	, countryFifth, menuHelper +countryFifthLink +" onfunction=turk_on(); offfunction=turk_off();",,,1
])
}

addmenu(menu=["themes",
,,120,1,"",style1,,"left",effect,,,,,,,,,,,,
, themesFirst, menuHelper +themesFirstLink,,,1
, themesSecond, menuHelper +themesSecondLink,,,1
, themesThird, menuHelper +themesThirdLink,,,1
])
		
addmenu(menu=["publications",
,,120,1,"",style1,,"left",effect,,,,,,,,,,,,
, publicationsFirst, menuHelper +publicationsFirstLink,,,1
, publicationsSecond, menuHelper +publicationsSecondLink,,,1
, publicationsThird, menuHelper +publicationsThirdLink,,,1
, publicationsFourth, menuHelper +publicationsFourthLink,,,1
, publicationsFifth, menuHelper +publicationsFifthLink,,,1
])
	
addmenu(menu=["links",
,,120,1,"",style1,,"left",effect,,,,,,,,,,,,
, linksFirst, menuHelper +linksFirstLink,,,1
, linksSecond, menuHelper +linksSecondLink,,,1
, linksThird, menuHelper +linksThirdLink,,,1
])
	
addmenu(menu=["fes",
,,120,1,"",style1,,"left",effect,,,,,,,,,,,,
, aboutFirst, menuHelper +aboutFirstLink,,,1
, aboutSecond, menuHelper +aboutSecondLink,,,1
, aboutThird, menuHelper +aboutThirdLink,,,1
, aboutFourth, menuHelper +aboutFourthLink,,,1
])
	
dumpmenus()

