Movie search layout tweaks with cookie persistence
This seems a bit simpler (in terms of code repeating)

var Layout = {
    'Poster': {
        href: 'css/list.css'
    },
        'Description': {
        href: 'css/desc.css'
    }
};

function setLink(file, pathFix) {
    $('link:first').attr('href', pathFix + file);
}

$(function () {
    var currentPathFix = '',
        initialLayout = $.cookie("Layout");
    if (window.location.href.indexOf('/search/') &gt;= 0) {
        currentPathFix = '../';
    }
    setLink(Layout( initialLayout ), currentPathFix );
    $.each(Layout, function (key, item) {
        $('.' + key).click(function () {
            setLink(item.href, currentPathFix);
            $.cookie("Movie_Layout", key, {
                expires: 365,
                path: '/media/search',
                secure: true
            });
            $('.content-genre, .searchresults').hide().delay(75).fadeIn(275);
            window.scrollTo(0, 0);
        });
    });
});