// load when the DOM is ready
window.addEvent('domready', function () {
  // if style cookie exists, switch to that style
  if (Cookie.read('style'))
    new Asset.css('stylesheets/' + Cookie.read('style'));
  
  // for each element with loadCSS class
  $$('.loadCSS').each(function(el) {
    // add an onclick event
    el.addEvent('click', function() {
      // write the style cookie from the 'rel' attribute of the element
      Cookie.write('style', this.get('rel'), { duration: 1000 });
      // switch to stylesheet
      new Asset.css('stylesheets/' + this.get('rel'));
      // cancel click event
      return false;
    });
  });
});