Setting a Color theme with jQuery Cookie

/**
* @file
* Misc JQuery scripts in this file
*/

(function ($) {

// Instantiate drupal 7 JS.
Drupal.behaviors.themeDemo = {
  attach:function (context, settings) {
// End drupal context.

$(".click-panel").click(function() {
  $( "#toggle-wrapper").toggle( "slide" , { direction: "left" } );
});

// Set the theme highlight color to purple if clicked.
$("li.purple").click(function () {
  $("body").alterClass( 'color-palette*', 'color-palette-purple');
  $('#logo-img').attr('src', Drupal.settings.basePath + Drupal.settings.pathToTheme + '/images/logo-purple.png');
  $.cookie('cookiecolor', 'color-palette-purple', { expires:100000, path:'/' });
  $.cookie('cookieimg', 'logo-purple', { expires:100000, path:'/' });
});

// Set the theme highlight color to turquoise if clicked.
$("li.turquoise").click(function () {
  $("body").alterClass( 'color-palette*', 'color-palette-turquoise');
  $('#logo-img').attr('src', Drupal.settings.basePath + Drupal.settings.pathToTheme + '/images/logo-turquoise.png');
  $.cookie('cookiecolor', 'color-palette-turquoise', { expires:100000, path:'/' });
  $.cookie('cookieimg', 'logo-turquoise', { expires:100000, path:'/' });
});

// More colors...

// Set the cookies.
if ($.cookie('cookiecolor')) {
  $('body').alterClass( 'color-palette*').addClass($.cookie('cookiecolor'));
  var $imgsrc = $.cookie('cookieimg');
  $('#logo-img').attr('src', Drupal.settings.basePath + Drupal.settings.pathToTheme + '/images/' + $imgsrc + '.png');
}

    }
  }
})
(jQuery);

Resoures