function loadFrames(submenuPage, contentPage) {
	open(submenuPage, "submenu");
	open(contentPage, "content");
}

function checkLocation(homePage) {
	if (parent.frames.length == 0) {
		setCookie("contentURL", document.title);
		if ((homePage == null) || (homePage == "")) {
			homePage = "/index.html";
		}
		open(homePage, "_top");
		//loadContent(document.title);
	}
}

function checkBasicLocation() {
	if (parent.frames.length == 0) {
		open("index.html", "_top");
		return true;
	}
	return false;
}

function loadContent(contentUrl) {
	if ((contentUrl == "undefined") || (contentUrl == null)) {
		var contentURL = getCookie("contentURL");
	}

	//is mainmenu.html selbst ohne Frame aufgerufen worden?
	if (checkBasicLocation()) {
		return;
	}
	
	//Laden der Frames
	if ((contentURL != null) && (contentURL != "")) {
		setCookie("contentURL", "");
		
		switch(contentURL) {			
			case "Content Start":
 				open("content.html", "content");
 			break;
			
			case "Mainmenu":
 				open("intro.html", "content");
 			break;
			
			case "Myself Submenu":
 				open("myself/index.html", "content");
				//open("myself/vorstellung_submenu.html", "submenu");
 			break;
			case "Myself Index":
 				open("myself/index.html", "content");
				//open("myself/vorstellung_submenu.html", "submenu");
 			break;
			case "Myself: Ich":
 				open("myself/ich.html", "content");
				//open("myself/vorstellung_submenu.html", "submenu");
 			break;
			case "Myself: Und Ich":
 				open("myself/undich.html", "content");
				open("submenu_myself.html", "submenu");
 			break;
			case "Myself: Andere":
 				open("myself/andere.html", "content");
				open("submenu_myself.html", "submenu");
 			break;
 			case "Myself: Geheimes Ich":
			 	open("myself/geheimesich.html", "content");
				open("submenu_myself.html", "submenu");
 			break;
			
			case "Misc: Index":
			 	open("misc/misc_index.html", "content");
				open("submenu_playground.html", "submenu");
 			break;
			case "Misc: Texte":
			 	open("misc/misc_texte.html", "content");
				open("submenu_playground.html", "submenu");
 			break;
			
			case "Projects: Content":
 				open("projects/projects_index.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Projects Submenu":
 				open("projects/projects_index.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Java Index":
 				open("projects/java/index.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Java: AnySelectionTable":
 				open("projects/java/AnySelectionTable/index.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Java: CheckBoxHeader":
 				open("projects/java/CheckBoxHeader/index.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Java: Multi Selection with JFileChooser":
 				open("projects/java/MultiSelectionFileChooser/index.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			
			case "Patterns":
 				open("projects/diplomarbeit/index.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Patterns Musterklassifikation":
 				open("projects/diplomarbeit/musterklassifikation.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Patterns: Patlet Struktur":
 				open("projects/diplomarbeit/patletstructure.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Patterns: Searchengine":
 				open("projects/diplomarbeit/searchengine.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Patterns: Suchmaschine Screenshots":
 				open("projects/diplomarbeit/searchscreenshots.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Administration Screenshots":
 				open("projects/diplomarbeit/adminscreenshots.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			
			case "Patterns: Einfuehrung":
 				open("projects/diplomarbeit/einfuehrung.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			case "Patterns: Vorarbeit":
 				open("projects/diplomarbeit/vorarbeit.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			
			case "Objectoriented Pragramming":
 				open("projects/jokes/index.html", "content");
				open("submenu_projects.html", "submenu");
 			break;
			
			case "Guestbook":
 				loadFrames("submenu.html", "guestbook.html");
 			break;
			case "Disclaimer":
 				loadFrames("submenu.html", "disclaimer.html");
 			break;
 		
 		
			
 			default:
				open("/index.html", "_top");
 			break;
		}
	}
}

/***************************************************************************************************/

function openNewWindow(htmlPage, theWidth, theHeight) {
	var newWindow = open(htmlPage, "outsideWindow", "width="+theWidth+", height="+theHeight+",resizable=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes");
	newWindow.focus();
}


