
       var j = jQuery.noConflict()
        j(document).ready(function() {  
        j(".styleswitch").click(function()
        {
            switchStylestyle(this.getAttribute("rel"));
            return false;
        });
        var c = readCookie('style');
        if (c) switchStylestyle(c);
		//j(".Spalte1 ul.lvl1 li.act ul.lvl2").hide();
		//j(".Spalte1 ul.lvl1 li.act ul.lvl2").show();
		
			j(".Spalte1 ul.lvl1 li").hover(function() { 
			
					j(this).parent().find("ul.lvl2").hide();					
					//j(this).parent().find('a.aktiv').css('background-image','url(images/subnavi.png)');
					j(".Spalte1 ul.lvl1 li.act ul.lvl2").hide();
					j(this).find("ul.lvl2").show();	
		
			}, function(){  
					j(this).find("ul.lvl2").hide();
					var is_active = j(this).find("a.aktiv").attr('class');
					j(".Spalte1 ul.lvl1 li.act ul.lvl2").show();
			});
			
        });

    function switchStylestyle(styleName)
    {
        j('link[rel*=style][title]').each(function(i) 
        {
        var bla = this.getAttribute('title');
        
            this.disabled = true;
            if (this.getAttribute('title') == styleName){
                this.disabled = false;
            
            }
        });
        createCookie('style', styleName, 365);
    }
    
    function createCookie(name,value,days)
{
    if (days)
    {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name)
{
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++)
    {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}
function eraseCookie(name)
{
    createCookie(name,"",-1);
}



// /cookie functions



