<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -52,4 +52,4 @@
 &lt;/style&gt;
 &lt;script src=&quot;mootools.js&quot;&gt;&lt;/script&gt;
 &lt;script src=&quot;switch.js&quot;&gt;&lt;/script&gt;
-&lt;h1&gt;Switch!&lt;/h1&gt;
\ No newline at end of file
+&lt;body class=&quot;indestructible&quot;&gt;&lt;h1&gt;Switch!&lt;/h1&gt;&lt;/body&gt;
\ No newline at end of file</diff>
      <filename>demo.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,45 @@
 /*
 ------------------------------------------------------------------------------
-  switch:       John Muhl, based on the idea at 
-                http://alistapart.com/d/switchymclayout/
-                on the fly layout adjustment
+  switch:       John Muhl, based on switchy mclayout
+                &#8220;on the fly&#8221; layout adjustment
                 MIT License
-                ------------------------------------------------------------------------------
+------------------------------------------------------------------------------
   Requires:     MooTools v1.11 (MIT License)
 ------------------------------------------------------------------------------
 */
+function swClassy()
+{//swClassy removes any existing swhich class from &lt;body&gt;
+  var swBody = $$('body');
+
+  if (swBody.hasClass('xx-small') == 'true')
+    swBody.removeClass('xx-small');
+
+  if (swBody.hasClass('x-small') == 'true')
+    swBody.removeClass('x-small');
+
+  if (swBody.hasClass('small') == 'true')
+    swBody.removeClass('small');
+
+  if (swBody.hasClass('medium') == 'true')
+    swBody.removeClass('medium');
+
+  if (swBody.hasClass('large') == 'true')
+    swBody.removeClass('large');
+
+  if (swBody.hasClass('x-large') == 'true')
+    swBody.removeClass('x-large');
+
+  if (swBody.hasClass('xx-large') == 'true')
+    swBody.removeClass('xx-large');
+};
+
 var layoutSwitch = {
   init: function(){
   //fetch the window width
     var windowSize = window.getWidth();
   //strip any existing class
   //makes sure the resize event properly assigns a new class
-  //TODO write this as a regular expression to only remove switch classes
-    $$('body').removeProperty('class');
+  swClassy();
   //asign switch body classes
     if(windowSize &lt;= 455){
       $$('body').addClass('xx-small');</diff>
      <filename>switch.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8ac57b9ad6c289620466f69da2492d2442a9e3c6</id>
    </parent>
  </parents>
  <author>
    <name>johnmuhl</name>
    <email>git@johnmuhl.com</email>
  </author>
  <url>http://github.com/johnmuhl/switch/commit/035bf8f7ef13e10dd7c38ba86b23a8b8c38c50dc</url>
  <id>035bf8f7ef13e10dd7c38ba86b23a8b8c38c50dc</id>
  <committed-date>2008-06-29T12:44:41-07:00</committed-date>
  <authored-date>2008-06-29T12:44:41-07:00</authored-date>
  <message>backport swClassy function from 1.2 to 1.0 and update the demo to show off that we don't explode your body classes</message>
  <tree>577a60eae3cec627c4bcfd9f17d37bb60b6efea5</tree>
  <committer>
    <name>johnmuhl</name>
    <email>git@johnmuhl.com</email>
  </committer>
</commit>
