function styleSwitcher(new_style)
{
    var loud = new Fx.Morph(new_style, {
        link: 'chain',
        transition: Fx.Transitions.Sine.easeIn
    });
    $(new_style).removeEvents('mouseover');
    $(new_style).removeEvents('mouseout');
    loud.start({
        'opacity': 1
    });
    var mute = new Fx.Morph(style, {
        link: 'chain',
        transition: Fx.Transitions.Sine.easeOut
    });
    mute.start({
        'opacity': 0.4
    });
    $(style).addEvent('mouseover', function(){
        mute.start({
            'opacity': 1
        });
    });
    $(style).addEvent('mouseout', function(){
        mute.start({
            'opacity': 0.4
        });
    });
    style=new_style;
    Fx.Morph.implement(Chain);
    var siteFade = new Fx.Morph('content', {duration: 'short'});

    siteFade.start({'opacity': 0.8}).chain(
        function(){
            $('stylez').href='/css/style_'+new_style+'.css';
            $('site_logo').src='images/'+new_style+'/logo_'+new_style+'.gif';
            d=new Date();
            d2=new Date(d.getTime()+31536000000);
            document.cookie='stylez='+new_style+';expires='+d2.toGMTString()+';domain=.gala.net';
            $('mail_iframe').src="http://auth.gala.net/CreateRequestServlet?new=1&style="+new_style;
        }
    );
    if(!Browser.Engine.trident){
        $('site_logo').onload = function(){
            $('mail_iframe').onload = function(){
                siteFade.start({
                    opacity: 1
                });
            }
        }
    }
    else{
        $('site_logo').onload = function(){
            siteFade.start({
                opacity: 1
            });
        }
    }
}

