// changing language, menu and content of infobox
var Language = 0; // 0 = German, 1 = English
var MainMenu = 0;
var SubMenu = 0;

var i, j, idx, lng;

var NUM_LANGUAGE = 2;
var NUM_MAINMENU = 6;
var NUM_SUBMENUS = 5;

// define array for navigation and welcome text
var navibox = new Array ("mainmenu_d.png","mainmenu_e.png");
var welcome = new Array ("welcome_d.png","welcome_e.png");

// define array for button texts
var db1 = new Array (NUM_LANGUAGE);
for(i = 0; i < NUM_LANGUAGE; i++) {
	db1[i] = new Array (NUM_MAINMENU);
	for(j = 0; j < NUM_MAINMENU; j++) {
		db1[i][j] = new Array (NUM_SUBMENUS);
	}
}
db1[0][0][0] = "Über uns";
db1[0][0][1] = "Neuigkeiten";
db1[0][0][2] = "Ausstellungen";
db1[0][0][3] = "Kosten";
db1[0][0][4] = "Chronik";
db1[0][1][0] = "Welpen";
db1[0][1][1] = "Nachwuchs";
db1[0][1][2] = "Deckrüden";
db1[0][1][3] = "Hündinnen";
db1[0][1][4] = "Oldies";
db1[0][2][0] = "Bilder vom Profi";
db1[0][2][1] = "Schnappschüsse";
db1[0][2][2] = "Im neuen Heim";
db1[0][2][3] = "Diaschau";
db1[0][2][4] = "";
db1[0][3][0] = "Zuchtverbände";
db1[0][3][1] = "Andere Züchter";
db1[0][3][2] = "Tierportale";
db1[0][3][3] = "";
db1[0][3][4] = "";
db1[0][4][0] = "";
db1[0][4][1] = "";
db1[0][4][2] = "";
db1[0][4][3] = "";
db1[0][4][4] = "";
db1[0][5][0] = "";
db1[0][5][1] = "";
db1[0][5][2] = "";
db1[0][5][3] = "";
db1[0][5][4] = "";
db1[1][0][0] = "About us";
db1[1][0][1] = "News";
db1[1][0][2] = "Show results";
db1[1][0][3] = "Costs";
db1[1][0][4] = "Chronic";
db1[1][1][0] = "Puppies";
db1[1][1][1] = "Youngsters";
db1[1][1][2] = "Stud dogs";
db1[1][1][3] = "Females";
db1[1][1][4] = "Oldies";
db1[1][2][0] = "Professional pic´s";
db1[1][2][1] = "Snapshots";
db1[1][2][2] = "From the new home";
db1[1][2][3] = "Slideshow";
db1[1][2][4] = "";
db1[1][3][0] = "Associations";
db1[1][3][1] = "Other breeders";
db1[1][3][2] = "Animal websides";
db1[1][3][3] = "";
db1[1][3][4] = "";
db1[1][4][0] = "";
db1[1][4][1] = "";
db1[1][4][2] = "";
db1[1][4][3] = "";
db1[1][4][4] = "";
db1[1][5][0] = "";
db1[1][5][1] = "";
db1[1][5][2] = "";
db1[1][5][3] = "";
db1[1][5][4] = "";

// define array for visibility
var db2 = new Array (NUM_LANGUAGE);
for(i = 0; i < NUM_LANGUAGE; i++) {
	db2[i] = new Array (NUM_MAINMENU);
	for(j = 0; j < NUM_MAINMENU; j++) {
		db2[i][j] = new Array (NUM_SUBMENUS);
	}
}
db2[0][0][0] = "visible";
db2[0][0][1] = "visible";
db2[0][0][2] = "visible";
db2[0][0][3] = "visible";
db2[0][0][4] = "hidden";
db2[0][1][0] = "visible";
db2[0][1][1] = "visible";
db2[0][1][2] = "visible";
db2[0][1][3] = "visible";
db2[0][1][4] = "visible";
db2[0][2][0] = "visible";
db2[0][2][1] = "visible";
db2[0][2][2] = "visible";
db2[0][2][3] = "hidden";
db2[0][2][4] = "hidden";
db2[0][3][0] = "hidden";
db2[0][3][1] = "hidden";
db2[0][3][2] = "hidden";
db2[0][3][3] = "hidden";
db2[0][3][4] = "hidden";
db2[0][4][0] = "hidden";
db2[0][4][1] = "hidden";
db2[0][4][2] = "hidden";
db2[0][4][3] = "hidden";
db2[0][4][4] = "hidden";
db2[0][5][0] = "hidden";
db2[0][5][1] = "hidden";
db2[0][5][2] = "hidden";
db2[0][5][3] = "hidden";
db2[0][5][4] = "hidden";

db2[1][0][0] = "visible";
db2[1][0][1] = "visible";
db2[1][0][2] = "visible";
db2[1][0][3] = "visible";
db2[1][0][4] = "hidden";
db2[1][1][0] = "visible";
db2[1][1][1] = "visible";
db2[1][1][2] = "visible";
db2[1][1][3] = "visible";
db2[1][1][4] = "visible";
db2[1][2][0] = "visible";
db2[1][2][1] = "visible";
db2[1][2][2] = "visible";
db2[1][2][3] = "hidden";
db2[1][2][4] = "hidden";
db2[1][3][0] = "hidden";
db2[1][3][1] = "hidden";
db2[1][3][2] = "hidden";
db2[1][3][3] = "hidden";
db2[1][3][4] = "hidden";
db2[1][4][0] = "hidden";
db2[1][4][1] = "hidden";
db2[1][4][2] = "hidden";
db2[1][4][3] = "hidden";
db2[1][4][4] = "hidden";
db2[1][5][0] = "hidden";
db2[1][5][1] = "hidden";
db2[1][5][2] = "hidden";
db2[1][5][3] = "hidden";
db2[1][5][4] = "hidden";

// define array for contents
var db3 = new Array (NUM_LANGUAGE);
for(i = 0; i < NUM_LANGUAGE; i++) {
	db3[i] = new Array (NUM_MAINMENU);
	for(j = 0; j < NUM_MAINMENU; j++) {
		db3[i][j] = new Array (NUM_SUBMENUS+1);
	}
}
db3[0][0][0] = "information.html";
db3[0][0][1] = "aboutus.html";
db3[0][0][2] = "news.html";
db3[0][0][3] = "shows.html";
db3[0][0][4] = "costs.html";
db3[0][0][5] = "chronic.html";

db3[0][1][0] = "ourdogs.html";
db3[0][1][1] = "puppies.html";
db3[0][1][2] = "youngsters.html";
db3[0][1][3] = "males.html";
db3[0][1][4] = "females.html";
db3[0][1][5] = "oldies.html";

db3[0][2][0] = "pictures.html";
db3[0][2][1] = "profpics.html";
db3[0][2][2] = "snapshots.html";
db3[0][2][3] = "newhome.html";
db3[0][2][4] = "slideshow.html";
db3[0][2][5] = "";

db3[0][3][0] = "links.html";
db3[0][3][1] = "";
db3[0][3][2] = "";
db3[0][3][3] = "";
db3[0][3][4] = "";
db3[0][3][5] = "";

db3[0][4][0] = "guestbook.html";
db3[0][4][1] = "";
db3[0][4][2] = "";
db3[0][4][3] = "";
db3[0][4][4] = "";
db3[0][4][5] = "";

db3[0][5][0] = "disclaimer.html";
db3[0][5][1] = "";
db3[0][5][2] = "";
db3[0][5][3] = "";
db3[0][5][4] = "";
db3[0][5][5] = "";

db3[1][0][0] = "information_e.html";
db3[1][0][1] = "aboutus_e.html";
db3[1][0][2] = "news.html";
db3[1][0][3] = "shows.html";
db3[1][0][4] = "costs_e.html";
db3[1][0][5] = "chronic.html";

db3[1][1][0] = "ourdogs_e.html";
db3[1][1][1] = "puppies.html";
db3[1][1][2] = "youngsters.html";
db3[1][1][3] = "males.html";
db3[1][1][4] = "females.html";
db3[1][1][5] = "oldies.html";

db3[1][2][0] = "pictures_e.html";
db3[1][2][1] = "profpics_e.html";
db3[1][2][2] = "snapshots.html";
db3[1][2][3] = "newhome.html";
db3[1][2][4] = "slideshow.html";
db3[1][2][5] = "";

db3[1][3][0] = "links_e.html";
db3[1][3][1] = "";
db3[1][3][2] = "";
db3[1][3][3] = "";
db3[1][3][4] = "";
db3[1][3][5] = "";

db3[1][4][0] = "guestbook.html";
db3[1][4][1] = "";
db3[1][4][2] = "";
db3[1][4][3] = "";
db3[1][4][4] = "";
db3[1][4][5] = "";

db3[1][5][0] = "disclaimer.html";
db3[1][5][1] = "";
db3[1][5][2] = "";
db3[1][5][3] = "";
db3[1][5][4] = "";
db3[1][5][5] = "";

function ChangeLanguage(lng) {
	Language = lng;
	MainMenu = 0;
	SubMenu = 0;
	window.document.myNavi.src = navibox[Language];
	window.document.Hello.Pic1.src = welcome[Language];
	// show start side
	window.document.Hello.Pic1.style.visibility="visible";
	window.document.Hello.Pic2.style.visibility="visible";
	window.document.SubMenu.Sub1_Btn.style.visibility = "hidden";
	window.document.SubMenu.Sub2_Btn.style.visibility = "hidden";
	window.document.SubMenu.Sub3_Btn.style.visibility = "hidden";
	window.document.SubMenu.Sub4_Btn.style.visibility = "hidden";
	window.document.SubMenu.Sub5_Btn.style.visibility = "hidden";
	window.document.SubMenu.Sub_Info.style.visibility = "hidden";
	// reset frame
	parent.myFrame.style.visibility = "hidden";
}

function ChangeMainMenu (main, lng, sub) {
	Language = lng;
	MainMenu = main;
	SubMenu = sub;
	// change text
	window.document.SubMenu.Sub1_Btn.value = db1[Language][MainMenu][0];
	window.document.SubMenu.Sub2_Btn.value = db1[Language][MainMenu][1];
	window.document.SubMenu.Sub3_Btn.value = db1[Language][MainMenu][2];
	window.document.SubMenu.Sub4_Btn.value = db1[Language][MainMenu][3];
	window.document.SubMenu.Sub5_Btn.value = db1[Language][MainMenu][4];
	// change visibility
	window.document.Hello.Pic1.style.visibility="hidden";
	window.document.Hello.Pic2.style.visibility="hidden";
	window.document.SubMenu.Sub1_Btn.style.visibility = db2[Language][MainMenu][0];
	window.document.SubMenu.Sub2_Btn.style.visibility = db2[Language][MainMenu][1];
	window.document.SubMenu.Sub3_Btn.style.visibility = db2[Language][MainMenu][2];
	window.document.SubMenu.Sub4_Btn.style.visibility = db2[Language][MainMenu][3];
	window.document.SubMenu.Sub5_Btn.style.visibility = db2[Language][MainMenu][4];
	window.document.SubMenu.Sub_Info.style.visibility="visible";
	// change frame content
	ChangeSubMenu(SubMenu);	
}

function ChangeSubMenu(sub) {
	var Content, Showing;
	SubMenu = sub;
	Content = db3[Language][MainMenu][SubMenu];
	parent.myFrame.location.href = Content;
	Showing = document.getElementById("myFrameId")
	Showing.style.visibility = "visible";
	// change color of button
	window.document.SubMenu.Sub1_Btn.style.color = "#808080";
	window.document.SubMenu.Sub2_Btn.style.color = "#808080";
	window.document.SubMenu.Sub3_Btn.style.color = "#808080";
	window.document.SubMenu.Sub4_Btn.style.color = "#808080";
	window.document.SubMenu.Sub5_Btn.style.color = "#808080";
	switch(SubMenu) {
		case 0:
			break;
		case 1:
			window.document.SubMenu.Sub1_Btn.style.color = "#000000";
			break;
		case 2:
			window.document.SubMenu.Sub2_Btn.style.color = "#000000";
			break;
		case 3:
			window.document.SubMenu.Sub3_Btn.style.color = "#000000";
			break;
		case 4:
			window.document.SubMenu.Sub4_Btn.style.color = "#000000";
			break;
		case 5:
			window.document.SubMenu.Sub5_Btn.style.color = "#000000";
			break;
	}
}



