
function printfenster(url,fe,br,ho) {
	var brI;
	var HoI;
	brI = (window.screen.width/2) - ((br/2) + 10);
	HoI = (window.screen.height/2) - ((ho/2) + 20);
	var win = window.open(url,fe,"height="+ho+",width="+br+",left=" + brI + ",top=" + HoI + ",screenX=" + brI + ",screenY=" + HoI + ",resizable=yes,scrollbars=yes,toolbar=no,menubar=yes,status=no");
	win.focus();
	window.event.returnValue=false;
	return false;
}
function fenster(url,fe,br,ho) {
	return printfenster(url,fe,br,ho);
}
function layer_switch(layer,newst){
    var obj=$("#"+layer);
    var newvis;
    var newdis;
    if ((newst=='show' && newst!='hidden') || (newst=='' && (obj.css('display')=='none' || obj.css('display')=='hidden')) ){
	   newvis='show';
	   newdis='block';
    }else{
	   newvis='hidden';
	   newdis='none';
    }
    obj.css({display:newdis,visibility:newvis});
}
function closelayover(){
    layer_switch('layoverstart1','hidden');
    layer_switch('layoverstart2','hidden');
}
function showlayover(){
    layer_switch('layoverstart1','show');
    layer_switch('layoverstart2','show');
}
$(document).ready(function(){
    $("A").click(function () { 
        t=document.location.protocol+"//"+document.location.host+"/";
        u=t.length;
        v=document.location.href.indexOf('.php/');
        w=document.location.href.substr(v+5);
        x=w.indexOf('/');
        y=w.substr(0,x);
        if (this.href.substr(0,u) != t && this.href.substr(0,11)!='javascript:'){
            $.getJSON("/content/elink.php/"+y+"/?l="+encodeURIComponent(this.href),
                function(data){
            });
        }
        return true;
    });
    $(".MenuBarArea ul ul ").css({display: "none"}); // Opera Fix
    $(".MenuBarArea LI").hover(function(){
            if($(this).parents().eq(1).attr('class')!='MenuBarArea'){
                $(this).parents().eq(1).find('A:first').addClass('sitemapactive');
            }
            if ($(this).find('ul:first').hasClass("sitemappages")){
                return;
            }
            if($(this).parents().get(1).tagName=='DIV' && ($(this).hasClass("sitemapreverse") || $(this).hasClass("sitemaplast"))){
                newval=$(this).outerWidth()-$(this).find('ul:first').outerWidth()+1;
                $(this).find('ul:first').css({left:newval});
            }
            /* 3. Ebene */
            if($(this).parents().get(3).tagName=='DIV' && $(this).find('UL:first').length > 0){
                thistop=$(this).position().top;
                parentheight=$(this).parent().outerHeight(true);
                mychild=$(this).find('UL:first');
                childheight=$(this).find('UL:first').outerHeight();
                if (childheight+thistop > parentheight){
                    newval2=-(thistop+childheight-parentheight-16);
                    $(this).find(':nth-child(2):first').css({top:newval2});
                }
            }
            $(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown(200);
		},function(){
			$(this).find('ul:first').css({visibility: "hidden"})
			$(this).parents().eq(1).find('A:first').removeClass('sitemapactive');
		});
    $("#layoverstart2").css({ marginTop:-$("#layoverstart2").height()/2, marginLeft:-$("#layoverstart2").width()/2 });
});
function CUflashtag(url,wid,hei,fva,bgc,wmo){
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width',wid,'height',hei,'src',url,'FlashVars',fva,'quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie',url,'bgcolor',bgc,'wmode',wmo ); 
}


