jQuery(function($){ $(document).ready(function(){ /*Close toggle*/ $('#bg-switcher-close').click(function(){ $('#bg-switcher').animate({ left: -200 }, 200).addClass('hidden'); $(this).hide(); $('#bg-switcher-open').show(); $.cookie('toggleBarCookie', 'hidden', { expires: 1, path: '/' }); return false; }); /*Open Toggle*/ $('#bg-switcher-open').click(function() { $('#bg-switcher').animate({ left: 0 }, 200, function(){ $('#bg-switcher').removeClass('hidden') }); $(this).hide(); $('#bg-switcher-close').show(); $.cookie('toggleBarCookie', 'visible', { expires: 1, path: '/' }); return false; }); /*Toggle Cookies*/ var toggleBarCookie = $.cookie('toggleBarCookie'); if(toggleBarCookie == 'hidden') { $("#bg-switcher").css({ left: -200 }, 200).addClass('hidden'); $('#bg-switcher-open').show(); }; if(toggleBarCookie == 'visible' || toggleBarCookie == null) { $("#bg-switcher").css({ left: 0 }, 200).removeClass('hidden'); $('#bg-switcher-close').show(); }; /*Layouts*/ $('#layout-select, #header-select').bind('change', function () { var url = $(this).val(); if (url) { window.location = url; } return false; }); }); });