	var win;
	var visible = false;
	function changeLogin(){
			if(visible == false){
					showLogin();
				}
			else{
					hideLogin();
				}
	}
	function showLogin(){
			$('login').show();
			visible = true;
		}
	function hideLogin(){
			$('login').hide();
			visible = false;
		}
		
	/*function showPopup(myURL) {
		win = new Window('myContent', {
			className: "alphacube",
			title: "",
			url: myURL,
			width:677,
			height:500,
			resizable:true,
			draggable:true,
			minimizable:false,
			effectOptions:{duration:0}
			});
		win.setDestroyOnClose();
		win.setZIndex(1000);
		$('myContent_maximize').onclick = function() {
			top.location = $('myContent_content').src;
		}
		win.showCenter(true,null,40);
	}*/
	function showPopup(myURL, myHeiht, myWidth, hideCloseButton) {
		if(myHeiht==undefined){
			myHeiht = 677;
		}
		if(myWidth==undefined){
			myWidth = 500;
		}
		if(hideCloseButton==undefined){
			resize = true;
			drag = true;
		}else{
			resize = false;
			drag = false;
		}
		if(myURL.search("benutzerverwaltung/login/") != -1) {
			maxi = false;
		} else {
			maxi = true;
		}
		
		win = new Window('myContent', {
			className: "alphacube",
			title: "",
			url: myURL,
			width: myHeiht,
			height: myWidth,
			resizable: false,
			draggable: false,
			minimizable:false,
			effectOptions:{duration:1.5}
			});
		win.setDestroyOnClose();
		$('myContent_maximize').onclick = function() {
			top.location = $('myContent_content').src;
		}
		
		if(myURL.search("benutzerverwaltung/login/") != -1) {
			win.showCenter(true,47,178);
			$("myContent_maximize").hide();
		} else {
			win.showCenter(true);
		};
	}
	function updateTopFrame() {
		top.updatePopup($("page").getHeight());
	}
	if (window.location != top.location && window.name == 'myContent_content') {
		document.write('<link href="/styles/iframe-screen.css" rel="stylesheet" type="text/css" /><script type="text/javascript">Event.observe(window, "load", updateTopFrame, false);</script>');
	}
	function realInnerHeight(){
		var ar = new Array();
		ar.push(window.innerHeight);
		ar.push(document.body.clientHeight);
		ar.push(document.documentElement.clientHeight);
		return(ar.min());
	}		
	function updatePopup(newH) {
		newH = $A([realInnerHeight()-80,newH]).min();
		//win.updateHeight();
		//alert("a");
		win.setSize(677,newH);
		//alert("b");
		win._recenter();
	}
	
	
function createteaserrightbtnmenu() {
		var flexHeight = 228;
		//var teaserrightbtns = document.getElementsByClassName('teaserrightbutton','itright');
		var teaserrightbtns = $$('#itright .teaserrightbutton');
		if ($('vertretungen')) {
			Element.setStyle('vertretungen',{marginTop:'4px'});
			flexHeight -= Element.getHeight('vertretungen') + 4;
		}
		Element.setStyle(teaserrightbtns.last(),{marginBottom:0});
		var tmpHeight = 0;
		teaserrightbtns.each(function(trb){
				//alert(Element.getHeight(trb));
				tmpHeight += Element.getHeight(trb);
				trb.onclick = function() {
					myLink = this.getElementsByTagName('a')[0];
					if (myLink.target == "popup") {
						showPopup(myLink.href);
						}
					else if(myLink.target == "_blank"){
						top.location = myLink.href;
					} else {
						location = myLink.href;
					}
					return false;
				}
			});
		var tmpPadding = (flexHeight-(tmpHeight+(teaserrightbtns.length-1)*4))/(2*teaserrightbtns.length);
		teaserrightbtns.each(function(trb){
				Element.setStyle(trb, {paddingTop:Math.ceil(tmpPadding)+"px",paddingBottom:Math.floor(tmpPadding)+"px"});
			});
		var tmpHeight = 0;
		teaserrightbtns.each(function(trb){
			Element.setStyle(trb, {backgroundPosition:'0 '+(-tmpHeight)+'px'});
			trb.ypos = tmpHeight;
 			tmpHeight += Element.getHeight(trb)+4;
			trb.onmouseover = function() {
				Element.addClassName(this, 'aktiv');
				Element.setStyle(trb, {backgroundPosition:'-199px   '+(-this.ypos)+'px'});
			}
			trb.onmouseout = function() {
				Element.removeClassName(this, 'aktiv');
				Element.setStyle(trb, {backgroundPosition:'0 '+(-this.ypos)+'px'});
			}
		});
		Element.setStyle(teaserrightbtns.last(), {paddingBottom:(Math.floor(tmpPadding)+flexHeight-(tmpHeight-4))+"px"});
	}
//Event.observe(window, 'load', new Function('createteaserrightbtnmenu()'), false);