function showSubMenue(element){
	if(checkBrowserName('MSIE 6.0')){  
		document.getElementById(element).className = "menu-hover";
	}
}
function hideSubMenue(element){
	if(checkBrowserName('MSIE 6.0')){  
		document.getElementById(element).className = "";
	}
	
}

/* User Agent (Browserkennung) auf einen bestimmten Browsertyp prüfen */  
function checkBrowserName(name){  
	var agent = navigator.userAgent.toLowerCase();  
	if (agent.indexOf(name.toLowerCase())>-1) {  
		return true;  
	}  
	return false;  
} 

//Function creates a cookie
function createCookie(){
	//Create cookies
	wert = 'logged-in=1;';
	//Writes the cookie
	document.cookie = wert;
	//Alert the user
	alert('Cookie erstellt');
}

//Function deletes cookie 
function logout(){
	//Delete cookie
	document.cookie = 'logged-in=1; expires=Thu, 01-Jan-70 00:00:01 GMT;';
}

//Function changes the div
function changeContent(div){
	testvalue = fetchCookie('logged-in');
	ao_kennung = fetchCookie('ao-kennung');
		
	if( testvalue == '1'){
		document.getElementById(div).innerHTML = '<p class="ao-log-in">Angemeldet als: </p><p class="ao-log-benutzer">'+ao_kennung+'</p><div><a class="ao-button-link ao-button-link-right ao-button-abmelden" href="/mein-aspectonline/logout/" onclick="logout();">Abmelden</a></div>';
		document.getElementById('my-aspect-online-sidebarelement-top').innerHTML = '<div id="my-aspect-online-header-active"><a href="mein-aspectonline/" rel="nofollow" onfocus="blurLink(this);">Mein ASPECT.online</a></div>';
	}	
}

//Function checks if a cookie exists and reads its value
function fetchCookie(name){
	i=0;  //Searchposition
	//alert(name);
	var suche = name+"=";
	while (i<document.cookie.length){
		if (document.cookie.substring(i, i+suche.length)==suche){
			ende = document.cookie.indexOf(";", i+suche.length);
			ende = (ende>-1) ? ende : document.cookie.length;
			cook = document.cookie.substring(i+suche.length, ende);
			return unescape(cook)
		}
		i++
	}
	return null
}




//changeContent('myao');

